mirror of
https://github.com/rustdesk/rustdesk-server.git
synced 2024-11-27 14:59:21 +08:00
issues #192 add MicrosoftEdgeWebview2Setup and fix the "VCRUNTIME140.dll Is Missing" error on windows server 2022
This commit is contained in:
parent
7c3be2d9fb
commit
ad40d65070
7
Cargo.lock
generated
7
Cargo.lock
generated
@ -816,6 +816,7 @@ dependencies = [
|
||||
"serde_json",
|
||||
"sodiumoxide",
|
||||
"sqlx",
|
||||
"static_vcruntime",
|
||||
"tokio-tungstenite",
|
||||
"tower-http",
|
||||
"tungstenite",
|
||||
@ -2092,6 +2093,12 @@ version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
|
||||
|
||||
[[package]]
|
||||
name = "static_vcruntime"
|
||||
version = "2.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "954e3e877803def9dc46075bf4060147c55cd70db97873077232eae0269dc89b"
|
||||
|
||||
[[package]]
|
||||
name = "stringprep"
|
||||
version = "0.1.2"
|
||||
|
@ -54,6 +54,7 @@ ping = "0.4.0"
|
||||
|
||||
[build-dependencies]
|
||||
hbb_common = { path = "libs/hbb_common" }
|
||||
static_vcruntime = "2.0"
|
||||
|
||||
[workspace]
|
||||
members = ["libs/hbb_common"]
|
||||
|
3
build.rs
3
build.rs
@ -1,3 +1,6 @@
|
||||
fn main() {
|
||||
hbb_common::gen_version();
|
||||
if cfg!(target_os = "windows") {
|
||||
static_vcruntime::metabuild();
|
||||
}
|
||||
}
|
||||
|
7
ui/Cargo.lock
generated
7
ui/Cargo.lock
generated
@ -2324,6 +2324,7 @@ dependencies = [
|
||||
"once_cell",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"static_vcruntime",
|
||||
"tauri",
|
||||
"tauri-build",
|
||||
"windows-service",
|
||||
@ -2625,6 +2626,12 @@ dependencies = [
|
||||
"loom",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "static_vcruntime"
|
||||
version = "2.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "954e3e877803def9dc46075bf4060147c55cd70db97873077232eae0269dc89b"
|
||||
|
||||
[[package]]
|
||||
name = "string_cache"
|
||||
version = "0.8.4"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "rustdesk_server"
|
||||
version = "0.1.1"
|
||||
version = "0.1.2"
|
||||
description = "rustdesk server gui"
|
||||
authors = ["elilchen"]
|
||||
edition = "2021"
|
||||
@ -8,6 +8,7 @@ edition = "2021"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[build-dependencies]
|
||||
static_vcruntime = "2.0"
|
||||
tauri-build = { version = "1.2", features = [] }
|
||||
winres = "0.1"
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
fn main() {
|
||||
tauri_build::build();
|
||||
tauri_build::build();
|
||||
if cfg!(target_os = "windows") {
|
||||
let mut res = winres::WindowsResource::new();
|
||||
res.set_icon("icons\\icon.ico");
|
||||
@ -17,5 +17,6 @@ fn main() {
|
||||
"#,
|
||||
);
|
||||
res.compile().unwrap();
|
||||
static_vcruntime::metabuild();
|
||||
}
|
||||
}
|
||||
|
@ -22,13 +22,14 @@ class View {
|
||||
event.listen('__update__', this.appAction.bind(this));
|
||||
event.emit('__action__', '__init__');
|
||||
while (true) {
|
||||
let now = Date.now();
|
||||
try {
|
||||
await this.update();
|
||||
this.render();
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
await new Promise(r => setTimeout(r, 100));
|
||||
await new Promise(r => setTimeout(r, Math.max(0, 33 - (Date.now() - now))));
|
||||
}
|
||||
}
|
||||
async update() {
|
||||
|
13
ui/setup.nsi
13
ui/setup.nsi
@ -67,7 +67,7 @@ Section "Install"
|
||||
nsExec::Exec 'sc stop hbbr'
|
||||
nsExec::Exec 'sc stop hbbs'
|
||||
nsExec::Exec 'taskkill /F /IM ${PRODUCT_NAME}.exe'
|
||||
Sleep 500 ;
|
||||
Sleep 500
|
||||
|
||||
SetOutPath $INSTDIR
|
||||
File /r "setup\*.*"
|
||||
@ -77,12 +77,12 @@ Section "Install"
|
||||
CreateShortCut "$SMPROGRAMS\${APP_NAME}\${APP_NAME}.lnk" "$INSTDIR\${PRODUCT_NAME}.exe"
|
||||
CreateShortCut "$SMPROGRAMS\${APP_NAME}\Uninstall.lnk" "$INSTDIR\uninstall.exe"
|
||||
CreateShortCut "$DESKTOP\${APP_NAME}.lnk" "$INSTDIR\${PRODUCT_NAME}.exe"
|
||||
CreateShortCut "$SMSTARTUP\${APP_NAME}.lnk" "$INSTDIR\${PRODUCT_NAME}.exe"
|
||||
|
||||
nsExec::Exec 'netsh advfirewall firewall add rule name="${APP_NAME}" dir=in action=allow program="$INSTDIR\hbbs.exe" enable=yes'
|
||||
nsExec::Exec 'netsh advfirewall firewall add rule name="${APP_NAME}" dir=out action=allow program="$INSTDIR\hbbs.exe" enable=yes'
|
||||
nsExec::Exec 'netsh advfirewall firewall add rule name="${APP_NAME}" dir=in action=allow program="$INSTDIR\hbbr.exe" enable=yes'
|
||||
nsExec::Exec 'netsh advfirewall firewall add rule name="${APP_NAME}" dir=out action=allow program="$INSTDIR\hbbr.exe" enable=yes'
|
||||
ExecWait 'powershell.exe -NoProfile -windowstyle hidden try { [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 } catch {}; Invoke-WebRequest -Uri "https://go.microsoft.com/fwlink/p/?LinkId=2124703" -OutFile "$$env:TEMP\MicrosoftEdgeWebview2Setup.exe" ; Start-Process -FilePath "$$env:TEMP\MicrosoftEdgeWebview2Setup.exe" -ArgumentList ($\'/silent$\', $\'/install$\') -Wait'
|
||||
SectionEnd
|
||||
|
||||
Section "Uninstall"
|
||||
@ -90,7 +90,7 @@ Section "Uninstall"
|
||||
nsExec::Exec 'sc stop hbbr'
|
||||
nsExec::Exec 'sc stop hbbs'
|
||||
nsExec::Exec 'taskkill /F /IM ${PRODUCT_NAME}.exe'
|
||||
Sleep 500 ;
|
||||
Sleep 500
|
||||
|
||||
RMDir /r "$SMPROGRAMS\${APP_NAME}"
|
||||
Delete "$SMSTARTUP\${APP_NAME}.lnk"
|
||||
@ -98,11 +98,16 @@ Section "Uninstall"
|
||||
nsExec::Exec 'sc delete hbbr'
|
||||
nsExec::Exec 'sc delete hbbs'
|
||||
nsExec::Exec 'netsh advfirewall firewall delete rule name="${APP_NAME}"'
|
||||
RMDir /r "$INSTDIR\bin"
|
||||
RMDir /r "$INSTDIR\logs"
|
||||
RMDir /r "$INSTDIR\service"
|
||||
Delete "$INSTDIR\${PRODUCT_NAME}.exe"
|
||||
Delete "$INSTDIR\uninstall.exe"
|
||||
SectionEnd
|
||||
|
||||
####################################################################
|
||||
# Functions
|
||||
|
||||
Function CreateStartupShortcut
|
||||
CreateShortCut "$DESKTOP\${APP_NAME}.lnk" "$INSTDIR\${PRODUCT_NAME}.exe"
|
||||
CreateShortCut "$SMSTARTUP\${APP_NAME}.lnk" "$INSTDIR\${PRODUCT_NAME}.exe"
|
||||
FunctionEnd
|
@ -59,6 +59,7 @@ pub async fn run(sender: Sender<Event>, receiver: Receiver<Event>) {
|
||||
// }
|
||||
WindowEvent::CloseRequested { api, .. } => {
|
||||
api.prevent_close();
|
||||
event.window().minimize().unwrap();
|
||||
event.window().hide().unwrap();
|
||||
}
|
||||
_ => {}
|
||||
|
@ -47,7 +47,7 @@
|
||||
"icons/icon.icns",
|
||||
"icons/icon.ico"
|
||||
],
|
||||
"identifier": "rustdesk_server",
|
||||
"identifier": "rustdesk.server",
|
||||
"longDescription": "",
|
||||
"macOS": {
|
||||
"entitlements": null,
|
||||
|
Loading…
Reference in New Issue
Block a user