Archive: custom pages that only open conditionally


custom pages that only open conditionally
this is my first try with NSIS and i have a little problem.
the whole point of this script is to replace part of someone else's installer - The main program requires two others to fucntion properly; the old installer Exec'ed a seperate program that took care of it, but it was too crappy so i have to make one that is integrated and not as crappy. I have the thing pretty much like i want it, but then there comes the issue of getting the paths of the satelite programs: i want to have the user input where these programs are, but only if they aren't in their default places. i sort of understand the InstallOptions .ini thing, but it confuses me. even the whole page system is over my head. can anyone help me out?


you may need this too


PutaQ,

Here's some snippets of code from my install script.
I started with InstallOptions.nsi in the Examples Modern UI folder
and modified it to accomplish my task, then I incorporated that
code in my actual script.

My .ini file defines a custom page that looks something like this:

Make this application available to (groupbox)
(*) Current user (radiobutton)
(_) All users (radiobutton)
The users choice is used to set SetShellVarContext for the installer and the uninstaller. I write it to the registry and read it back during the uninstall.

I skip this page if Windows version is 95 or 98, as shown below.
You would replace this logic with your own (if directory is not as expected, display page that allows user to input the directory).

!insertmacro MUI_PAGE_DIRECTORY
Page custom InstallOptionsCreator InstallOptionsLeave
!insertmacro MUI_PAGE_INSTFILES

Function InstallOptionsCreator

StrCmp ${WIN_VER} "95" SkipPage
StrCmp ${WIN_VER} "98" SkipPage

!insertmacro MUI_HEADER_TEXT "$(TEXT_IO_TITLE)" "$(TEXT_IO_SUBTITLE)"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "InstallOptions_ShellContext.ini"

SkipPage:
; note: when this page is skipped, InstallOptionsLeave function is
; not called, ie is automatically skipped. This is good!

FunctionEnd

Function InstallOptionsLeave
; verify user input if desired, or do stuff...
FunctionEnd

Hope this helps,
Lilla


i want to have the user input where these programs are, but only if they aren't in their default places
Did you use the IO's "DirRequest"
That will give the user to search for the folder...
and:

ReadIniStr $0 $PLUGINSDIR\io.ini "Field #" State
;$0 will give you the folder in runtime.

In the archives there is a script titled:

Setting Default Location for 2nd Directory Page

It includes a URL for displaying two directories.

I came across this and thought it might be helpful to you two.

Lilla


thanks, i'll try it out.