proper 64-bit and 32-bit handling?
I am trying to make an installer that handles 64-bit and 32-bit properly. This includes $PROGRAMFILES and $PROGRAMFILES64.
I had tried
!include "MUI2.nsh"
!include "logiclib.nsh"
!include "x64.nsh"
!include "shortcut.nsh" ;mine
;--------------------------------
;General
;Name and file
Name "Thunderbird Mail Split GUI"
OutFile "${PRODUCT_NAME}-${VERSION_STRING}-setup.exe"
;Default installation folder
; InstallDir "$LOCALAPPDATA\${PRODUCT_NAME}"
${If} ${RunningX64}
InstallDir "$PROGRAMFILES64\${PRODUCT_NAME}"
${Else}
InstallDir "$PROGRAMFILES\${PRODUCT_NAME}"
${EndIf}
;Get installation folder from registry if available
InstallDirRegKey HKCU "Software\${PRODUCT_NAME}" ""
;Request application privileges for Windows Vista
RequestExecutionLevel admin
!define MUI_ABORTWARNING
Function .onInit
#prevent multiple instances of the installer running
System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${PRODUCT_NAME}") i .r1 ?e'
Pop $R0
StrCmp $R0 0 +3
MessageBox MB_OK|MB_ICONEXCLAMATION "The installer is already running."
Abort
GetDlgItem $0 $HWNDPARENT 1
CreateFont $1 "$(^Font)" "14" "700"
;culprit. worked in older versions. what do I do now? got this from the forums.
; CreateFont $HEADLINE_FONT "$(^Font)" "14" "700"
InitPluginsDir
${If} ${RunningX64}
SetOutPath "$PROGRAMFILES64\${PRODUCT_NAME}"
${Else}
SetOutPath "$PROGRAMFILES\${PRODUCT_NAME}"
${EndIf}
SetShellVarContext all
FunctionEnd
but this doesn't work, bails at first ${If}.
at the very least, I need a solution to this problem of how to handle 32 and 64-bit executables properly.
I am also looking for a REAL usable installer template I can base my stuff off of. something with 64-bit and 32-bit support, don't really need multiple languages, though that would be useful, settable program version and program name, title via !define and process kill.