jweinraub
29th January 2009 18:55 UTC
how do i enable full logging?
I am trying to do a test on if a file version is set, and that check seems to work (even if the file isn't there) but the action i want it to do, doesn't seem to work.
it does on my system, but not other systems i try it on.
i used the standard event viewing (but normally i turn off output in production), but cant find anything of use.
the loggin from kichik doesnt seem to work for me, when it dumps, it is always blank.
the code in question is:
; Install WinPcap
GetDllVersion "$SYSDIR\Packet.dll" $R0 $R1
IntOp $R2 $R0 / 0x00010000
IntOp $R3 $R0 & 0x0000FFFF
IntOp $R4 $R1 / 0x00010000
IntOp $R5 $R1 & 0x0000FFFF
StrCpy $0 "$R2.$R3.$R4.$R5"
MessageBox MB_OK $0
; 4.0.0.1040
${If} $0 == "4.0.0.1040"
MessageBox MB_OK "We have Packet.dll installed. Go_on_further"
Goto go_on_further
${Else}
SetDetailsPrint textonly
DetailPrint "Installing WinPcap 4.02..."
SetDetailsPrint none
MessageBox MB_OK "We do not have it, we will now attempt to install"
; enable full logging here to see what is going on here.
ExecWait `"$EXEDIR\WinpCap\winpcap-nmap-4.02.exe" /S` $R0
${EndIf}
; End install WinPcap
my the msgbox, i do enter the else clause, but the installer doesn't seem to run at all.
any feedback is appreciated.
bohajo
29th January 2009 19:14 UTC
Hello
for logging I use the function
DetailPrint "Test log".
This is printed in the log window.
In the last section of the installer I use a function found in the net called DumpLog.
;last section
Section ""
;Create a Logfile from the installation
StrCpy $0 $INSTDIR\install.log
Push $0
Call DumpLog
SectionEnd
The the complete content of the log window is dumped into a file in the DIR where the files will be installed.
The function see below.
Hope it helps.
Joachim
; --- Function DumpLog: write log window data to file
!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 error
FileOpen $5 $5 "w"
StrCmp $5 0 error
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
Goto exit
error:
MessageBox MB_OK error
exit:
Pop $6
Pop $4
Pop $3
Pop $2
Pop $1
Pop $0
Exch $5
FunctionEnd
jweinraub
29th January 2009 19:32 UTC
i tried using that function, is what i meant, and did not work.
Even when I took out:
ShowInstDetails NeverShow
- and -
SetDetailsPrint textonly
DetailPrint "Installing Microsoft .NET 2.0..."
SetDetailsPrint none
and hte autoclose, etc.
where do i save this file?
am i executing the 3rd party installer correctly, is this the issue?
jweinraub
29th January 2009 19:43 UTC
b/c i compress the 3rd party installer with the installer, it is not a standalone, it gets included with the installer script/ the folder that is.
i think the deal is, i am not putting the files in the cd, i want them to run from the standalone exe installer, but i dont want the files themselves to install into the program files folder.
is this possible?