0

Im trying to create an installer using NSIS, using "installer based on zip file".

I'd like to create a dialog box at the beginning of install that gives the user 2 choices (32, 64), then depending upon the choice they made, to change the path variable ($PROGRAMFILES32 or $PROGRAMFILES64)

Is this possible in NSIS? Are there any example scripts that could get me going?

Oliver Salzburg
  • 89,072
  • 65
  • 269
  • 311
Ke.
  • 343

1 Answers1

1

It's probably a bad idea to leave the choice to the user. I'd use the x64 headers to determine the default directory.

Include this in the header of your script.

!include LogicLib.nsh
!include x64.nsh

Then use this in the script, e.g. in the .onInit function:

${If} ${RunningX64}
    # 64 bit code
${Else}
    # 32 bit code
${EndIf}

Since you can't create a simple MessageBox with custom buttons, I'd suggest you create a dialog page with radio-buttons using nsDialogs. The If statement would then go to the leave function (see the control state example), querying the value of ${NSD_GetState}.

idleberg
  • 1,392