View Full Version : Registry.SetValue not working (Windows 98 & ME)
markczajka
07-01-2005, 08:30 AM
We do a lot of development here which means we have to support older platforms, unfortunately. Registry.SetValue is not working in Windows 98 and Windows ME, at all (I havent' tested NT, but 2000 & XP are fine). SF 7.0.3.0
%Customer% is a session variable set to: Software\\ABYC_2005_test
Debug.SetTraceMode(true);
Debug.ShowWindow(true);
AcrobatReader="C:\\Program Files\\Adobe\\Acrobat 5.0\\Reader\\AcroRd32.exe";
Registry.SetValue(HKEY_CURRENT_USER, SessionVar.Expand("%Customer%"), "AcrobatExe", AcrobatReader, REG_SZ);
Error=Application.GetLastError();
Debug.Print("Error code output to debug window: "..Error);
result = Registry.GetValue(HKEY_CURRENT_USER, SessionVar.Expand("%Customer%"), "AcrobatExe", true);
Debug.Print("Registry entry: "..result);
markczajka
07-01-2005, 09:28 AM
Registry.CreateKey doesn't work either. It's not a permission problem under Win 98, as I can go in and manually create the key. All of the registry actions need to be looked at.
csd214
07-01-2005, 10:15 AM
I tried a 7.0.2.0 installer on my old Win98 machine (4.10.2222A). Registry.SetValue worked as it should; both with existing key/value and with non-existing key/value.
What error number do you get?
markczajka
07-01-2005, 12:30 PM
error 1600 (when I try to create key) and 1608 (when I try to set value)
Windows 98 ver. 4.10.222A SE - Setup Factory 7.0.3.0
Tested on Windows NT (4.00.1381) - I can set values but I can't get them - I get an error.
I am running these OS's on Vmware, but I never had problems with this with SF6. All logins are administrator.
No problems on Windows 2000 & XP.
I tried a 7.0.2.0 installer on my old Win98 machine (4.10.2222A). Registry.SetValue worked as it should; both with existing key/value and with non-existing key/value.
What error number do you get?
markczajka
07-01-2005, 02:31 PM
I've found a workaround, but the problem appears to be when I use SessionVar.Expand("%Customer%") within a Registry action, it's not working for these older operating systems. It doesn't work if if set this to a local variable then pass the local variable in either. It only works when I hard code the value "Software\\ABYC_2005_test" into the action.
One other thing to watch out for is backslashes in Windows 98. Lets say you had a script like this:
MyFolder = "C:\\Folder\\";
MyFile = "\\File.ext";
And you did this:
File.Open(MyFolder..MyFile, ect ect);
Then this string would actually expand at runtime to:
C:\\Folder\\\\File.ext";
Which when you remove the double backslashes is:
C:\Folder\\File.ext";
NT based systems will simply ignore the extra backslash and the action would succeed. But a Windows 98 machine will error out on this because it does not recognize the \\ part.
Adam Kapilik
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.