From 18a205f60e28dc98b838e010dd6df7e2b4d65da9 Mon Sep 17 00:00:00 2001 From: dinger1986 Date: Thu, 4 Aug 2022 00:09:49 +0100 Subject: [PATCH] Update and rename WindowsAIOInstall.ps1 to WindowsAgentAIOInstall.ps1 --- ...sAIOInstall.ps1 => WindowsAgentAIOInstall.ps1 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) rename WindowsAIOInstall.ps1 => WindowsAgentAIOInstall.ps1 (66%) diff --git a/WindowsAIOInstall.ps1 b/WindowsAgentAIOInstall.ps1 similarity index 66% rename from WindowsAIOInstall.ps1 rename to WindowsAgentAIOInstall.ps1 index f89fea5..14f0a80 100644 --- a/WindowsAIOInstall.ps1 +++ b/WindowsAgentAIOInstall.ps1 @@ -17,6 +17,22 @@ cd rustdesk start .\rustdesk-1.1.9-putes.exe --silent-install } +# Set URL Handler +New-Item -Path "HKLM:\SOFTWARE\Classes\RustDesk" +Set-ItemProperty -Path "HKLM:\SOFTWARE\Classes\RustDesk" -Name "(Default)" -Value "URL:RustDesk Protocol" +New-ItemProperty -Path "HKLM:\SOFTWARE\Classes\RustDesk" -Name "URL Protocol" -Type STRING +New-Item -Path "HKLM:\SOFTWARE\Classes\RustDesk\DefaultIcon" +Set-ItemProperty -Path "HKLM:\SOFTWARE\Classes\RustDesk\DefaultIcon" -Name "(Default)" -Value "RustDesk.exe,0" +New-Item -Path "HKLM:\SOFTWARE\Classes\RustDesk\shell" +New-Item -Path "HKLM:\SOFTWARE\Classes\RustDesk\shell\open" +New-Item -Path "HKLM:\SOFTWARE\Classes\RustDesk\shell\open\command" +Set-ItemProperty -Path "HKLM:\SOFTWARE\Classes\RustDesk\shell\open\command" -Name "(Default)" -Value '"\"C:\\Program Files\\RustDesk\\urlhandler.exe\" \"%1\""' +New-Item "C:\Program Files\RustDesk\urlhandler.ps1" +Set-Content "C:\Program Files\RustDesk\urlhandler.ps1" "`$url_handler = `$args[0`n`$rustdesk_id = `$url_handler -creplace '(?s)^.*\:',''`nStart-Process -NoNewWindow -FilePath 'C:\Program Files\RustDesk\rustdesk.exe' -ArgumentList '--connect `$rustdesk_id'" +Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force +Install-Module ps2exe -Force +Invoke-ps2exe "C:\Program Files\RustDesk\urlhandler.ps1" "C:\Program Files\RustDesk\urlhandler.exe" +Remove-Item "C:\Program Files\RustDesk\urlhandler.ps1" # Write config If (!("C:\Windows\ServiceProfiles\LocalService\AppData\Roaming\RustDesk\config\RustDesk.toml")) {