Old 4th March 2005, 23:08   #1
Hemi99
Junior Member
 
Join Date: Mar 2005
Posts: 1
Re: Dynamic CustomPage Text

I am relatively new to NSIS, but have compiled a pretty complex NSIS installer for multiple OS's. The problem I am running in to is this. There are several already packaged components that may need to be installed if necessary. I have code to check if they need to be installed. What I am trying to do is create a custom page before the MUI_PAGE_DIRECTORY page comes up. What I want it to do is dynamically add the component names to the screen so the users will see what needs to be installed.

i.e.

Data Component #1 (Displayed - not already installed)
Data Component #2 (Not displayed - installed)
Data Component #3 (Displayed - not already installed)

What I already have are certain variable such as Component1, Component2, etc that either store a "yes" or "no" if it is installed. For each "no", I want the item description to be put up on the page. Since this will vary from user to user and cannot be determined at compile time, it needs to be dynamic. Any ideas? If this was VB, VC++, Delphi, PHP I would be able to figure it out no problem. On a side note, NSIS is much better than any of the installers I have worked before. Installshield is one of the worst. Thanks!
Hemi99 is offline   Reply With Quote
Old 5th March 2005, 11:43   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
To create a custom page, you can use InstallOptions. Contrib\InstalOptions contains examples and a readme. Examples\Modern UI\InstallOptions.nsi is a usage example in combination with the MUI.

You can create a custom page with a text box or a label and generate the text at runtime according to those variables. You can then write the text to the STATE field of the text box or the TEXT field of the label. For example (using MUI):
code:
!insertmacro MUI_INSTALLOPTIONS_WRITE "customPage.ini" \
"Field 2" "Text" "component #1\r\n\r\ncomponent #2"


NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik 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