- NSIS Discussion
- Directing NSIS deteilprint to log file
Archive: Directing NSIS deteilprint to log file
jammusi
10th March 2010 10:21 UTC
Directing NSIS deteilprint to log file
I'm using LogEx to log installation activities to a log file
Is it possible to make all NSIS DetailPrint write to the log file as well?
For example:
1. Instruction File a.txt writes to DetailPrint
Extract: a.txt... 100%
2. delete instruction does the same...
Tx
Jammusi
jammusi
10th March 2010 16:43 UTC
Thanks - but this is not what i need.
I am already using LogEx plugin
What I want is that NSIS instructions (like delete , extract) will also write to that log file - as they will write to the DetailPrint window in the installfiles page
jpderuiter
10th March 2010 17:10 UTC
Sorry, missed that.
http://forums.winamp.com/showthread.php?postid=2540163
jammusi
10th March 2010 18:14 UTC
no worries mate
The Dump_to_log_file is not good enough as we need silent mode for our application
LogEx - Unless i miss something is not good as well
As for the special build feature - I checked that and it seems to be OK, but i still need to think about that a bit more.
I want to choose the log name and so I can keep the log history - to follow the application version history.
In addition - our setup is actually running in two phases. When the setup is being executed - it does some activities and than reboot the machine.
After rebooting the process continues and the log file is being appended
Currently i achieve both requirements with the LogEx which is being initialized while setup (1. file name 2. appending to the log file that was created before rebooting)
Also it work with silent mode.
Can i do that with the LogSet?
tx
jpderuiter
11th March 2010 09:12 UTC
I have no experience with the Logging Special Build, but I don't think so, or you will have to make your own special build of NSIS.
To work around this, you could rename the logging file after the first install, and append the new logging file created after reboot to this file.
jammusi
11th March 2010 10:41 UTC
Renaming the file and creating new file might be a sufficient workaround - only I think it is not applicable.
The reason is that the second part of the setup is not a manual operation - but rather being performed automatically by using Windows RunOnce mechanism.
Before rebooting I add the setup to the Windows registry RunOnce - so it will executed by Windows right after the machine reboots.
This means that I can not rename the file as when the setup runs it was already been overridden
What do you think?
jpderuiter
11th March 2010 10:53 UTC
What I meant:
- Run install with log to $INSTDIR\install.log
- Before reboot -> Rename $INSTDIR\install.log to e.g. $INSTDIR\Logging.txt
- Reboot
- Run second part of installer with log to $INSTDIR\install.log
- append install.log to Logging.txt
jammusi
11th March 2010 11:49 UTC
Now i got you ....but still no can do ;)
The reboot takes place from within the first part of the setup.
The first step actually prepare the surface to the second part and reboots the machine.
Meaning - the "first" install.log can not rename as it is still being used by the setup.
Afrow UK
11th March 2010 11:58 UTC
There is no need to rename install.log. As long as both installs run from the same folder they will both append to the same install.log file.
Personally I just stick to using the NSIS logging build and do away with other logging methods. However if you really want to append the logs you'll have to launch another executable at the end of the last installer to do the merge after a set time.
Stu
jammusi
11th March 2010 14:08 UTC
Stu,
If I understand correctly what you say - using the NSIS logging build will append to the same log, so there is no need to do this using another application. That is because the after reboot setup is actually the same executable that knows its state.
This is good enough for me (assuming it works with silent mode - I still need to verify that). I guess I can workaround - the other requirements this way or another.
I'll check and keep you posted
Jammusi
jammusi
14th March 2010 14:10 UTC
Hi,
I checked that - and it's really being appended - but here is another problem I didn't think about
The setup / uninstall processes also activates an external utility to perform some tasks.
Using the LogEx, and by transferring the log file full name, this utility is also able to write to the log file.
But when using the log file created by the LogSet - it can’t write to the file as the file is locked.
Can the locking be bypassed somehow?
Tx
Jammusi