Skip to content

Commit

Permalink
Added debugging, silent uninstall
Browse files Browse the repository at this point in the history
  • Loading branch information
myleshorton committed May 11, 2015
1 parent 2de255b commit b993bae
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions installer-resources/windows/lantern.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,25 @@ InstallDir $APPDATA\Lantern
# Request user permissions so that auto-updates will work with no prompt
RequestExecutionLevel user

# Uninstall previous versions before install new one
# Uninstall previous versions before installing the new one
Function .onInit
DetailPrint "Uninstalling previous version"
ReadRegStr $R0 HKCU \
"Software\Microsoft\Windows\CurrentVersion\Uninstall\Lantern" \
"UninstallString"
StrCmp $R0 "" noprevious

ReadRegStr $R0 HKCU \
"Software\Microsoft\Windows\CurrentVersion\Uninstall\Lantern" \
"UninstallString"
StrCmp $R0 "" done

ClearErrors
ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
DetailPrint "Uninstalling $R0"
ClearErrors
ExecWait '$R0 /S _?=$INSTDIR' ;Do not copy the uninstaller to a temp file

IfErrors erroruninstalling done
noprevious:
DetailPrint "No previous version to uninstall"
erroruninstalling:
DetailPrint "Error uninstalling previous at $R0"
done:

DetailPrint "Successfully uninstalled $R0"
FunctionEnd

# start default section
Expand Down

0 comments on commit b993bae

Please sign in to comment.