cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
idblew
Level 4

Updating PATH For Running Application

Hi,

I have a requirement to "refresh" currently running applications with the updated PATH environment variable following a Simple MSI installation.

I'm using a C DLL for my custom actions and have tried Commit, Deferred and Immediate execution.

The application in question is IE7, and I've tried various Windows API methods such as:

SendMessage(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)"Environment")

and

SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)"Environment", SMTO_NORMAL, 1000, 0)

but with no luck! I've even tried enumerating the top-level windows using:

EnumChildWindows(0, callbackFunction, 0)

Has anyone got this to successfully work? How? :confused:

Thanks for any help offered! 😄
Labels (1)
0 Kudos
(4) Replies
RobertDickau
Flexera Alumni

I haven't tried it myself, but does the SetEnvironmentVariable API function work in this case? Please see [thread=146835]this long thread[/thread] for a discussion of the issues...
0 Kudos
idblew
Level 4

Hi Robert,

Not sure that this will do it, perhaps a bit more background info might be useful.


  • I've got a web page that requires a series of ActiveX controls.
  • When a user accesses the page for the 1st time the page automatically downloads a CAB file which contains a simple MSI installation.
  • As part of the installation, the system PATH is updated however IE does not recognise this new PATH until I close down IE and restart it.


I did write a CA that successfully refreshed the PATH for IE some time ago, unfortunately (or is that stupidly 😮 ) I lost the code! :eek:
0 Kudos
m_rudolph
Level 6

Would simply refreshing the webpage do the trick? Like replicating an F5 keypress?
0 Kudos
idblew
Level 4

Unfortunately not, the PATH is tied to the process not the page.
0 Kudos