Skip to content
⌘ NSIS Forum Archive

I want to use logging

10 posts

TGS#

I want to use logging

I want to use logging but get this Error: LogSet specified, NSIS_CONFIG_LOG not defined.

Attached files i use config.nsh and In&Un.nsi
kichik#
You need to define NSIS_CONFIG_LOG in Source\exehead\config.h and recompile NSIS. It's not a NSIS compiler setting you can define using !define.
dabossuk#
why ?

Hi

I was wondering "why" you have made it so you have to recompile to add this feature ? Seems a rather radical method for something that should be an option - or am I missing something ? ARe these logs different to what gets put in the log window while installing ? Is there a way to pipe that to a file ?

What about issuing a EXE that has the switch set in the build ? To save people from recompiling ...

Daboss
kichik#
The logs are different than the details printed to the user and are for debugging purpose. The user can right click the details window and choose copy if he/she wishes to keep a copy of it. It's not built in by default because it adds a lot to the EXE header size and usually not required. Containing a switch for it in the compiler would mean that the compiler will have to compile the EXE header or have a pre-made copy, both of which would just eat up time.
Afrow UK#
The NSIS log feature is for logging the output at compile time.
To capture the log of the InstFiles log window, use this script:



-Stu
dabossuk#
Hi

Ah ok ... now I understand :-) - and thanks for that script - something I will use ..

Dabossuk
dabossuk#
Output of log question ...

Hi

Finally getting around to outputting the log - but not totally understanding what you mean by Push a file. Could you give me real world example please ;-)

Thanks

************************************************************
To use it push a file name and call it. It will dump the log to the file specified. For example:

Save this script

GetTempFileName $0
Push $0
Call DumpLog

*************************************************************
ramon18#
Push command pushes parameters on stack, like assembler does.
This is the design of the NSIS script, not magic

example of simple function taht receive parameters by stack:
Function DoMsg
 pop $0
 MessageBox MB_OK "The message is : $0"
FunctionEnd 
so to call this function you must PUSH a string before
push "Sample Test"
call DoMsg 
So for the function "DumpLog" you must push a string containing the filename where the log information is stored

ex:
 push "c:\MyLogFile.txt"
 Call DumpLog 
then output info will be stored in the file "c:\MyLogFile.txt"

of-course this is valid too:
 StrCpy $0 "c:\MyLogFile.txt"
 push $0
 Call DumpLog 
I hope you understand the meaning of PUSH/POP statments when using functions that receive parameters using NSIS stack


bye,
Ramon