- NSIS Discussion
- skip directory page on custom install
Archive: skip directory page on custom install
longuard
17th March 2011 16:25 UTC
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
jiake
18th March 2011 08:05 UTC
Using Abort command in PRE function of a page to skip it.
longuard
19th March 2011 02:16 UTC
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.
MSG
19th March 2011 10:48 UTC
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
Afrow UK
19th March 2011 21:17 UTC
What do you not understand about GetCurInstType?
Stu
longuard
20th March 2011 04:23 UTC
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.
Afrow UK
20th March 2011 12:13 UTC
"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
longuard
20th March 2011 23:26 UTC
but i dont need to know wich section is chosen but wich install type of the 3
Afrow UK
21st March 2011 14:32 UTC
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
longuard
21st March 2011 15:48 UTC
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
jpderuiter
21st March 2011 16:00 UTC
You have still
Page directory
Page instfiles
in your script.
You should remove these.
longuard
21st March 2011 17:55 UTC
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
longuard
23rd March 2011 02:37 UTC
Any one have a idea to know if user a chose custom without any option change ??