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

Setting Path Environment for multiple users?


6 replies to this topic

Anthony Hughes

Anthony Hughes
  • Members
  • 30 posts

Posted 16 August 2001 - 10:30

I'm trying to add a shared dll folder to the path when I install my program -
I've tried adding a path entry to the Environment Table with the value
"[~];[MYFOLDER] and this works fine for the user who installed the app, but
when I go in as a limited user, the path is not available.

This approach adds the entry to the HKCU\Environment key.

I've also tried using *path as the name - the help says something about the *
being for system environment settings. This adds it into the
HKLM\ControlSet001\Control\Session manager\Environment\Path value which should
be available to all users, but the app still can't find the dll for the
limited user.

Any clues?

regards
Anthony


Dave I

Dave I
  • Members
  • 195 posts

Posted 16 August 2001 - 11:45

Anthony,
               I had a similar problem unless I rebooted the PC then applications where not being notified of the change to the Environment PATH variable.

Firstly here are the entries for the Environment table:

Environment: Path
Name:             =-*PATH
Value:              [~];[INSTALLDIR]

(See MSI help on Environment table for the symbols)

To notify apps that you have changed the Environment variable I used a deferred CA with following API call:

#define HWND_BROADCAST 0xFFFF  
#define WM_WININICHANGE  0x001A  
POINTER ptr;

SendMessage (HWND_BROADCAST , WM_WININICHANGE , 0 , ptr);

Hope this helps,
DAve


Anthony Hughes

Anthony Hughes
  • Members
  • 30 posts

Posted 16 August 2001 - 14:19

Thanks Dave - looks like just what I need but I've a a couple of questions

1) where in the sequence do you call this CA

2) should ptr be set to something before passing it on?

Cheers
Ant


Dave I

Dave I
  • Members
  • 195 posts

Posted 17 August 2001 - 08:12

As long as your CA is executed after "RegisterEnvironmentStrings" and  "InstallFiles" it should be OK, mine is placed just before InstallServices (as good a place as anywhere.)

I'm passing ptr uninitialised just as you see it.  I'm not too hot on the WinAPI, there is probably a rule to say I should be initialising variables but I stopped thinking when I found out it worked.


Perotin

Perotin
  • Full Members
  • 407 posts

Posted 17 August 2001 - 09:49

I've been using this SendMessage in IS5 scripts and this should be passed as pointer:

#define HWND_BROADCAST      0xffff
#define WM_SETTINGCHANGE    0x001A

STRING s;
POINTER p;

s = "Environment";
p = &s;
SendMessage (HWND_BROADCAST, WM_SETTINGCHANGE, 0, p );

btw: this is only for NT/2ooo ...

(Edited by Perotin at 10:50 am on Aug. 17, 2001)


Anthony Hughes

Anthony Hughes
  • Members
  • 30 posts

Posted 17 August 2001 - 15:55

Thanks guys,

I still can't seem to get it to work though - not for a user who is currently logged in whilst the admin installs the app (XP fast user switching) but this may be an XP issue more than anything else now.

Anthony