View Full Version : Trying to get ProductID value from Windows Registry
howardtlcc
07-09-2009, 02:57 PM
I am evaluating Setup Factory. We need to get the ProductID value from the Windows registry for use in our registration routines. The following code works fine in Windows 32 but not for Vista 64:
winreg = Registry.GetValue(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", "ProductId", true);
What is the workaround to pull in this value on Win 64 systems?
thanks,
Howard
jassing
07-10-2009, 06:07 AM
This is a basic issue of x86 applications on x64 OS's. There are some things the applications imply does not have access to; even if you disable syswow redirection.
Search the forums for "Registry64" -- I uploaded a script file that is a near drop in replacement for the built in Registry. object.
howardtlcc
07-10-2009, 07:58 AM
I will give that a try. Our employee with the 64 bit test system is off today...
thanks!
Howard
howardtlcc
07-13-2009, 09:28 AM
On a 64bit system I get an error running the script (Registry64).
It is from the line:
cParam = AddBS( cParam ) .. cLine;
The error message is:
on startup, line 291, attempt to call global 'addBS' (a nil value)
I assume it can't find the addBS function? Am I missing a script library or something?
thanks,
Howard
jassing
07-13-2009, 10:32 AM
Bummer, guess no one else has used it.
function AddBS( cPath )
String.TrimRight(cPath,nil);
if String.Length(cPath) > 0 and String.Right(cPath,1) ~= "\\" then
cPath = cPath .. "\\"
end
return cPath
end
howardtlcc
07-13-2009, 10:53 AM
I guess I am the tester than. That function worked.
Howard
jassing
07-13-2009, 11:42 AM
That "AddBS()" function is part of a larger "toolkit" library I draw from.
The Registry64.lua has seen some minor changes; but basically is used by several very well tested installers and used world wide.
howardtlcc
07-13-2009, 11:57 AM
I appreciate your posting the registry64 code. I am evaluating Setup Factory and one of our requirements is to read/write from the registry to get the ProductID from the Windows install. Overall, I like what I see with the product! Much nicer to use than the Java based Installshield MultiPlatform I used before. Plus, I don't have to bundle a JVM with our install.
Howard
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.