I have this instruction in NSIS script to create a GUID
System::Call 'ole32::CoCreateGuid(g .s)'
and then:
!if ${_RetVar} != s
Pop ${_RetVar}
In some weird cases the returned GUID is the string 'ole32::CoCreateGuid(g .s)'.
Does anyone knows something about it?
create GUID
8 posts
Not really
Thank you for replying. This is the code we used in the first place. Maybe it has a bug?
Thank you for replying. This is the code we used in the first place. Maybe it has a bug?
first example runs fine on win7
;test
SetCompressor /SOLID bzip2
AutoCloseWindow true
ShowInstDetails nevershow
ShowUninstDetails nevershow
OutFile "test.exe"
;--------------------------------
;Languages
LoadLanguageFile "${NSISDIR}\Contrib\Language files\english.nlf"
;--------------------------------
;Installer Sections
Section
SectionEnd
;--------------------------------
;Installer Functions
Function .onInit
loop:
Call CreateGUID
Pop $0 ;contains GUID
messagebox mb_okcancel|mb_defbutton1 "GUID: $0" idok loop
done:
Quit
FunctionEnd
;Call CreateGUID
;Pop $0 ;contains GUID
Function CreateGUID
System::Call 'ole32::CoCreateGuid(g .s)'
FunctionEnd If you get the original string sent to System::Call, it means System::Call didn't do anything and just returned. That's why you just have the original string on the stack. That's... weird... Any more details on when this happens?
Total shot in the dark guess, but did you build your own version of System.dll by any chance?
Total shot in the dark guess, but did you build your own version of System.dll by any chance?
I've had the EXACT same problem. Everything is original. It has only ever happend on customer systems though, and they report the error back to us. We have never been able to reproduce it ourselves. I'd say it maybe happens 1 in every 10,000 installs, maybe less frequently than that even.
You could put the call into a For loop for a few iterations until it either returns a GUID or throws an error message.
Stu
Stu
You could build System.dll with
The only possibility I see in the code is lack of memory. But the user would have seen that elsewhere...
turn it on withSYSTEM_LOG_DEBUG
and request that log file when it happens.System:: Debug $OUTDIR\somelogfile.log
The only possibility I see in the code is lack of memory. But the user would have seen that elsewhere...