Log files
Posted: Tue Jul 26, 2011 9:55 am
I referred to 'Logged execution' in documentation and also a few posts on this forum regarding logging information. I am still not sure if I am doing it correctly and just need someone to verify my approach.
I declared a variable LOGFILE with the location of log file, then after each important step such as checking pre-requisites, updating config etc I added a statement setting LOGGED variable, and then wrote that to LOGFILE as shown in the code below. Is this approach correct to log information as your installer runs or is there a better way? I read that we need to use <setup.exe> /l= path to log file. Where exactly do we provide these arguments? On command line?
When I do try something like the code below, it does create a file but when it hits 'Apply Install', it hangs. If I simply write the content of '$LOGGED$' to log.txt after 'Apply Install', log.txt gets created but remains empty. Any ideas?
I declared a variable LOGFILE with the location of log file, then after each important step such as checking pre-requisites, updating config etc I added a statement setting LOGGED variable, and then wrote that to LOGFILE as shown in the code below. Is this approach correct to log information as your installer runs or is there a better way? I read that we need to use <setup.exe> /l= path to log file. Where exactly do we provide these arguments? On command line?
When I do try something like the code below, it does create a file but when it hits 'Apply Install', it hangs. If I simply write the content of '$LOGGED$' to log.txt after 'Apply Install', log.txt gets created but remains empty. Any ideas?
Code: Select all
Set Variable LOGFILE to $TARGETDIR$\log.txt
.
.
.
Set Variable LOGGED as 'Running pre-requisite checks'
Write into Text File $LOGFILE$ from Value $LOGGED$ (at end of file)
.
.
.
Set Variable LOGGED to "Updating Config files"
Write into Text File $LOGFILE$ from Value $LOGGED$ (at end of file)
.
.
.
Set Variable LOGGED to "SERVERADDRESS = " SERVERADDRESS
Write into Text File $LOGFILE$ from Value $LOGGED$ (at end of file)