On the page there are three MUI_PAGE_COMPONENTS checkbox to select the three installation options:
32 bit application - in Windows x32
64 bit application - in Windows x64
32 bit application - in Windows x64
How can I, when you select 32-bit applications in Windows x64, receive InstallDir "$ PROGRAMFILES \ MyApp (Program Files (x86) \ MyApp - page MUI_PAGE_DIRECTORY) ?
The path to 32-bit applications on 64-bit OS
5 posts
$PROGRAMFILES is Program Files (x86) on 64-bit. You also have $PROGRAMFILES32 and $PROGRAMFILES64. Check the manual.
Stu
Stu
Afrow UK
We need two versions of the installation in Windows X64... But ...
The way to a 64-bit OS to 32-bit applications - not true !
Or vice versa: The path to 64-bit OS to 64-bit applications - not true !
My code:
We need two versions of the installation in Windows X64... But ...
The way to a 64-bit OS to 32-bit applications - not true !
Or vice versa: The path to 64-bit OS to 64-bit applications - not true !
My code:
!include "MUI2.nsh"
!include "Sections.nsh"
!include "x64.nsh"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
;InstallDir "$PROGRAMFILES\MyApp"
OutFile "SelectSection-test.exe"
Section "Install 32-bit version" x32
MessageBox MB_OK "32-bit - $INSTDIR"
SectionEnd
Section /o "Install 64-bit version" x64
MessageBox MB_OK "64-bit - $INSTDIR"
SectionEnd
Function .onInit
${If} ${RunningX64}
;!insertmacro SelectSection ${x64}
StrCpy $1 ${x64}
StrCpy "$INSTDIR" "$PROGRAMFILES64\MyApp"
${Else} # x32
;!insertmacro SelectSection ${x32}
StrCpy $1 ${x32}
SectionSetFlags ${x32} 17
SectionSetFlags ${x64} 16
SectionSetText ${x64} ""
StrCpy "$INSTDIR" "$PROGRAMFILES\MyApp"
${EndIf}
# It - is not working in .onInit !
SectionGetFlags ${x32} $R0
IntOp $R0 $R0 & ${SF_SELECTED}
${If} $R0 == 1
StrCpy "$INSTDIR" "$PROGRAMFILES\MyApp"
${EndIf}
FunctionEnd
Function .onSelChange
!insertmacro StartRadioButtons $1
!insertmacro RadioButton ${x32}
!insertmacro RadioButton ${x64}
!insertmacro EndRadioButtons
FunctionEnd I don't see what the problem is, just remove the pointless thing at the end of .onInit. You are also doing the if test wrong, it should be ${SF_SELECTED} = $R0 but you are lucky and getting away with it here...
Again ...
1. In a 64-bit operating system runs the installer (in installer included: and 32, and 64 bit application)
2. The user selects (page PAGE_COMPONENTS) - install the 32 bit application in the 64bit OS ($ INSTDIR: $ PROGRAMFILES) or
to install a 64-bit application in a 64-bit OS (($ INSTDIR: $ PROGRAMFILES64)
3. How do I get on the page PAGE_DIREKTORY the right way ? (depending on the choice of the checkbox) ?
Give an example please ...
1. In a 64-bit operating system runs the installer (in installer included: and 32, and 64 bit application)
2. The user selects (page PAGE_COMPONENTS) - install the 32 bit application in the 64bit OS ($ INSTDIR: $ PROGRAMFILES) or
to install a 64-bit application in a 64-bit OS (($ INSTDIR: $ PROGRAMFILES64)
3. How do I get on the page PAGE_DIREKTORY the right way ? (depending on the choice of the checkbox) ?
Give an example please ...