cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
retzcat
Level 6

InstallScript Set ENV

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
Labels (1)
0 Kudos
(4) Replies
RobertDickau
Flexera Alumni

If you're asking about an InstallScript project, please see InstallShield KB articles Q107382 and Q100090; I believe InstallSite has an InstallScript sample, too. For MSI, there's an Environment Variables view you can use.
0 Kudos
retzcat
Level 6

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?
0 Kudos
retzcat
Level 6

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
0 Kudos
brianthegood
Level 6

You have the correct formula
0 Kudos