Update WindowsAgentAIOInstall.ps1

This commit is contained in:
dinger1986 2022-08-04 23:56:17 +01:00 committed by GitHub
parent c9de0f5a2c
commit 526b0c24c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,12 +26,12 @@ Set-ItemProperty -Path "HKLM:\SOFTWARE\Classes\RustDesk\DefaultIcon" -Name "(Def
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\""'
Set-ItemProperty -Path "HKLM:\SOFTWARE\Classes\RustDesk\shell\open\command" -Name "(Default)" -Value '"C:\Program Files\RustDesk\RustDeskURLLauncher.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'"
Set-Content "C:\Program Files\RustDesk\urlhandler.ps1" "`$url_handler = `$args[0]`n`$rustdesk_id = `$url_handler -creplace '(?s)^.*\:',''`nStart-Process -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"
Invoke-ps2exe "C:\Program Files\RustDesk\urlhandler.ps1" "C:\Program Files\RustDesk\RustDeskURLLauncher.exe"
Remove-Item "C:\Program Files\RustDesk\urlhandler.ps1"
# Write config