jsbach
13th June 2005 14:24 UTC
hide all sections except some in silent mode
i'm confused on how to hide all sections except one (i.e. instfiles) while in silent mode. i don't want to exclude pages or make everything silent: i basically wish a normal script to always show instfiles progress wheter or not /S par was passed on cmdline; if no /S is passed, then script should execute as normal (with all sections/pages).
I'm quite sure this possibly be already covered in the forum : my apologies not finding it. i appreciate just an hint to correctly look for the right anwser to my need...
thanks.
Mæster
13th June 2005 19:58 UTC
Use the "IfSilent" statement to check by code if the installer runs in silent mode or not. If you know in which mode the installer currently runs you could react to do whatever you want including to show the installer.
jsbach
14th June 2005 16:46 UTC
thanks, but not valid outside sections...
thanks Mæster, however IfSilent is not valid outside sections. so i can't do:
IfSilent +4 ; ? visible only if not silent ?
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES ; ? always visible ?
IfSilent +2 ; ? visible only if not silent ?
!insertmacro MUI_PAGE_FINISH
; uninstall always visible...
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
any other hint ?
Mæster
14th June 2005 19:17 UTC
Re: thanks, but not valid outside sections...
If it was me trying to only show the installfiles page if started in silent mode, i would probably use the following trick to do that:
1. I would save the silent mode in a variable and then set the installmode to normal
2. Depending on the variable I would skip/show all pages except the installfiles page which should always be shown.
Here is it written in code:
Var HIDEPAGE # set to "1" if started silent
!define MUI_WELCOMEFINISHPAGE_CUSTOMFUNCTION_INIT ShowSkipPage
!insertmacro MUI_PAGE_WELCOME # skipped if started silent
!define MUI_PAGE_CUSTOMFUNCTION_PRE ShowSkipPage
!insertmacro MUI_PAGE_COMPONENTS # skipped if started silent
!define MUI_PAGE_CUSTOMFUNCTION_PRE ShowSkipPage
!insertmacro MUI_PAGE_DIRECTORY # skipped if started silent
!insertmacro MUI_PAGE_INSTFILES # always show this one
!insertmacro MUI_PAGE_FINISH # skipped if started silent
# right after the installer started we check if runs in silent mode
Function .onInit
# IfSilent we set HIDEPAGE = "1"
IfSilent 0 +3
Strcpy $HIDEPAGE "1"
SetSilent normal
# we always set the installer mode to normal to use the page
# callback functions
FunctionEnd
# function to skip the page if $HIDEPAGE = "1"
Function ShowSkipPage
Strcmp $HIDEPAGE "1" 0 +2
ABORT
FunctionEnd
jsbach
21st June 2005 23:39 UTC
thanks
exactly what i need. thanks a lot.
mpenaili
19th July 2005 18:01 UTC
this script is excelente!!!!! thanks..
Marcelo