Commit 4a61d6bd authored by Nate Weibley's avatar Nate Weibley

Also automatically uninstall the previous version immediately before install. Fixes #2970

parent 980d76dd
...@@ -55,6 +55,17 @@ InstallDir $PROGRAMFILES\qgroundcontrol ...@@ -55,6 +55,17 @@ InstallDir $PROGRAMFILES\qgroundcontrol
!insertmacro MUI_LANGUAGE "English" !insertmacro MUI_LANGUAGE "English"
Section Section
ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\QGroundControl" "UninstallString"
StrCmp $R0 "" doinstall
ExecWait "$R0 /S"
IntCmp $0 0 doinstall
MessageBox MB_OK|MB_ICONEXCLAMATION \
"Could not remove a previously installed QGroundControl version.$\n$\nPlease remove it before continuing."
Abort
doinstall:
SetOutPath $INSTDIR SetOutPath $INSTDIR
File /r build_windows_install\release\*.* File /r build_windows_install\release\*.*
File deploy\px4driver.msi File deploy\px4driver.msi
...@@ -112,12 +123,3 @@ Section "create Start Menu Shortcuts" ...@@ -112,12 +123,3 @@ Section "create Start Menu Shortcuts"
!insertmacro DemoteShortCut "$SMPROGRAMS\$StartMenuFolder\QGroundControl (GPU Safe Mode).lnk" !insertmacro DemoteShortCut "$SMPROGRAMS\$StartMenuFolder\QGroundControl (GPU Safe Mode).lnk"
SectionEnd SectionEnd
Function .onInit
ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\QGroundControl" "UninstallString"
StrCmp $R0 "" done
MessageBox MB_OK|MB_ICONEXCLAMATION \
"QGroundControl is already installed. $\n$\nYou must uninstall the previous version before installing a new one."
Abort
done:
FunctionEnd
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment