diff --git a/PowerEditor/installer/nppSetup.nsi b/PowerEditor/installer/nppSetup.nsi index 854ccae69..81902d875 100644 --- a/PowerEditor/installer/nppSetup.nsi +++ b/PowerEditor/installer/nppSetup.nsi @@ -37,7 +37,7 @@ SetCompressor /SOLID lzma ; This reduces installer size by approx 30~35% !include "nsisInclude\winVer.nsh" -!include "nsisInclude\gobalDef.nsh" +!include "nsisInclude\globalDef.nsh" !include "nsisInclude\tools.nsh" !include "nsisInclude\uninstall.nsh" @@ -98,6 +98,16 @@ Function .onInit ; disable registry redirection (enable access to 64-bit portion of registry) SetRegView 64 + ; change to x64 install dir if needed + ${If} "$InstDir" != "" + ${If} "$InstDir" == "$PROGRAMFILES\${APPNAME}" + StrCpy $INSTDIR "$PROGRAMFILES64\${APPNAME}" + ${EndIf} + ; else /D was used or last installation is not "$PROGRAMFILES\${APPNAME}" + ${Else} + StrCpy $INSTDIR "$PROGRAMFILES64\${APPNAME}" + ${EndIf} + ; check if 32-bit version has been installed if yes, ask user to remove it IfFileExists $PROGRAMFILES\${APPNAME}\notepad++.exe 0 noDelete32 MessageBox MB_YESNO "You're installing 64-bit version. 32-bit version has been installed. Remove it?$\n(Your custom config files will be kept)" /SD IDYES IDYES doDelete32 IDNO noDelete32 ;IDYES remove diff --git a/PowerEditor/installer/nsisInclude/gobalDef.nsh b/PowerEditor/installer/nsisInclude/globalDef.nsh similarity index 96% rename from PowerEditor/installer/nsisInclude/gobalDef.nsh rename to PowerEditor/installer/nsisInclude/globalDef.nsh index e359d2e5d..35d7410a1 100644 --- a/PowerEditor/installer/nsisInclude/gobalDef.nsh +++ b/PowerEditor/installer/nsisInclude/globalDef.nsh @@ -43,10 +43,6 @@ ; Main Install settings Name "${APPNAMEANDVERSION}" -!ifdef ARCH64 -InstallDir "$PROGRAMFILES64\${APPNAME}" -!else InstallDir "$PROGRAMFILES\${APPNAME}" -!endif InstallDirRegKey HKLM "Software\${APPNAME}" ""