From 9cd9a269944d8ad4f1298243967a01e2d725d535 Mon Sep 17 00:00:00 2001 From: DonLakeFlyer Date: Fri, 27 Dec 2019 11:08:20 -0800 Subject: [PATCH] 64 bit installer changes --- deploy/qgroundcontrol_installer.nsi | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/deploy/qgroundcontrol_installer.nsi b/deploy/qgroundcontrol_installer.nsi index 67e3479ea..3010f206f 100644 --- a/deploy/qgroundcontrol_installer.nsi +++ b/deploy/qgroundcontrol_installer.nsi @@ -40,7 +40,7 @@ Name "${APPNAME}" Var StartMenuFolder -InstallDir "$PROGRAMFILES\${APPNAME}" +InstallDir "$PROGRAMFILES64\${APPNAME}" SetCompressor /SOLID /FINAL lzma @@ -59,18 +59,28 @@ SetCompressor /SOLID /FINAL lzma !insertmacro MUI_LANGUAGE "English" Section + DetailPrint "Checking for 32 bit uninstaller" + SetRegView 32 ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "UninstallString" - StrCmp $R0 "" doinstall + StrCmp $R0 "" check64BitUninstall doUninstall +check64BitUninstall: + DetailPrint "Checking for 64 bit uninstaller" + SetRegView 64 + ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "UninstallString" + StrCmp $R0 "" doInstall + +doUninstall: DetailPrint "Uninstalling previous version..." - ExecWait "$R0 /S _?=$INSTDIR -LEAVE_DATA=1" - IntCmp $0 0 doinstall + ExecWait "$R0 /S -LEAVE_DATA=1" + IntCmp $0 0 doInstall MessageBox MB_OK|MB_ICONEXCLAMATION \ "Could not remove a previously installed ${APPNAME} version.$\n$\nPlease remove it before continuing." Abort -doinstall: +doInstall: + SetRegView 64 SetOutPath $INSTDIR File /r /x ${EXENAME}.pdb /x ${EXENAME}.lib /x ${EXENAME}.exp ${DESTDIR}\*.* @@ -81,7 +91,6 @@ doinstall: WriteUninstaller $INSTDIR\${EXENAME}-Uninstall.exe WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayName" "${APPNAME}" WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "UninstallString" "$\"$INSTDIR\${EXENAME}-Uninstall.exe$\"" - SetRegView 64 WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\${EXENAME}.exe" "DumpCount" 5 WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\${EXENAME}.exe" "DumpType" 1 WriteRegExpandStr HKLM "SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\${EXENAME}.exe" "DumpFolder" "%LOCALAPPDATA%\QGCCrashDumps" @@ -99,7 +108,6 @@ doinstall: driversInstalled: DetailPrint "UAV Drivers already installed. Checking version..." - ; Check if the installed drivers are out of date. ; Latest version is tagged as 1. Missing key also indicates out of date driver install. ReadRegDWORD $0 HKCU "${QGCDRIVERVERSIONKEY}" "version" @@ -126,6 +134,7 @@ done: SectionEnd Section "Uninstall" + SetRegView 64 ${GetParameters} $R0 ${GetOptions} $R0 "-LEAVE_DATA=" $R1 !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder @@ -142,6 +151,7 @@ Section "Uninstall" SectionEnd Section "create Start Menu Shortcuts" + SetRegView 64 SetShellVarContext all CreateDirectory "$SMPROGRAMS\$StartMenuFolder" CreateShortCut "$SMPROGRAMS\$StartMenuFolder\${APPNAME}.lnk" "$INSTDIR\${EXENAME}.exe" "" "$INSTDIR\${EXENAME}.exe" 0 -- 2.22.0