Old 31st January 2007, 16:24   #1
vkoldenh
Junior Member
 
Join Date: Jan 2007
Location: The Netherlands
Posts: 2
Question How to display a custom page based on a setup type

Hi,

I have created a small installer with a custom page, asking for a specific path. Now I want to be able to show this dialog only, if the customer/user has selected a specific setup type. So for instance, only when he chooses Custom as the setup type.

Now I have read a number of the forums, and I looked into the documentation, but I need so help or guidance on how this could be done.

Any help or just ideas would be very much appreciated.

Thanks in advance.

Vincent
vkoldenh is offline   Reply With Quote
Old 31st January 2007, 16:33   #2
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
See NSIS documentation 4.9.13.10 GetCurInstType
Once you manage this, on custom page's create function before the InstallOptions call, check the var and if for instance is anything else than 32 which is the custom install, add abort to skip the page,

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 31st January 2007, 17:18   #3
vkoldenh
Junior Member
 
Join Date: Jan 2007
Location: The Netherlands
Posts: 2
Thanks. I will have a good read into that chapter.
vkoldenh is offline   Reply With Quote
Old 13th March 2007, 07:51   #4
rochi
Junior Member
 
Join Date: Mar 2007
Posts: 3
Hi,

I want to get the current install type with GetCurInstType
but i can't get the custom install type.

InstType Full

GetCurInstType get 0 for "Full" but also 0 for custom ( i think the documentation says custom is ${NSIS_MAX_INST_TYPES} ?)
I'm really confused about.

Thx
Frank
rochi is offline   Reply With Quote
Old 13th March 2007, 07:55   #5
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
${NSIS_MAX_INST_TYPES} == 32

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 13th March 2007, 08:09   #6
rochi
Junior Member
 
Join Date: Mar 2007
Posts: 3
InstType "Full"

Function .onSelChange
;MessageBox MB_OK "Hallo?"
GetCurInstType $R1
${If} $R1 == ${NSIS_MAX_INST_TYPES}
MessageBox MB_OK "Custom"
${EndIf}
FunctionEnd

The messagebox appears never.
rochi is offline   Reply With Quote
Old 13th March 2007, 08:20   #7
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
Well custom or not (32) is depended on selected/deselected components, e.g. if you select custom from dropdown without changing the components selection then the current install type is still full.
Here is a related example:
code:
OutFile "Test.exe"
InstallDir "$PROGRAMFILES\boo"

InstType Typical
InstType Full

!include "mui.nsh"

!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Docs\Modern UI\License.txt"
!insertmacro MUI_PAGE_COMPONENTS
Page Custom custcreate custleave
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH

!insertmacro MUI_LANGUAGE "English"

Section "common" sec1
SectionIn 1 2
SectionEnd

Section "data" sec2
SectionIn 1 2
SectionEnd

Section /o "examples" sec3
SectionIn 2
SectionEnd

Function custcreate
GetCurInstType $0
StrCmp $0 32 next
Abort
next:
!insertmacro MUI_HEADER_TEXT "Warning! Custom Installation" \
"You may see this page whenever your selection is custom installation!"
push $0
InstallOptions::Dialog "$PLUGINSDIR\custom.ini"
pop $0
pop $0
FunctionEnd

Function custleave
MessageBox MB_OK "This is a custom installation"
FunctionEnd

Function .onInit
InitPluginsDir
GetTempFileName $0
Rename $0 "$PLUGINSDIR\custom.ini"

WriteINIStr "$PLUGINSDIR\custom.ini" "settings" "numfields" "1"
WriteINIStr "$PLUGINSDIR\custom.ini" "field 1" "type" "groupbox"
WriteINIStr "$PLUGINSDIR\custom.ini" "field 1" "text" "I'm a GroupBox, or not..."
WriteINIStr "$PLUGINSDIR\custom.ini" "field 1" "left" "10"
WriteINIStr "$PLUGINSDIR\custom.ini" "field 1" "right" "-10"
WriteINIStr "$PLUGINSDIR\custom.ini" "field 1" "top" "10"
WriteINIStr "$PLUGINSDIR\custom.ini" "field 1" "bottom" "-10"
FunctionEnd


Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine 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