Old 11th June 2015, 15:37   #1
stass
Senior Member
 
Join Date: Nov 2012
Posts: 145
The path to 32-bit applications on 64-bit OS

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) ?
stass is offline   Reply With Quote
Old 12th June 2015, 06:56   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
$PROGRAMFILES is Program Files (x86) on 64-bit. You also have $PROGRAMFILES32 and $PROGRAMFILES64. Check the manual.

Stu
Afrow UK is offline   Reply With Quote
Old 12th June 2015, 09:04   #3
stass
Senior Member
 
Join Date: Nov 2012
Posts: 145
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:

PHP 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 
/"Install 64-bit version" x64
MessageBox MB_OK 
"64-bit - $INSTDIR"
SectionEnd

Function .onInit

${If} ${RunningX64}
;!
insertmacro SelectSection ${x64}
StrCpy $${x64}
StrCpy "$INSTDIR" "$PROGRAMFILES64\MyApp"

${Else} # x32
;!insertmacro SelectSection ${x32}
StrCpy $${x32}

SectionSetFlags ${x3217  
SectionSetFlags 
${x6416 
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 
stass is offline   Reply With Quote
Old 12th June 2015, 12:57   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,153
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...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 13th June 2015, 06:33   #5
stass
Senior Member
 
Join Date: Nov 2012
Posts: 145
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 ...
stass is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump