Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Struggling w/ WriteRegStr & GUID entry (http://forums.winamp.com/showthread.php?t=375968)

zewari 20th March 2014 21:45

Struggling w/ WriteRegStr & GUID entry
 
Hey folks, new to NSIS here.... I've been banging my head against the wall trying to figure out why this isn't working. I have a variable defined for my GUID:

code:
Var /GLOBAL CLSID
StrCpy $CLSID "\{1368ABFA-B1AB-49DB-9CB8-2C231D54B1BF\}"



Writing the variable into a registry value data works great:

code:
WriteRegStr HKCR "Something.Otherthing\CLSID" "" "$CLSID"


Writing the variable as a registry key doesn't work at all:

code:
WriteRegStr HKCR "CLSID\$CLSID" "" "GPLASCustomTools.LASCustomToolsFunctionFactory"


Is it the curly brackets? I've tried using escape characters but it doesn't help. What am I missing?:igor:

Anders 20th March 2014 21:58

Are you running as administrator (elevated with UAC)?

The only thing you have to escape in NSIS is $.

You current code also ends up with \\ because CLSID\$CLSID will expand to CLSID\\{1368ABFA-B1AB-49DB-9CB8-2C231D54B1BF\}.

To really debug this problem you can use Process Monitor...

jpderuiter 20th March 2014 22:05

Why do you use the backslash in the CLSID?
No need for escape characters or something (backslash alone isn't an escape character anyway...)

zewari 20th March 2014 22:08

Oh, those extra back slashes were from my frustrated attempts at finding a solution. I am running as an admin and have them removed at the moment, but no luck. I have no problem creating those keys from a batch file, just can't seem to do it through NSIS. Am I overlooking something? Does \{ mean something in this scripting language?

Anders 20th March 2014 22:34

Quote:

Var /GLOBAL CLSID
StrCpy $CLSID "{4D85F58F-51C6-4daf-9334-148CA24C4F36}"
WriteRegStr HKCU "Software\Classes\CLSID\$CLSID" "" "GPLASCustomTools.LASCustomToolsFunctionFactory"
Works fine for me (Note that I used HKCU so I did not have to elevate and the key is actually written under Software\Classes\Wow6432Node\CLSID\{4662daa3-d393-11d0-9a56-00c04fb68bf7} on a 64 bit system)

zewari 20th March 2014 22:54

Ah ok... I see it under the Wow6432node hive. SetRegView 64 gave me the desired outcome... I wonder why some of it was writing to the expected location and the rest of it wasn't. Anyway thanks for your tip!

Anders 21st March 2014 00:09

Some things under HKCR is reflected in both views and others only exist where you write them. This is of course related to compatibility and has changed from XPx64 to Vista and Vista to 7. See MSDN for more information...


All times are GMT. The time now is 17:17.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.