This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Can't work with REGDB_STRING_MULTI in IS 2011
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 17, 2011
05:48 PM
Can't work with REGDB_STRING_MULTI in IS 2011
Hello!
Since upgrade from 2009 to 2011 I've got trouble with writing multistring values to registry. Before RegDBSetKeyValueEx string svValues looks great, with nulls at their places (I checked it by printing every byte). But RegDBSetKeyValueEx function writes bad data in registry.
Please check my example below
Registry before
[PHP]
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\\Software\\Example]
"RootDevice"=hex(7):7b,00,46,00,39,00,44,00,35,00,31,00,42,00,34,00,39,00,2d,\
00,39,00,32,00,34,00,37,00,2d,00,34,00,31,00,45,00,32,00,2d,00,41,00,35,00,\
37,00,37,00,2d,00,35,00,32,00,45,00,33,00,35,00,44,00,46,00,45,00,45,00,32,\
00,38,00,31,00,7d,00,00,00,7b,00,44,00,34,00,46,00,32,00,41,00,37,00,39,00,\
39,00,2d,00,35,00,41,00,46,00,39,00,2d,00,34,00,41,00,44,00,34,00,2d,00,39,\
00,44,00,36,00,38,00,2d,00,38,00,31,00,31,00,34,00,45,00,39,00,46,00,44,00,\
36,00,45,00,45,00,35,00,7d,00,00,00,7b,00,43,00,43,00,41,00,33,00,38,00,35,\
00,31,00,46,00,2d,00,34,00,34,00,45,00,46,00,2d,00,34,00,43,00,35,00,44,00,\
2d,00,42,00,39,00,33,00,37,00,2d,00,39,00,45,00,41,00,43,00,37,00,45,00,41,\
00,41,00,38,00,32,00,35,00,46,00,7d,00,00,00,00,00
[/PHP]
InstallScript
[PHP]
STRING svValues, svVal;
NUMBER nvType, nvSize, lRes;
LIST listVals;
begin
szKey = "Software\\Example";
szName = "RootDevice";
szRemoveValue = "{D4F2A799-5AF9-4AD4-9D68-8114E9FD6EE5}";
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
if RegDBGetKeyValueEx ( szKey, szName, nvType, svValues, nvSize) < 0 then
return FALSE;
endif;
listVals = ListCreate(STRINGLIST);
StrGetTokens(listVals,svValues,"");
lRes = ListGetFirstString(listVals, svVal);
while (lRes != END_OF_LIST)
if svVal = szRemoveValue then
ListDeleteString(listVals);
endif;
lRes = ListGetNextString (listVals, svVal);
endwhile;
svValues = "";
//write new values
StrPutTokens(listVals,svValues,"",TRUE);
RegDBSetKeyValueEx ( szKey, szName, nvType, svValues, SizeOf(svValues));
end;
[/PHP]
Registry after
[PHP]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Example]
"RootDevice"=hex(7):7b,00,46,00,39,00,44,00,35,00,31,00,42,00,34,00,39,00,2d,\
00,39,00,32,00,34,00,37,00,2d,00,34,00,31,00,45,00,32,00,2d,00,41,00,35,00,\
37,00,37,00,2d,00,35,00,32,00,45,00,33,00,35,00,44,00,46,00,45,00,45,00,32,\
00,38,00,31,00,7d,00,00,00,79,00,3d,00,25,00,6c,00,64,00,09,00,52,00,65,00,\
73,00,6f,00,6c,00,76,00,65,00,45,00,6d,00,62,00,65,00,64,00,64,00,65,00,64,\
00,3d,00,25,00,6c,00,64,00,00,00,36,00,37,00,43,00,41,00,36,00,45,00,41,00,\
41,00,39,00,42,00,34,00,7d,00,5c,00,44,00,00,00[/PHP]
You will see that new registry value is incorrect and contains strange things like "y=%ld ResolveEmbedded=%ld".
Thanks in advance
Since upgrade from 2009 to 2011 I've got trouble with writing multistring values to registry. Before RegDBSetKeyValueEx string svValues looks great, with nulls at their places (I checked it by printing every byte). But RegDBSetKeyValueEx function writes bad data in registry.
Please check my example below
Registry before
[PHP]
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\\Software\\Example]
"RootDevice"=hex(7):7b,00,46,00,39,00,44,00,35,00,31,00,42,00,34,00,39,00,2d,\
00,39,00,32,00,34,00,37,00,2d,00,34,00,31,00,45,00,32,00,2d,00,41,00,35,00,\
37,00,37,00,2d,00,35,00,32,00,45,00,33,00,35,00,44,00,46,00,45,00,45,00,32,\
00,38,00,31,00,7d,00,00,00,7b,00,44,00,34,00,46,00,32,00,41,00,37,00,39,00,\
39,00,2d,00,35,00,41,00,46,00,39,00,2d,00,34,00,41,00,44,00,34,00,2d,00,39,\
00,44,00,36,00,38,00,2d,00,38,00,31,00,31,00,34,00,45,00,39,00,46,00,44,00,\
36,00,45,00,45,00,35,00,7d,00,00,00,7b,00,43,00,43,00,41,00,33,00,38,00,35,\
00,31,00,46,00,2d,00,34,00,34,00,45,00,46,00,2d,00,34,00,43,00,35,00,44,00,\
2d,00,42,00,39,00,33,00,37,00,2d,00,39,00,45,00,41,00,43,00,37,00,45,00,41,\
00,41,00,38,00,32,00,35,00,46,00,7d,00,00,00,00,00
[/PHP]
InstallScript
[PHP]
STRING svValues, svVal;
NUMBER nvType, nvSize, lRes;
LIST listVals;
begin
szKey = "Software\\Example";
szName = "RootDevice";
szRemoveValue = "{D4F2A799-5AF9-4AD4-9D68-8114E9FD6EE5}";
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
if RegDBGetKeyValueEx ( szKey, szName, nvType, svValues, nvSize) < 0 then
return FALSE;
endif;
listVals = ListCreate(STRINGLIST);
StrGetTokens(listVals,svValues,"");
lRes = ListGetFirstString(listVals, svVal);
while (lRes != END_OF_LIST)
if svVal = szRemoveValue then
ListDeleteString(listVals);
endif;
lRes = ListGetNextString (listVals, svVal);
endwhile;
svValues = "";
//write new values
StrPutTokens(listVals,svValues,"",TRUE);
RegDBSetKeyValueEx ( szKey, szName, nvType, svValues, SizeOf(svValues));
end;
[/PHP]
Registry after
[PHP]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Example]
"RootDevice"=hex(7):7b,00,46,00,39,00,44,00,35,00,31,00,42,00,34,00,39,00,2d,\
00,39,00,32,00,34,00,37,00,2d,00,34,00,31,00,45,00,32,00,2d,00,41,00,35,00,\
37,00,37,00,2d,00,35,00,32,00,45,00,33,00,35,00,44,00,46,00,45,00,45,00,32,\
00,38,00,31,00,7d,00,00,00,79,00,3d,00,25,00,6c,00,64,00,09,00,52,00,65,00,\
73,00,6f,00,6c,00,76,00,65,00,45,00,6d,00,62,00,65,00,64,00,64,00,65,00,64,\
00,3d,00,25,00,6c,00,64,00,00,00,36,00,37,00,43,00,41,00,36,00,45,00,41,00,\
41,00,39,00,42,00,34,00,7d,00,5c,00,44,00,00,00[/PHP]
You will see that new registry value is incorrect and contains strange things like "y=%ld ResolveEmbedded=%ld".
Thanks in advance
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 18, 2011
02:01 AM
I've found a hotfix and it seems to work fine!
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 10, 2011
09:25 AM
Can you elaborate on the HotFix! Was the HotFix from InstallShield? Which one?
![](/skins/images/A5EADE085F77DE82FB3B14D6B307AE6A/responsive_peak/images/icon_anonymous_message.png)