Skip to content
⌘ NSIS Forum Archive

LogEx plugin

73 posts

jpderuiter#
I'm building on VC6, so not all settings are available.
Changing the ones I can doesn't fix it.
This is part of the errorlog:
NOTE: WINVER has been defined as 0x0500 or greater which enables
Windows NT 5.0 and Windows 98 features. When these headers were released,
Windows NT 5.0 beta 1 and Windows 98 beta 2.1 were the current versions.
For this release when WINVER is defined as 0x0500 or greater, you can only
build beta or test applications. To build a retail application,
set WINVER to 0x0400 or visit http://www.microsoft.com/msdn/sdk
to see if retail Windows NT 5.0 or Windows 98 headers are available.
See the SDK release notes for more information.
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnls.h(1050) : error C2081: 'LONG_PTR' : name in formal parameter list illegal
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnls.h(1051) : error C2081: 'LONG_PTR' : name in formal parameter list illegal
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnls.h(1052) : error C2081: 'LONG_PTR' : name in formal parameter list illegal
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnls.h(1061) : error C2081: 'LONG_PTR' : name in formal parameter list illegal
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnls.h(1062) : error C2081: 'LONG_PTR' : name in formal parameter list illegal
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnls.h(1063) : error C2081: 'LONG_PTR' : name in formal parameter list illegal
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnls.h(1217) : error C2146: syntax error : missing ')' before identifier 'UINT'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnls.h(1217) : error C2491: 'IsValidCodePage' : definition of dllimport function not allowed
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnls.h(1217) : error C2059: syntax error : ')'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnls.h(1217) : error C2085: 'CodePage' : not in formal parameter list
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnls.h(1222) : error C2085: 'GetACP' : not in formal parameter list
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnls.h(1227) : error C2085: 'GetOEMCP' : not in formal parameter list
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnls.h(1233) : error C2146: syntax error : missing ')' before identifier 'UINT'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnls.h(1233) : error C2085: 'GetCPInfo' : not in formal parameter list
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnls.h(1233) : error C2146: syntax error : missing ',' before identifier 'UINT'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnls.h(1233) : error C2146: syntax error : missing ',' before identifier 'CodePage'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnls.h(1234) : error C2085: '__out' : not in formal parameter list
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnls.h(1234) : error C2146: syntax error : missing ',' before identifier 'LPCPINFO'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnls.h(1234) : error C2146: syntax error : missing ',' before identifier 'lpCPInfo'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnls.h(1234) : error C2059: syntax error : ')'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnls.h(1240) : error C2146: syntax error : missing ')' before identifier 'UINT'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnls.h(1240) : error C2085: 'GetCPInfoExA' : not in formal parameter list
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnls.h(1240) : error C2146: syntax error : missing ',' before identifier 'UINT'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnls.h(1240) : error C2146: syntax error : missing ',' before identifier 'CodePage'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnls.h(1241) : warning C4042: '__in' : has bad storage class
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnls.h(1241) : error C2146: syntax error : missing ',' before identifier 'DWORD'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnls.h(1241) : error C2146: syntax error : missing ',' before identifier 'dwFlags'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnls.h(1242) : error C2085: '__out' : not in formal parameter list
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnls.h(1242) : error C2146: syntax error : missing ',' before identifier 'LPCPINFOEXA'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnls.h(1242) : error C2146: syntax error : missing ',' before identifier 'lpCPInfoEx'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnls.h(1242) : error C2059: syntax error : ')'
...
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnls.h(1312) : fatal error C1003: error count exceeds 100; stopping compilation
steinbohrer#
NULL-char at the end of each line

Hi jpderuiter,

I've just tried your LogEx-plugin and there is one minor flaw.
I use your Unicode version and there is an NULL-char at the end of each line in the log-file.


LogEx::Init false "$EXEDIR\InstallLog.txt"
LogEx::Write true true "<> Dies ist ein äöüÄÖÜß LogEintrag!"
LogEx::Close
Please have a look at the picture:


If I'm correct, the plugin is written in C and C uses ASCIIZ-strings.
Do you strip the end-marker off the string before you copy it to the log-file?

Is there any chance you can fix this in the near future? 🙂

Thank you very much,
Michael.
jpderuiter#
Fortunately I suddenly saw the light, and found that I had to put the SDK include Library at the top of the list of include directories in vs6.0.

Anyway, I compiled a new version of this plugin, check the wiki:


I fixed both bugs, the one from matthiasb (mentioned 25th august 2010) and the one from steinbohrer.
I don't have time to test it thoroughly, so if you find any problems, please tell me.

jpderuiter
hnedka#
Hi, I have probably discovered a bug. In function Log::Write, you don't remove the parameter from the stack if the file handle is not correct, which leads to stack corruption. May be present in other places, haven't checked.
SJSJ#
Timestamps in Logs?

Hi, a very useful plugin!
Is there a way to embed the timestamps when I do a LogEx::Write?
jpderuiter#
Hi,

not via the LogEx plugin, but you can get the current time with the Time plugin (http://nsis.sourceforge.net/Time_plug-in), or using the system plugin (http://stackoverflow.com/questions/2...ame-using-nsis).
absalom0#
I am currently doing development to test out support for Windows 8 (Windows Developer Preview). Is there any chance that LogEx will be updated to support Windows 8 (Windows version 6.2.8102) anytime soon? 🙂

Thanks
absalom0#
Yeah, I had plugins and forums confused. You're good. I am apparently looking at the wrong place. ><

Thanks though.
JoeSnuffie#
Prepend?

I'm using NSIS as a software updater for my company's applications. I am currently using an application called at the end of the NSIS application to create a log file but I would like to include this process in the NSIS application. To do this I need to be able to prepend my strings rather than append them. This will keep the latest update information at the top of the file. Can this be done?
jpderuiter#
Hi Joe,

no, you cannot prepend text to an existing logfile.
What you can do is create a new logfile when the installer starts, and when finished append the previous created logfile.

jpderuiter