Setting system environment variables - Not working with services.
I'm currently working on Win2k machines - using a InstallScript MSI project.
I am setting [INSTALLDIR] into the path environment via the appropriate registry key, and then using:
#define WM_WININICHANGE 0x001A
#define HWND_BROADCAST 0xffff
svEnv = "Environment";
pEnv = &svEnv;
SendMessage (HWND_BROADCAST, WM_WININICHANGE, 0, pEnv );
to refresh the environment.
I've verified that this works for the explorer shell, and any apps launched from the desktop. Where it is not working though, is applications launched from the services manager - This is the problem.
I need to be able to start my service imediately after install - without having to reboot to update the environment/path.
Anyone have any ideas?
Did you get to know to solution of the problem. Actually i am struggling with the same problem for more than past 10 days. I am updaing the PATH environment variable, which needs to be there on target machine prior to install some of the application related services. PATH gets updated very well but somehow services are not getting installed. I have tried using SendMessage but with no success. I want to refresh the environment variable but without reboot.
Thanks in advance.
I am working on InstallShield 11.5 windows.