diff --git a/deploy/qgroundcontrol_installer.nsi b/deploy/qgroundcontrol_installer.nsi index f04e6ede708a59b60f6f104c074c1f927b3d3afc..7bc1fee835b64354b63f8be061228e59ebe1ec53 100644 --- a/deploy/qgroundcontrol_installer.nsi +++ b/deploy/qgroundcontrol_installer.nsi @@ -33,4 +33,14 @@ Section "create Start Menu Shortcuts" SetShellVarContext all CreateDirectory "$SMPROGRAMS\QGroundControl" CreateShortCut "$SMPROGRAMS\QGroundControl\QGroundControl.lnk" "$INSTDIR\qgroundcontrol.exe" "" "$INSTDIR\qgroundcontrol.exe" 0 -SectionEnd \ No newline at end of file +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 \ No newline at end of file