Old 26th March 2012, 20:21   #1
dizou
Junior Member
 
Join Date: Jun 2011
Posts: 26
Changing directory of NSIS log directory

I am using
code:

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?
dizou is offline   Reply With Quote
Old 26th March 2012, 21:19   #2
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
You could recompile your logging build to use a different directory. Or just use dumplog in a normal NSIS installation.
MSG is offline   Reply With Quote
Old 26th March 2012, 21:52   #3
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
code:
Push $INSTDIR
StrCpy $INSTDIR some_other_dir
LogSet on
Pop $INSTDIR

Edit: Looks like this was overlooked in that topic .

Stu
Afrow UK is offline   Reply With Quote
Old 24th January 2013, 05:22   #4
andreaM
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 05:25. Reason: improve readability
andreaM is offline   Reply With Quote
Old 9th February 2015, 14:32   #5
ted.reinhard
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
ted.reinhard is offline   Reply With Quote
Old 16th October 2015, 10:13   #6
iulian
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.
iulian is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump