When using MultiUser.nsh, it always uses $PROGRAMFILES.
When a x64 application should be installed, this should be $PROGRAMFILES64.
Please add an option like
MULTI_USER_USE_PROGRAMMFILES64
to support this behaviour.
Otherwise MultiUser.nsh is useless for x64 program installs.
(using x64.nsh redirection and SetRegView 64 do not do the job)
The following patch adds the feature using a MULTIUSER_USE_PROGRAMFILES64 define which the 64 bit installer needs to set before including MultiUser.nsh:
--- C:/Programme/NSIS/Include/MultiUser.nsh So Feb 1 15:44:30 2009
+++ C:/Programme/NSIS/Include/Kopie von MultiUser.nsh Do Apr 30 15:34:13 2009
@@ -91,7 +91,11 @@
!if "${UNINSTALLER_PREFIX}" != UN
;Set default installation location for installer
!ifdef MULTIUSER_INSTALLMODE_INSTDIR
- StrCpy $INSTDIR "$PROGRAMFILES\${MULTIUSER_INSTALLMODE_INSTDIR}"
+ !ifdef --- C:/Programme/NSIS/Include/MultiUser.nsh So Feb 1 15:44:30 2009
+++ C:/Programme/NSIS/Include/Kopie von MultiUser.nsh Do Apr 30 15:34:13 2009
@@ -91,7 +91,11 @@
!if "${UNINSTALLER_PREFIX}" != UN
;Set default installation location for installer
!ifdef MULTIUSER_INSTALLMODE_INSTDIR
- StrCpy $INSTDIR "$PROGRAMFILES\${MULTIUSER_INSTALLMODE_INSTDIR}"
+ !ifdef MULTIUSER_USE_PROGRAMFILES64
+ StrCpy $INSTDIR "$PROGRAMFILES64\${MULTIUSER_INSTALLMODE_INSTDIR}"
+ !else
+ StrCpy $INSTDIR "$PROGRAMFILES\${MULTIUSER_INSTALLMODE_INSTDIR}"
+ !endif
!endif
!endif
@@ -129,7 +133,11 @@
${if} ${AtLeastWin2000}
StrCpy $INSTDIR "$LOCALAPPDATA\${MULTIUSER_INSTALLMODE_INSTDIR}"
${else}
+ !ifdef MULTIUSER_USE_PROGRAMFILES64
+ StrCpy $INSTDIR "$PROGRAMFILES64\${MULTIUSER_INSTALLMODE_INSTDIR}"
+ !else
StrCpy $INSTDIR "$PROGRAMFILES\${MULTIUSER_INSTALLMODE_INSTDIR}"
+ !endif
${endif}
!endif
!endif
+ StrCpy $INSTDIR "$PROGRAMFILES64\${MULTIUSER_INSTALLMODE_INSTDIR}"
+ !else
+ StrCpy $INSTDIR "$PROGRAMFILES\${MULTIUSER_INSTALLMODE_INSTDIR}"
+ !endif
!endif
!endif
@@ -129,7 +133,11 @@
${if} ${AtLeastWin2000}
StrCpy $INSTDIR "$LOCALAPPDATA\${MULTIUSER_INSTALLMODE_INSTDIR}"
${else}
+ !ifdef MULTIUSER_USE_PROGRAMFILES64
+ StrCpy $INSTDIR "$PROGRAMFILES64\${MULTIUSER_INSTALLMODE_INSTDIR}"
+ !else
StrCpy $INSTDIR "$PROGRAMFILES\${MULTIUSER_INSTALLMODE_INSTDIR}"
+ !endif
${endif}
!endif
!endif
Sorry, the patch got crumbled, here goes the patch again:
--- C:/Programme/NSIS/Include/MultiUser.nsh So Feb 1 15:44:30 2009
+++ C:/Programme/NSIS/Include/Kopie von MultiUser.nsh Do Apr 30 15:34:13 2009
@@ -91,7 +91,11 @@
!if "${UNINSTALLER_PREFIX}" != UN
;Set default installation location for installer
!ifdef MULTIUSER_INSTALLMODE_INSTDIR
- StrCpy $INSTDIR "$PROGRAMFILES\${MULTIUSER_INSTALLMODE_INSTDIR}"
+ !ifdef MULTIUSER_USE_PROGRAMFILES64
+ StrCpy $INSTDIR "$PROGRAMFILES64\${MULTIUSER_INSTALLMODE_INSTDIR}"
+ !else
+ StrCpy $INSTDIR "$PROGRAMFILES\${MULTIUSER_INSTALLMODE_INSTDIR}"
+ !endif
!endif
!endif
@@ -129,7 +133,11 @@
${if} ${AtLeastWin2000}
StrCpy $INSTDIR "$LOCALAPPDATA\${MULTIUSER_INSTALLMODE_INSTDIR}"
${else}
+ !ifdef MULTIUSER_USE_PROGRAMFILES64
+ StrCpy $INSTDIR "$PROGRAMFILES64\${MULTIUSER_INSTALLMODE_INSTDIR}"
+ !else
StrCpy $INSTDIR "$PROGRAMFILES\${MULTIUSER_INSTALLMODE_INSTDIR}"
+ !endif
${endif}
!endif
!endif
It would be nice if this patch could be included in the official release.
While this patch is very useful, it should be extended to do the same for COMMONFILES64 and any other 64-bit-specific items.
Will there ever be another NSIS release??
Instead of patching MultiUser.nsh I use quite a bruteforce method to support $PROGRAMFILES64. I replace $PROGRAMFILES with $PROGRAMFILES64 in $INSTDIR with the StrRep function that can be found here: http://nsis.sourceforge.net/Another_String_Replace_%28and_Slash/BackSlash_Converter%29
${StrReplace} $INSTDIR $PROGRAMFILES $PROGRAMFILES64
StrCpy $INSTDIR $0
Can a maintainer comment on why the patch provided for this very old bug has not been included in the official releases? The problem seems to be still there and it is very annoying.
This ticket was assigned to the person that wrote MultiUser and it just dropped off the map for everyone else. I'll see what I can do about it...