Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 4th May 2006, 09:19   #1
Sternenfaenger
Junior Member
 
Join Date: Nov 2004
Posts: 5
Do I need a custom page for this ?

Hi, this is probably a newbie question and admittedly in NSIS I'm quiete new:

I use the modern ui.

I'd like to permit the installer to
- let the user choose where to install the main components
- let the user choose whether or not he/she likes to install additional components
- If additional components are selected for installation the path where to install them should be again selected by the user.

With my little knowledge about NSIS/MUI I got the impression that the installer default pages (no custom pages) have the ability just...
- to let the user choose one install path (e.g. for the main components).
- to permit the user to (de-)select additional components for installation.

So do I really need a custom page to query the install paths for the other components or did I overlook a MUI_PAGE... macro ?
Sternenfaenger is offline   Reply With Quote
Old 4th May 2006, 11:24   #2
galil
Member
 
Join Date: Jan 2003
Posts: 83
You can insert more than one directory page.
And you can define MUI_DIRECTORYPAGE_VARIABLE (and use it later with SetOutPath).

code:

Var COMPONENTSDIR

!insertmacro MUI_PAGE_DIRECTORY ;OutPath will be $INSTDIR
!insertmacro MUI_PAGE_COMPONENTS
!define MUI_DIRECTORYPAGE_VARIABLE $COMPONENTSDIR
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES

Section -main
SetOutPath $INSTDIR
File "MainPoop.exe"
SectionEnd

Section "Additional Components" comps
SetOutPath $COMPONENTSDIR
File "poop.dll"
SectionEnd

galil is offline   Reply With Quote
Old 4th May 2006, 12:13   #3
Sternenfaenger
Junior Member
 
Join Date: Nov 2004
Posts: 5
Feature request

Quote:
Originally posted by galil
You can insert more than one directory page.
And you can define MUI_DIRECTORYPAGE_VARIABLE (and use it later with SetOutPath).
Thank you for the quick reply.
Are the other directory pages always shown or is there a way to show them only if the sections are chosen by the user ?
If it is not possible and/or the MUI_PAGE_COMPONENTS is not able to permit the user to define different paths for each component the following feature request might be reasonable:

- add a MUI_PAGE_COMPONENTS_EX which provides an edit field and a button for a "browse folders" dialog to permit the user to change the predefined outpath for the components.

As a suggestion for the design:
Each component in the component page is shown as an item of a tree view which has a check box next to it to permit the component to be selected for installation or not. (Exactly like in MUI_PAGE_COMPONENTS).
Moreover when the user selects an item a button "Advanced Settings" gets enabled which, when pressed, opens another page which comprises the settings for the component (this might be a custom page). The "Advanced Settings" settings dialog for each component is then closed either by "OK" or "Cancel".

What do you think ?
Sternenfaenger is offline   Reply With Quote
Old 4th May 2006, 15:38   #4
galil
Member
 
Join Date: Jan 2003
Posts: 83
Re: Feature request

Quote:
Originally posted by Sternenfaenger
Are the other directory pages always shown or is there a way to show them only if the sections are chosen by the user ?
If you want to skip such page you have to check if the section(s) was selected and use Abort in PRE function for that page.
Like this...
code:

Var COMPONENTSDIR

!insertmacro MUI_PAGE_DIRECTORY ;OutPath will be $INSTDIR
!insertmacro MUI_PAGE_COMPONENTS
!define MUI_PAGE_CUSTOMFUNCTION_PRE "pre_componentsdir"
!define MUI_DIRECTORYPAGE_VARIABLE $COMPONENTSDIR
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES

Section -main
SetOutPath $INSTDIR
File "MainPoop.exe"
SectionEnd

Section "Additional Components" comps
SetOutPath $COMPONENTSDIR
File "poop.dll"
SectionEnd

Function pre_componentsdir
SectionGetFlags ${comps} $R0
IntOp $R0 $R0 & 1
IntCmp $R0 1 +2
Abort
FunctionEnd


galil is offline   Reply With Quote
Old 8th May 2006, 08:41   #5
Sternenfaenger
Junior Member
 
Join Date: Nov 2004
Posts: 5
Thank you very much for your reply.
The answer helped me very much.
Rating: Best

Does this forum support rating the answers of the users ?
Sternenfaenger is offline   Reply With Quote
Old 8th May 2006, 21:43   #6
JasonFriday13
Senior Member
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: Taranaki, New Zealand
Posts: 400
No, it dosen't.

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
Wiki Profile
JasonFriday13 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