Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Need help


6 replies to this topic

Angelica

Angelica
  • Members
  • 8 posts

Posted 21 March 2002 - 01:46

Hi,

Pl. help.

I want to setup a NEW Environment variable
JAVA_HOME = {TARGETDIR}\jre

and NOT adding to the existing PATH env. variable.

{TARGETDIR} is already specified in my setup script.

Is it possible? If so, pl. help me with sample code.
I'm using IS 6.2

Tx,
Angel....:-)

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 21 March 2002 - 03:14

The source for system variables is stored in the following registry location:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment

You can therefore add a string value to here containing the necessary information.

However, you'll need to send a broadcast message to note the change.  The code to do so would be the following:

sEnv = "Environment";
pEnv = &sEnv;
sendMessage (HWND_BROADCAST, WM_SETTINGCHANGE, 0, pEnv);

where

Global Declarations:
#define WM_SETTINGCHANGE 0x001A
#define HWND_BROADCAST 0xffff

Local Declaration:
POINTER pEnv

Hope it helps.
user posted image

Angelica

Angelica
  • Members
  • 8 posts

Posted 21 March 2002 - 23:49

Hi,

Thanks  Taco...  for your help.

I put in the appropriate code, variables declaration etc.
Ran the setup in debug mode and noticed the setup passing thru my lines of code and creating the path, but somehow, I am unable to see it in my list of environment variables.
I have permissions to the registry.

Am I missing something?

Any help is appreciated.

Thanks,
Angel:-)

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 22 March 2002 - 00:19

Humm, well first off, if you go to that area of the registry, do you see your newly added information.  If not, then there's problem number one.

In another post someone mentioned that the IS debugger wouldn't recognize the broadcast, but that wouldn't affect whether or not the item was listed in the environment variables.

For a lack of a better idea, you should also try rebooting and see if it shows up then.

Let me know.  Since I've only updated the path before, I'm not sure if I'll be able to fix it, but you're definitely on the right track.
user posted image

Angelica

Angelica
  • Members
  • 8 posts

Posted 22 March 2002 - 00:41

Actually, the problem is:

When I run my setup.exe, my variable does appear in the environment variables a ONE-time.
Upon uninstall and re-install, it never sets again.

This is a clueless situation for me.

Any thoughts?


Angel:-)

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 22 March 2002 - 16:57

In that case, the uninstall process may be putting that area of the registry in a bad state.  You should compare it to a good copy and see if anything pops out.

You may also want to disable logging for that section of code and afterwards re-enabled it.  That way it's not included in the uninstall routines.  The code would go something like this:

Disable(LOGGING);
<Current Env. Var. Code>
Enable(LOGGING);
user posted image

Angelica

Angelica
  • Members
  • 8 posts

Posted 22 March 2002 - 22:01

Hi:

Thanks Taco:  for your suggestions.

Thanks Again.

Have a Good Weekend everyone!

Angel :-)