Fix x64 installer install in "C:\Program Files (x86)" regression

This commit is contained in:
Don Ho 2016-11-14 01:11:53 +01:00
parent 5af1c055d1
commit e6fad9bd4f
2 changed files with 11 additions and 5 deletions

View File

@ -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

View File

@ -43,10 +43,6 @@
; Main Install settings
Name "${APPNAMEANDVERSION}"
!ifdef ARCH64
InstallDir "$PROGRAMFILES64\${APPNAME}"
!else
InstallDir "$PROGRAMFILES\${APPNAME}"
!endif
InstallDirRegKey HKLM "Software\${APPNAME}" ""