diff --git a/app/build.sh b/app/build.sh index 2b41c114fa..ab6f2a16af 100755 --- a/app/build.sh +++ b/app/build.sh @@ -764,8 +764,10 @@ if [ $BUILD_WIN == 1 ]; then # Build uninstaller if [ "$arch" = "win32" ]; then "`cygpath -u \"${NSIS_DIR}makensis.exe\"`" /V1 "`cygpath -w \"$BUILD_DIR/win_installer/uninstaller.nsi\"`" - elif [[ "$arch" = "win-x64" ]] || [[ "$arch" = "win-arm64" ]]; then + elif [ "$arch" = "win-x64" ]; then "`cygpath -u \"${NSIS_DIR}makensis.exe\"`" /DHAVE_64BIT_BUILD /V1 "`cygpath -w \"$BUILD_DIR/win_installer/uninstaller.nsi\"`" + elif [ "$arch" = "win-arm64" ]; then + "`cygpath -u \"${NSIS_DIR}makensis.exe\"`" /DHAVE_64BIT_BUILD /D_ARM64_ /V1 "`cygpath -w \"$BUILD_DIR/win_installer/uninstaller.nsi\"`" fi mv "$BUILD_DIR/win_installer/helper.exe" "$APPDIR/uninstall" @@ -798,8 +800,10 @@ if [ $BUILD_WIN == 1 ]; then # Build and sign setup.exe if [ "$arch" = "win32" ]; then "`cygpath -u \"${NSIS_DIR}makensis.exe\"`" /V1 "`cygpath -w \"$BUILD_DIR/win_installer/installer.nsi\"`" - elif [[ "$arch" = "win-x64" ]] || [[ "$arch" = "win-arm64" ]]; then + elif [ "$arch" = "win-x64" ]; then "`cygpath -u \"${NSIS_DIR}makensis.exe\"`" /DHAVE_64BIT_BUILD /V1 "`cygpath -w \"$BUILD_DIR/win_installer/installer.nsi\"`" + elif [ "$arch" = "win-arm64" ]; then + "`cygpath -u \"${NSIS_DIR}makensis.exe\"`" /DHAVE_64BIT_BUILD /D_ARM64_ /V1 "`cygpath -w \"$BUILD_DIR/win_installer/installer.nsi\"`" fi mv "$BUILD_DIR/win_installer/setup.exe" "$INSTALLER_STAGE_DIR" diff --git a/app/win/installer/common.nsh b/app/win/installer/common.nsh index 3df4e699e6..43396001f2 100755 --- a/app/win/installer/common.nsh +++ b/app/win/installer/common.nsh @@ -1280,6 +1280,7 @@ Var Trash ; (not on Windows XP http://support.microsoft.com/kb/282747) so just use it ; when installing on an x64 systems even when installing an x86 application. ${If} ${RunningX64} + ${OrIf} ${IsNativeARM64} ${DisableX64FSRedirection} ExecWait '"$SYSDIR\regsvr32.exe" /s "${DLL}"' ${EnableX64FSRedirection} @@ -1295,6 +1296,7 @@ Var Trash ; (not on Windows XP http://support.microsoft.com/kb/282747) so just use it ; when installing on an x64 systems even when installing an x86 application. ${If} ${RunningX64} + ${OrIf} ${IsNativeARM64} ${DisableX64FSRedirection} ExecWait '"$SYSDIR\regsvr32.exe" /s /u "${DLL}"' ${EnableX64FSRedirection} @@ -2114,6 +2116,7 @@ FunctionEnd StrCpy $R6 0 ; set the counter for the outer loop to 0 ${If} ${RunningX64} + ${OrIf} ${IsNativeARM64} StrCpy $R0 "false" ; Set the registry to the 32 bit registry for 64 bit installations or to ; the 64 bit registry for 32 bit installations at the beginning so it can @@ -2185,6 +2188,7 @@ FunctionEnd end: ${If} ${RunningX64} + ${OrIf} ${IsNativeARM64} ${AndIf} "$R0" == "false" ; Set the registry to the correct view. !ifdef HAVE_64BIT_BUILD @@ -4152,6 +4156,7 @@ FunctionEnd !ifdef HAVE_64BIT_BUILD ${Unless} ${RunningX64} + ${OrUnless} ${IsNativeARM64} ${OrUnless} ${AtLeastWin7} MessageBox MB_OK|MB_ICONSTOP "$R9" IDOK ; Nothing initialized so no need to call OnEndCommon @@ -4768,11 +4773,7 @@ FunctionEnd ${LogMsg} "OS Name : Unable to detect" ${EndIf} - !ifdef HAVE_64BIT_BUILD - ${LogMsg} "Target CPU : x64" - !else - ${LogMsg} "Target CPU : x86" - !endif + ${LogMsg} "Target CPU : ${ARCH}" Pop $9 Pop $R0 diff --git a/app/win/installer/defines.nsi b/app/win/installer/defines.nsi index d04d448d14..69ac9cc508 100644 --- a/app/win/installer/defines.nsi +++ b/app/win/installer/defines.nsi @@ -43,11 +43,16 @@ # ARCH is used when it is necessary to differentiate the x64 registry keys from # the x86 registry keys (e.g. the uninstall registry key). !ifdef HAVE_64BIT_BUILD - !define ARCH "x86" - !define MinSupportedVer "64-bit Microsoft Windows 7" -!else + !ifdef _ARM64_ + !define ARCH "AArch64" + !define MinSupportedVer "Microsoft Windows 10 for ARM" + !else !define ARCH "x64" - !define MinSupportedVer "Microsoft Windows 7" + !define MinSupportedVer "64-bit Microsoft Windows 7" + !endif +!else + !define ARCH "x86" + !define MinSupportedVer "Microsoft Windows 7" !endif # File details shared by both the installer and uninstaller diff --git a/app/win/installer/installer.nsi b/app/win/installer/installer.nsi index d416c6c2a5..01f23c13a1 100755 --- a/app/win/installer/installer.nsi +++ b/app/win/installer/installer.nsi @@ -924,6 +924,20 @@ Function .onInit ${InstallOnInitCommon} "$(WARN_MIN_SUPPORTED_OS_MSG)" + !ifdef HAVE_64BIT_BUILD + ${If} "${ARCH}" == "AArch64" + ${IfNot} ${IsNativeARM64} + MessageBox MB_OK|MB_ICONSTOP "$(WARN_MIN_SUPPORTED_OS_MSG)" IDOK + ; Nothing initialized so no need to call OnEndCommon + Quit + ${EndIf} + ${ElseIfNot} ${RunningX64} + MessageBox MB_OK|MB_ICONSTOP "$(WARN_MIN_SUPPORTED_OS_MSG)" IDOK + ; Nothing initialized so no need to call OnEndCommon + Quit + ${EndIf} + !endif + StrCpy $R1 "Zotero Standalone" StrCpy $R2 "An older version of Zotero is installed. If you continue, the existing version will be removed.$\n$\nYour Zotero data will not be affected." Call UninstallOld