Old 6th January 2013, 14:12   #1
danCDT123
Junior Member
 
Join Date: Jan 2013
Posts: 2
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?
danCDT123 is offline   Reply With Quote
Old 12th January 2013, 17:10   #2
Brummelchen
Major Dude
 
Join Date: May 2003
Posts: 681
does this help?
http://nsis.sourceforge.net/Create_a...que_Identifier
Brummelchen is offline   Reply With Quote
Old 13th January 2013, 12:42   #3
danCDT123
Junior Member
 
Join Date: Jan 2013
Posts: 2
Not really

Thank you for replying. This is the code we used in the first place. Maybe it has a bug?
danCDT123 is offline   Reply With Quote
Old 13th January 2013, 14:59   #4
Brummelchen
Major Dude
 
Join Date: May 2003
Posts: 681
first example runs fine on win7
PHP Code:
;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 
$;contains GUID
    messagebox mb_okcancel
|mb_defbutton1 "GUID: $0" idok loop
  done
:

  
Quit
FunctionEnd

;Call CreateGUID
;Pop $;contains GUID
Function CreateGUID
  System
::Call 'ole32::CoCreateGuid(g .s)'
FunctionEnd 
Brummelchen is offline   Reply With Quote
Old 3rd March 2013, 06:53   #5
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
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?

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 14th March 2013, 15:47   #6
Marshallx7
Junior Member
 
Join Date: Oct 2012
Posts: 36
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.
Marshallx7 is offline   Reply With Quote
Old 14th March 2013, 16:19   #7
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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
Afrow UK is offline   Reply With Quote
Old 16th March 2013, 23:23   #8
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
You could build System.dll with
code:
SYSTEM_LOG_DEBUG
turn it on with
code:
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...

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik 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