Archive: Changing directory of NSIS log directory


Changing directory of NSIS log directory
I am using


LogSet On

to turn on NSIS logging. This saves the log file as $INSTDIR\install.log

I would like to change the directory of the where this log file is written. I found this thread from 6+ years ago: http://forums.winamp.com/showthread.php?t=207636 mentioning that it is not possible. Is this still the case?

You could recompile your logging build to use a different directory. Or just use dumplog in a normal NSIS installation.


Push $INSTDIR
StrCpy $INSTDIR some_other_dir
LogSet on
Pop $INSTDIR
Edit: Looks like this was overlooked in that topic :).

Stu

Well, I tried, but I cannot get it to work.
I have NSIS 2-46 on a Win 7 64 bits system.
This is an extract of my .nsi file:
...
StrCpy $InstLogDir "$INSTDIR\Ex\logs\installation"
CreateDirectory "$InstLogDir"
Push $INSTDIR
StrCpy $INSTDIR "$InstLogDir"
LogSet on
LogText "Redirected intallation log to $InstLogDir "
Pop $INSTDIR
...
Install.log is still written to the original $INSTDIR version, but it shows the expected beginning:

logging set to 1
Redirected intallation log to C:\EQDR\Ex\logs\installation
Call: 1153
File: overwriteflag=1, allowskipfilesflag=0, name="C:\Users\andrea\AppData\Local\Temp\nsf9E32.tmp\nsDialogs.dll"
File: skipped: "C:\Users\andrea\AppData\Local\Temp\nsf9E32.tmp\nsDialogs.dll" (overwriteflag=1)
Jump: 1041
...
What is mostly strange, is that an install.log is actually written in the $InstLogDir at the end of the installation. This is its whole content:
Delete: DeleteFile("C:\Users\andrea\AppData\Local\Temp\nsf9E32.tmp\modern-header.bmp")
Delete: DeleteFile("C:\Users\andrea\AppData\Local\Temp\nsf9E32.tmp\modern-wizard.bmp")
Delete: DeleteFile("C:\Users\andrea\AppData\Local\Temp\nsf9E32.tmp\nsDialogs.dll")
Delete: DeleteFile("C:\Users\andrea\AppData\Local\Temp\nsf9E32.tmp\nsExec.dll")
Delete: DeleteFile("C:\Users\andrea\AppData\Local\Temp\nsf9E32.tmp\System.dll")
Delete: DeleteFile("C:\Users\andrea\AppData\Local\Temp\nsf9E32.tmp\textreplace.dll")
RMDir: RemoveDirectory("C:\Users\andrea\AppData\Local\Temp\nsf9E32.tmp\")

Can anybody tell me what I do wrong?
Thanks!
Andrea