danCDT123
6th January 2013 15:12 UTC
create GUID
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?
Brummelchen
12th January 2013 18:10 UTC
does this help?
http://nsis.sourceforge.net/Create_a...que_Identifier
danCDT123
13th January 2013 13:42 UTC
Not really
Thank you for replying. This is the code we used in the first place. Maybe it has a bug?
Brummelchen
13th January 2013 15:59 UTC
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
>
kichik
3rd March 2013 07:53 UTC
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?
Marshallx7
14th March 2013 17:47 UTC
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.
Afrow UK
14th March 2013 18:19 UTC
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
kichik
17th March 2013 01:23 UTC
You could build System.dll with
SYSTEM_LOG_DEBUG
turn it on with
System:: Debug $OUTDIR\somelogfile.log
and request that log file when it happens.
The only possibility I see in the code is lack of memory. But the user would have seen that elsewhere...