Archive: DumpLog usage


DumpLog usage
I am trying to use the DumpLog function as listed below:

!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

MessageBox MB_ICONINFORMATION 'Attempting to open the file'

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

It does not work in my NSIS script. It does not even attempt to open the output file. I put a MessageBox call in the code (see above) and it does not display the message.

Has anybody else used this function. If so did it work for you. Any ideas on trying to debug what the problem is?

Thanks

Lane


1. Did you call it? :)

Push "$EXEDIR\install.log"
Call DumpLog

2. Try to put MessageBox after push $6.

Yes, Here is the code fragment I used:

Push "C:\Test.Tmp"
Call DumpLog

Again, it is not even trying to create the file.

Thanks

Lane


Be sure that you calling it from "Section" or ".onInstSuccess", but not from ".onGuiEnd".


Ok, I put the call to DumpLog in a section I have called "Post". It now created the external log file.
Thanks...!

What I want'd to do was to catch the log file data at the very end of the install procedure. I have several custom pages that run doing things like downloading firmware to embedded controller boards AFTER the files have all been installed onto the hard drive. Can you suggest what would be the best place (Section of call-back function) to put the call to the Dumplog function to achieve this?

I'm assuming that calling it from a custom page is where my problem started. Is it possible to modify the Dumplog function to work from a custom page that is placed at the very end of the install?

Thanks for your help

Lane


You can use "Function .onInstSuccess", but DumpLog only dump details of the "page instfiles". If you want to save details on the custom pages, you can wrote simple macro to write in file. Something like this:

Name "Output"
OutFile "Output.exe"

!include DetailPrint.nsh

Section
${OpenDetailPrint} "C:\log.txt"

${DetailPrint} "Detial 1"
${DetailPrint} "Detial 2"
${DetailPrint} "Detial 3"

${CloseDetailPrint}
SectionEnd

P.S. Probably there is someone wrote already such script, but I couldn't remember.

Yes, I have something like this running now. (An external log file writing system).

It looks like the "internal log" only applies to the installing/copying of file page. This is what the "Dumplog" is extracting for me now. It took me a while to understand this. I originally thought that the Dumplog would extract and catch all of the "Detailprints" I was doing from my custom pages that where outside, or past the installation of files. I think I have a better understanding of how it works now.

Regards

Lane