PDA

View Full Version : InstallScript Set ENV



retzcat
12-03-2008, 06:54 PM
I need to set an environment var for a db home.. what is the easiest way to do this? I've tried a couple things and they aren't working..
Thanks

RobertDickau
12-03-2008, 07:20 PM
If you're asking about an InstallScript project, please see InstallShield KB articles Q107382 and Q100090; I believe InstallSite (www.installsite.org) has an InstallScript sample, too. For MSI, there's an Environment Variables view you can use.

retzcat
12-04-2008, 01:06 PM
I found the script example but HWND_BROADCAST does not work with Windows XP...
function Exc_RefreshEnvironment()
HWND hWnd;
LONG lParam;
LONG wParam;
SHORT shMsg;
STRING szParam;
begin

hWnd = HWND_BROADCAST;
shMsg = WM_SETTINGCHANGE;
wParam = 0;
szParam = "Environment";
lParam = &szParam;

SendMessage(hWnd, shMsg, wParam, lParam);
end;

Any idea what else i could use?

retzcat
12-04-2008, 03:26 PM
OK - my software engineer tells me what I need to create is the following..

SEQUIOA_HOME C:\Program\DB\Sequoia

So, I know I need to create a value w/value data under
HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment.

I'm setting the following
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);

I';m just not sure which REGDB function is the best to create the value, since I'm not creating a true KEY...
Would I want to use
RegDBSetKeyValueEx(szPath,szKey,REGDB_STRING_EXPAND,szValue,-1);
??
Thanks

brianthegood
12-08-2008, 03:27 PM
You have the correct formula