Compare commits
No commits in common. "4ef9247c04c0475b42e6c4436707b317d73f7374" and "10bc771e8e21f4df3e817ed51aa527b9c9de4ce8" have entirely different histories.
4ef9247c04
...
10bc771e8e
|
|
@ -19,11 +19,6 @@ if (-Not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdenti
|
|||
}
|
||||
}
|
||||
|
||||
# Проверка наличия rustdesk.exe в текущей папке
|
||||
$localRustDesk = Join-Path $PSScriptRoot "rustdesk.exe"
|
||||
$rustdeskExistsLocally = Test-Path $localRustDesk
|
||||
|
||||
if (-not $rustdeskExistsLocally) {
|
||||
# Checks for the latest version of RustDesk
|
||||
$url = 'https://www.github.com//rustdesk/rustdesk/releases/latest'
|
||||
$request = [System.Net.WebRequest]::Create($url)
|
||||
|
|
@ -31,15 +26,12 @@ if (-not $rustdeskExistsLocally) {
|
|||
$realTagUrl = $response.ResponseUri.OriginalString
|
||||
$RDLATEST = $realTagUrl.split('/')[-1].Trim('v')
|
||||
echo "RustDesk $RDLATEST is the latest version."
|
||||
} else {
|
||||
$RDLATEST = "local" # Устанавливаем фиктивную версию для локального файла
|
||||
}
|
||||
|
||||
# Checks the version of RustDesk installed.
|
||||
$rdver = ((Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\RustDesk\" -ErrorAction SilentlyContinue).Version)
|
||||
$rdver = ((Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\RustDesk\").Version)
|
||||
|
||||
# Skips to inputting the configuration if the latest version of RustDesk is already installed.
|
||||
if ($rdver -eq $RDLATEST -and -not $rustdeskExistsLocally) {
|
||||
if ($rdver -eq "$RDLATEST") {
|
||||
echo "RustDesk $rdver is already installed."
|
||||
cd $env:ProgramFiles\RustDesk
|
||||
echo "Inputting configuration now."
|
||||
|
|
@ -102,16 +94,9 @@ if (!(Test-Path C:\ProgramData\RustDesk)) {
|
|||
}
|
||||
|
||||
cd C:\ProgramData\RustDesk
|
||||
|
||||
if ($rustdeskExistsLocally) {
|
||||
echo "Found local rustdesk.exe, using it for installation."
|
||||
Copy-Item -Path $localRustDesk -Destination ".\rustdesk.exe" -Force
|
||||
} else {
|
||||
echo "Downloading RustDesk version $RDLATEST."
|
||||
powershell Invoke-WebRequest "https://github.com/rustdesk/rustdesk/releases/download/$RDLATEST/rustdesk-$RDLATEST-x86_64.exe" -Outfile "rustdesk.exe"
|
||||
}
|
||||
|
||||
echo "Installing RustDesk."
|
||||
echo "Installing RustDesk version $RDLATEST."
|
||||
Start-Process .\rustdesk.exe --silent-install
|
||||
Start-Sleep -Seconds 10
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue