Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 25th June 2003, 17:00   #1
putaQ
Junior Member
 
Join Date: Jun 2003
Posts: 3
Question 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?
Attached Files
File Type: nsi oct.nsi (8.2 KB, 60 views)
putaQ is offline   Reply With Quote
Old 25th June 2003, 17:01   #2
putaQ
Junior Member
 
Join Date: Jun 2003
Posts: 3
you may need this too
Attached Files
File Type: nsh stl.nsh (1.1 KB, 58 views)
putaQ is offline   Reply With Quote
Old 25th June 2003, 23:11   #3
Lilla
Junior Member
 
Join Date: Jun 2003
Posts: 46
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
Lilla is offline   Reply With Quote
Old 25th June 2003, 23:37   #4
Joel
Debian user
(Forum King)
 
Joel's Avatar
 
Join Date: Jan 2003
Location: Arch land
Posts: 4,896
Quote:
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:
code:

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



* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux w/ xfce4.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Debian unstable w/ xfce4.
Joel is offline   Reply With Quote
Old 26th June 2003, 02:40   #5
Lilla
Junior Member
 
Join Date: Jun 2003
Posts: 46
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
Lilla is offline   Reply With Quote
Old 26th June 2003, 15:13   #6
putaQ
Junior Member
 
Join Date: Jun 2003
Posts: 3
thanks, i'll try it out.
putaQ is offline   Reply With Quote
Reply
Go Back   Winamp 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