|
![]() |
#1 |
Junior Member
Join Date: Jun 2011
Posts: 26
|
Changing directory of NSIS log directory
I am using
code: 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? |
![]() |
![]() |
![]() |
#3 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Edit: Looks like this was overlooked in that topiccode: ![]() Stu |
![]() |
![]() |
![]() |
#4 |
Junior Member
Join Date: Jan 2013
Posts: 1
|
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 Last edited by andreaM; 24th January 2013 at 04:25. Reason: improve readability |
![]() |
![]() |
![]() |
#5 |
Junior Member
Join Date: Feb 2015
Posts: 2
|
Hi, I think the problem arises when "LogSet on" is used several times (e.g. to turn on logging in several functions). I solved it with this macro that I use ("!insertmacro LogSetOn") instead of "LogSet on" :
!macro LogSetOn ${If} ${FileExists} $INSTDIR\mylogs LogSet on ${Else} Push $INSTDIR StrCpy $INSTDIR $INSTDIR\mylogs SetOutPath $INSTDIR LogSet on Pop $INSTDIR SetOutPath $INSTDIR ${EndIf} !macroend |
![]() |
![]() |
![]() |
#6 |
Junior Member
Join Date: Sep 2015
Posts: 3
|
I have the same problem.
I have only in one place LogSet on StrCpy $INSTDIR "$INSTDIR\logging" SetOutPath $INSTDIR Delete "$INSTDIR\install.log" LogSet on It creates two intall.log files. One to old $INSTDIR that contains only one line: logging set to 1 And the other to the correct (new) $INSTDIR. |
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|