mirror of
https://github.com/rustdesk/rustdesk-server.git
synced 2025-07-01 23:35:38 +00: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",
|
"serde_json",
|
||||||
"sodiumoxide",
|
"sodiumoxide",
|
||||||
"sqlx",
|
"sqlx",
|
||||||
|
"static_vcruntime",
|
||||||
"tokio-tungstenite",
|
"tokio-tungstenite",
|
||||||
"tower-http",
|
"tower-http",
|
||||||
"tungstenite",
|
"tungstenite",
|
||||||
@ -2092,6 +2093,12 @@ version = "1.1.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
|
checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "static_vcruntime"
|
||||||
|
version = "2.0.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "954e3e877803def9dc46075bf4060147c55cd70db97873077232eae0269dc89b"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "stringprep"
|
name = "stringprep"
|
||||||
version = "0.1.2"
|
version = "0.1.2"
|
||||||
|
@ -54,6 +54,7 @@ ping = "0.4.0"
|
|||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
hbb_common = { path = "libs/hbb_common" }
|
hbb_common = { path = "libs/hbb_common" }
|
||||||
|
static_vcruntime = "2.0"
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
members = ["libs/hbb_common"]
|
members = ["libs/hbb_common"]
|
||||||
|
3
build.rs
3
build.rs
@ -1,3 +1,6 @@
|
|||||||
fn main() {
|
fn main() {
|
||||||
hbb_common::gen_version();
|
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",
|
"once_cell",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
|
"static_vcruntime",
|
||||||
"tauri",
|
"tauri",
|
||||||
"tauri-build",
|
"tauri-build",
|
||||||
"windows-service",
|
"windows-service",
|
||||||
@ -2625,6 +2626,12 @@ dependencies = [
|
|||||||
"loom",
|
"loom",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "static_vcruntime"
|
||||||
|
version = "2.0.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "954e3e877803def9dc46075bf4060147c55cd70db97873077232eae0269dc89b"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "string_cache"
|
name = "string_cache"
|
||||||
version = "0.8.4"
|
version = "0.8.4"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "rustdesk_server"
|
name = "rustdesk_server"
|
||||||
version = "0.1.1"
|
version = "0.1.2"
|
||||||
description = "rustdesk server gui"
|
description = "rustdesk server gui"
|
||||||
authors = ["elilchen"]
|
authors = ["elilchen"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
@ -8,6 +8,7 @@ edition = "2021"
|
|||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
|
static_vcruntime = "2.0"
|
||||||
tauri-build = { version = "1.2", features = [] }
|
tauri-build = { version = "1.2", features = [] }
|
||||||
winres = "0.1"
|
winres = "0.1"
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
fn main() {
|
fn main() {
|
||||||
tauri_build::build();
|
tauri_build::build();
|
||||||
if cfg!(target_os = "windows") {
|
if cfg!(target_os = "windows") {
|
||||||
let mut res = winres::WindowsResource::new();
|
let mut res = winres::WindowsResource::new();
|
||||||
res.set_icon("icons\\icon.ico");
|
res.set_icon("icons\\icon.ico");
|
||||||
@ -17,5 +17,6 @@ fn main() {
|
|||||||
"#,
|
"#,
|
||||||
);
|
);
|
||||||
res.compile().unwrap();
|
res.compile().unwrap();
|
||||||
|
static_vcruntime::metabuild();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,13 +22,14 @@ class View {
|
|||||||
event.listen('__update__', this.appAction.bind(this));
|
event.listen('__update__', this.appAction.bind(this));
|
||||||
event.emit('__action__', '__init__');
|
event.emit('__action__', '__init__');
|
||||||
while (true) {
|
while (true) {
|
||||||
|
let now = Date.now();
|
||||||
try {
|
try {
|
||||||
await this.update();
|
await this.update();
|
||||||
this.render();
|
this.render();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(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() {
|
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 hbbr'
|
||||||
nsExec::Exec 'sc stop hbbs'
|
nsExec::Exec 'sc stop hbbs'
|
||||||
nsExec::Exec 'taskkill /F /IM ${PRODUCT_NAME}.exe'
|
nsExec::Exec 'taskkill /F /IM ${PRODUCT_NAME}.exe'
|
||||||
Sleep 500 ;
|
Sleep 500
|
||||||
|
|
||||||
SetOutPath $INSTDIR
|
SetOutPath $INSTDIR
|
||||||
File /r "setup\*.*"
|
File /r "setup\*.*"
|
||||||
@ -77,12 +77,12 @@ Section "Install"
|
|||||||
CreateShortCut "$SMPROGRAMS\${APP_NAME}\${APP_NAME}.lnk" "$INSTDIR\${PRODUCT_NAME}.exe"
|
CreateShortCut "$SMPROGRAMS\${APP_NAME}\${APP_NAME}.lnk" "$INSTDIR\${PRODUCT_NAME}.exe"
|
||||||
CreateShortCut "$SMPROGRAMS\${APP_NAME}\Uninstall.lnk" "$INSTDIR\uninstall.exe"
|
CreateShortCut "$SMPROGRAMS\${APP_NAME}\Uninstall.lnk" "$INSTDIR\uninstall.exe"
|
||||||
CreateShortCut "$DESKTOP\${APP_NAME}.lnk" "$INSTDIR\${PRODUCT_NAME}.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=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=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=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'
|
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
|
SectionEnd
|
||||||
|
|
||||||
Section "Uninstall"
|
Section "Uninstall"
|
||||||
@ -90,7 +90,7 @@ Section "Uninstall"
|
|||||||
nsExec::Exec 'sc stop hbbr'
|
nsExec::Exec 'sc stop hbbr'
|
||||||
nsExec::Exec 'sc stop hbbs'
|
nsExec::Exec 'sc stop hbbs'
|
||||||
nsExec::Exec 'taskkill /F /IM ${PRODUCT_NAME}.exe'
|
nsExec::Exec 'taskkill /F /IM ${PRODUCT_NAME}.exe'
|
||||||
Sleep 500 ;
|
Sleep 500
|
||||||
|
|
||||||
RMDir /r "$SMPROGRAMS\${APP_NAME}"
|
RMDir /r "$SMPROGRAMS\${APP_NAME}"
|
||||||
Delete "$SMSTARTUP\${APP_NAME}.lnk"
|
Delete "$SMSTARTUP\${APP_NAME}.lnk"
|
||||||
@ -98,11 +98,16 @@ Section "Uninstall"
|
|||||||
nsExec::Exec 'sc delete hbbr'
|
nsExec::Exec 'sc delete hbbr'
|
||||||
nsExec::Exec 'sc delete hbbs'
|
nsExec::Exec 'sc delete hbbs'
|
||||||
nsExec::Exec 'netsh advfirewall firewall delete rule name="${APP_NAME}"'
|
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
|
SectionEnd
|
||||||
|
|
||||||
####################################################################
|
####################################################################
|
||||||
# Functions
|
# Functions
|
||||||
|
|
||||||
Function CreateStartupShortcut
|
Function CreateStartupShortcut
|
||||||
CreateShortCut "$DESKTOP\${APP_NAME}.lnk" "$INSTDIR\${PRODUCT_NAME}.exe"
|
CreateShortCut "$SMSTARTUP\${APP_NAME}.lnk" "$INSTDIR\${PRODUCT_NAME}.exe"
|
||||||
FunctionEnd
|
FunctionEnd
|
@ -59,6 +59,7 @@ pub async fn run(sender: Sender<Event>, receiver: Receiver<Event>) {
|
|||||||
// }
|
// }
|
||||||
WindowEvent::CloseRequested { api, .. } => {
|
WindowEvent::CloseRequested { api, .. } => {
|
||||||
api.prevent_close();
|
api.prevent_close();
|
||||||
|
event.window().minimize().unwrap();
|
||||||
event.window().hide().unwrap();
|
event.window().hide().unwrap();
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
"icons/icon.icns",
|
"icons/icon.icns",
|
||||||
"icons/icon.ico"
|
"icons/icon.ico"
|
||||||
],
|
],
|
||||||
"identifier": "rustdesk_server",
|
"identifier": "rustdesk.server",
|
||||||
"longDescription": "",
|
"longDescription": "",
|
||||||
"macOS": {
|
"macOS": {
|
||||||
"entitlements": null,
|
"entitlements": null,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user