Archive: Generate UUID


Generate UUID
Any hints on generating a UUID in NSIS?

TIA


call uuidcreate ( http://msdn.microsoft.com/library/de...uuidcreate.asp ) with the system plugin


Windows API calls available via System plug-in. Plug-in and description included to distribution (Start->Programs->NSIS :) ), forum search may help with samples as well. CoCreateGuid, UuidCreate.


System::Alloc 80
System::Alloc 16
System::Call 'ole32::CoCreateGuid(i sr1) i'
System::Call 'ole32::StringFromGUID2(i r1, i sr2, i 80) i'
System::Call 'kernel32::WideCharToMultiByte(i 0, i 0, i r2, i 80, t .r3, i ${NSIS_MAX_STRLEN}, i 0, i 0) i'
System::Free $1
System::Free $2


There's no need to call WideCharToMultiByte. The System plug-in can do that for you.

System::Alloc 16
System::Call 'ole32::CoCreateGuid(i sR0)'
System::Call 'ole32::StringFromGUID2(i R0, w .s, i ${NSIS_MAX_STRLEN})'
System::Free $R0