Skip to content

Commit 6df38db

Browse files
author
Marian Dovgialo
committed
Added uninstalling previous version
1 parent 7c76419 commit 6df38db

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

installer_builder/build/svarog_exe/Svarog.nsi

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,35 @@ InstallDir "$PROGRAMFILES\Svarog"
7676

7777
######################################################################
7878

79+
Section -SecUninstallPrevious
80+
81+
Call UninstallPrevious
82+
83+
SectionEnd
84+
85+
86+
Function UninstallPrevious
87+
88+
; Check for uninstaller.
89+
ReadRegStr $R0 HKLM "${UNINSTALL_PATH}" "UninstallString"
90+
DetailPrint "Uninstaller path $R0"
91+
${If} $R0 == ""
92+
Goto Done
93+
${EndIf}
94+
95+
DetailPrint "Removing previous installation."
96+
97+
MessageBox MB_YESNO "Uninstall previous version?" IDYES true IDNO false
98+
true:
99+
ExecWait '"$R0" /S _?=$INSTDIR'
100+
Goto Done
101+
false:
102+
Abort
103+
; Run the uninstaller silently.
104+
Done:
105+
106+
FunctionEnd
107+
79108
Section -MainProgram
80109
${INSTALL_TYPE}
81110
SetOverwrite ifnewer

0 commit comments

Comments
 (0)