これは正しいですが、リストビューウィンドウはサイレントモードでは存在しません。
私は自分自身のログロールは、次の2つのオプションを持っていると思います。私は、ログを保存するには、このメソッドを使用し
Function .onInit
IfSilent 0 +2
StrCpy $0 1 ;We need to know if we are in "real silent" mode
SetSilent normal ;Turn off real silent mode so we can fake it
FunctionEnd
Function .onGuiInit
StrCmp $0 1 0 +3
HideWindow
SetSilent silent ;The docs say this is only supported in .onInit but all we care about is the internal flag used by IfSilent
FunctionEnd
LicenseData "${__FILE__}"
page license skipifsilent ; All pages except instfiles needs this hack
page directory skipifsilent
page instfiles
Function skipifsilent
IfSilent 0 +3
HideWindow
Abort
FunctionEnd
Section
IfSilent 0 +2
HideWindow
SetOutPath $instdir
File "${__FILE__}"
Sleep 2222 ;So we can see that it is hidden and not just finishing quickly
DetailPrint "$(^Completed)" ; Fake the completed message show it shows in the log
Push "$EXEDIR\install.log"
Call DumpLog
IfSilent 0 +2
Quit
SetDetailsPrint textonly
SectionEnd
!define LVM_GETITEMCOUNT 0x1004
!define LVM_GETITEMTEXT 0x102D
Function DumpLog
Exch $5
Push $0
Push $1
Push $2
Push $3
Push $4
Push $6
FindWindow $0 "#32770" "" $HWNDPARENT
GetDlgItem $0 $0 1016
StrCmp $0 0 exit
FileOpen $5 $5 "w"
StrCmp $5 "" exit
SendMessage $0 ${LVM_GETITEMCOUNT} 0 0 $6
System::Alloc ${NSIS_MAX_STRLEN}
Pop $3
StrCpy $2 0
System::Call "*(i, i, i, i, i, i, i, i, i) i \
(0, 0, 0, 0, 0, r3, ${NSIS_MAX_STRLEN}) .r1"
loop: StrCmp $2 $6 done
System::Call "User32::SendMessageA(i, i, i, i) i \
($0, ${LVM_GETITEMTEXT}, $2, r1)"
System::Call "*$3(&t${NSIS_MAX_STRLEN} .r4)"
FileWrite $5 "$4$\r$\n"
IntOp $2 $2 + 1
Goto loop
done:
FileClose $5
System::Free $1
System::Free $3
exit:
Pop $6
Pop $4
Pop $3
Pop $2
Pop $1
Pop $0
Exch $5
FunctionEnd