Skip to content

Commit

Permalink
Hmm
Browse files Browse the repository at this point in the history
  • Loading branch information
e3ndr committed Dec 22, 2024
1 parent a571695 commit ce68139
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions Installer.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,17 @@ RequestExecutionLevel admin
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_INSTFILES

Var deleteUserData ; You could just store the HWND in $1 etc if you don't want this extra variable
; Var deleteUserData ; You could just store the HWND in $1 etc if you don't want this extra variable

;--------------------------------
; Section - Installer

Function .onInit
; Check to see if already installed (old installer).
ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANY} ${NAME}" "UninstallString"
IfFileExists $R0 0 no_delete_previous
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANY} ${NAME}" ; Forcibly remove the old version.
Section "Remove Previous Version (Keep data)"
SectionIn RO

RMDir /r "$INSTDIR"
MessageBox MB_ICONEXCLAMATION|MB_OK "Removed previous version."
no_delete_previous:
FunctionEnd
SectionEnd

Section "App"
SectionIn RO
Expand Down

0 comments on commit ce68139

Please sign in to comment.