When "LogSet On" is set in .onInit function, running
installer in silent mode, yields 100% of the logging.
However running the installer in normal (MUI) mode, the
logging stops right after the DirectoryLeave function.
I created a sample nsi file that this problem is
reproducible in. Compile the below code and run it by
double clicking on it. After it runs (on you desktop is
fine) you will see that the log file stops logging right after
the directoryLeave function. Then run it in silent mode
from command line, (logset.exe /S) and you will see the
logging keeps going throughout the sections.
If you then un-comment the ;LogSet On command in
the -Pre section, that seems to correct the problem, but
having to set LogSet twice (in .onInit and in the first
section) seems like a bug.
Per kichik, posting this bug. Thanks all, you guys rule.
Jon
orum@charter.net
code:--------------------------------------------------------------------
; NSIS 2.05
!define PRODUCT_NAME "LogSet"
!include "MUI.nsh"
!define MUI_ABORTWARNING
; Pages
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_COMPONENTS
!define
MUI_PAGE_CUSTOMFUNCTION_LEAVE "DirectoryLeav
e"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_LANGUAGE "English"
; MUI end------
Name "${PRODUCT_NAME}"
AllowRootDirInstall True
OutFile "LogSet.exe"
InstallDir "$EXEDIR"
ShowInstDetails Hide
Section "-Pre"
;LogSet On
IfSilent 0 End
Call DirectoryLeave
End:
SectionEnd
Section "1" SEC01
DetailPrint "In Section 1"
SectionEnd
Section "2" SEC02
DetailPrint "In Section 2"
SectionEnd
Section "3" SEC03
DetailPrint "In Section 3"
SectionEnd
;---------------------------------
Function .onInit
LogSet On
LogText ""
LogText ""
LogText "_________________________"
LogText "Start of ${PRODUCT_NAME}"
FunctionEnd
Function DirectoryLeave
DetailPrint "In DirectoryLeave"
FunctionEnd
Logged In: YES
user_id=584402
Thanks, fixed. Logging will now be enabled and disabled when
leaving the directory page only if the logging checkbox is
visible. The logging checkbox is visible if the user held
the SHIFT key when entering the directory page.