Archive: Felfert Callbacks and InstallOptions


Felfert Callbacks and InstallOptions
I'm trying to create an installer for a folio of my work but have run into some problems. When run I want the installer to prompt the user whether they wish to install the folio application onto their computer or run an HTML version from CD. I tried using InstallOptions with .onInit however instead of running inside the NSIS window it draws itself to the whole screen (which, I guess is understandable since the NSIS window hasn't been created yet - or something ;).

AFAIK there's no other way in which to implement this in the current NSIS version unless additional callbacks where implemented similar to felfert's .onDlgPage.

Except that .noDlgPage only works when switching between pages of the installer and not on the initial page??

You now can declare a Function named .onDlgPage which gets called whenever the user switches to the next (or previous) page of the installer.

Read the original description of .onDlgPage again. It does get called before displaying the first dialog page. In that case, the "previous" page number is -1.

-Fritz


Since you're putting this on a CD, you could make two NSIS installers:

The first one would do the question, and run the HTML from the CD, and it could run the second one if it's to be installed.

Installer One:

OutFile NSIS1.EXE

Section

HideWindow ; or whatever it's called
SetOutPath $TEMP
File InstallOptions.exe
File InstallOptions.ini

ShowWindow
ExecWait '$TEMP\InstallOptions $TEMP\InstallOptions'
ReadINIStr $0 $TEMP\InstallOptions.ini 'Field 2' Text

StrCmp $0 'Launch from CD' CD

Exec NSIS2.EXE
GoTo Done

CD:

Exec $PROGRAMFILES\IE\IE.EXE D:\HTML.HTM

Done:

SectionEnd

Re: Two installers
I had thought of doing it that way but was wanting to keep it all in the one installer. Unless I can get felfert's patch to work it looks like the double installers will be the way I end up doing it.