Archive: skip directory page on custom install


skip directory page on custom install
I have gone though the help and this forum to see if I
could understand the behavior of GetCurInstType call.

I have 3 install types, namely, Complete, Update Files,
and Custom.

i need to know wish type is selected to by able to skip the MUI_PAGE_DIRECTORY
on the Custom type

there is a wayto do that

thanks


Using Abort command in PRE function of a page to skip it.


yah i konw that but what i want is to show the directory page when a user choose custom instal type and without a change of the selected option.


You can create a custom page for this, using nsDialogs. There's an excellent tutorial in the nsDialogs readme: http://nsis.sourceforge.net/Docs/nsDialogs/Readme.html


What do you not understand about GetCurInstType?

Stu


if you have 3 type of install
and if a user choose costum and don't make a change in the selected option the GetCurInstType will return 2 instead of 32 but there is a another way to kinow the user have choose custom.


"If the first install type is selected, 0 will be put in user_var. If the second install type is selected, 1 will be put in user_var, and so on."

If you want to determine user selection otherwise, use SectionIsSelected on each section.

Stu


but i dont need to know wich section is chosen but wich install type of the 3


Originally posted by longuard
if you have 3 type of install
and if a user choose costum and don't make a change in the selected option the GetCurInstType will return 2 instead of 32 but there is a another way to kinow the user have choose custom.
Sorry I don't follow this. Could you produce a small script that demonstrates this?

Stu

have a look in this
there is a bug on that simple the directory page is execute a the end i dont know why ?


; The name of the installer
!include Sections.nsh
!include "MUI2.nsh"
!include "LogicLib.nsh"


Name "Example1"

; The file to write
OutFile "example1.exe"

; The default installation directory
InstallDir $DESKTOP\test

RequestExecutionLevel user


; Welcome page
!insertmacro MUI_PAGE_WELCOME
; Components page

!insertmacro MUI_PAGE_COMPONENTS
; Directory page
!define MUI_PAGE_CUSTOMFUNCTION_PRE skipChoseDirectory
!insertmacro MUI_PAGE_DIRECTORY
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH

Page directory
Page instfiles


InstType "Client"
InstType "server"
InstType /COMPONENTSONLYONCUSTOM


; Language files
!insertmacro MUI_LANGUAGE "French"
;--------------------------------

; The stuff to install
Section "Client" SEC01
SectionIn 1 2
; Set output path to the installation directory.

MessageBox MB_OK "client install"

SectionEnd ; end the section



; The stuff to install
Section "Serveur" SEC02
SectionIn 2
; Set output path to the installation directory.
SetOutPath $INSTDIR

MessageBox MB_OK "server install"
SectionEnd ; end the section


Function skipChoseDirectory

GetCurInstType $0
MessageBox MB_OK "install type = $0"
${If} $0 == 0
Abort ; dont allow to change directory install
${EndIf}

${If} $0 == 1
Abort ; dont allow to change directory install
${EndIf}

FunctionEnd


You have still

Page directory
Page instfiles

in your script.
You should remove these.


opps
thanks, better like this

; The name of the installer
!include Sections.nsh
!include "MUI2.nsh"
!include "LogicLib.nsh"


Name "Example1"

; The file to write
OutFile "example1.exe"

; The default installation directory
InstallDir $DESKTOP\test

RequestExecutionLevel user


; Welcome page
!insertmacro MUI_PAGE_WELCOME
; Components page

!insertmacro MUI_PAGE_COMPONENTS
; Directory page
!define MUI_PAGE_CUSTOMFUNCTION_PRE skipChoseDirectory
!insertmacro MUI_PAGE_DIRECTORY
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH

InstType "Client"
InstType "server"
InstType /COMPONENTSONLYONCUSTOM

; Language files
!insertmacro MUI_LANGUAGE "French"
;--------------------------------

; The stuff to install
Section "Client" SEC01
SectionIn 1 2
; Set output path to the installation directory.

MessageBox MB_OK "client install"

SectionEnd ; end the section



; The stuff to install
Section "Serveur" SEC02
SectionIn 2
; Set output path to the installation directory.
SetOutPath $INSTDIR

MessageBox MB_OK "server install"
SectionEnd ; end the section


Function skipChoseDirectory

GetCurInstType $0
MessageBox MB_OK "install type = $0"
${If} $0 == 0
Abort ; dont allow to change directory install
${EndIf}

${If} $0 == 1
Abort ; dont allow to change directory install
${EndIf}

FunctionEnd


Any one have a idea to know if user a chose custom without any option change ??