less work when update

This commit is contained in:
Mylloon 2024-05-17 19:36:08 +02:00
parent 4275cb5528
commit ca9fe8ed36
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -17,6 +17,8 @@ Expand-Archive -Path $archive -DestinationPath "$env:LOCALAPPDATA\DSR" -Force
Move-Item -Path "$env:LOCALAPPDATA\DSR\dsr-win32-x64\*" -Destination "$env:LOCALAPPDATA\DSR" -Force Move-Item -Path "$env:LOCALAPPDATA\DSR\dsr-win32-x64\*" -Destination "$env:LOCALAPPDATA\DSR" -Force
Remove-Item "$env:LOCALAPPDATA\DSR\dsr-win32-x64" Remove-Item "$env:LOCALAPPDATA\DSR\dsr-win32-x64"
# Ask user to add a shortcut to the desktop
if (-not $update) {
# Add shortcut # Add shortcut
$WshShell = New-Object -comObject WScript.Shell $WshShell = New-Object -comObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut("$env:APPDATA\Microsoft\Windows\Start Menu\Programs\DSR.lnk") $Shortcut = $WshShell.CreateShortcut("$env:APPDATA\Microsoft\Windows\Start Menu\Programs\DSR.lnk")
@ -27,8 +29,6 @@ $Shortcut.Save()
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\dsr" /f /v DisplayName /t REG_SZ /d "DSR" REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\dsr" /f /v DisplayName /t REG_SZ /d "DSR"
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\dsr" /f /v InstallLocation /t REG_SZ /d "$env:LOCALAPPDATA\DSR" REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\dsr" /f /v InstallLocation /t REG_SZ /d "$env:LOCALAPPDATA\DSR"
# Ask user to add a shortcut to the desktop
if (-not $update) {
if ($Host.UI.PromptForChoice( if ($Host.UI.PromptForChoice(
"***********************", "***********************",
"Add a desktop shortcut?", "Add a desktop shortcut?",