ask user to create a desktop shortcut
This commit is contained in:
parent
067ca081b7
commit
5f8eaf36fb
1 changed files with 14 additions and 0 deletions
14
install.ps1
14
install.ps1
|
@ -22,3 +22,17 @@ $Shortcut.Save()
|
|||
# Add new app to registry
|
||||
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"
|
||||
|
||||
# Ask user to add a shortcut to the desktop
|
||||
if ($Host.UI.PromptForChoice(
|
||||
"***********************",
|
||||
"Add a desktop shortcut?",
|
||||
@(
|
||||
[System.Management.Automation.Host.ChoiceDescription]::new("&Yes", "Add a shortcut to your desktop.")
|
||||
[System.Management.Automation.Host.ChoiceDescription]::new("&No", "Skip the shortcut creation.")
|
||||
), 1) -eq 0) {
|
||||
$WshShell = New-Object -comObject WScript.Shell
|
||||
$Shortcut = $WshShell.CreateShortcut("$env:HOMEPATH\Desktop\DSR.lnk")
|
||||
$Shortcut.TargetPath = "$env:LOCALAPPDATA\DSR\dsr.exe"
|
||||
$Shortcut.Save()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue