relishpl
Posts: 1
Joined: Mon Sep 08, 2014 10:49 pm

launch application using updated PATH var

I need to launch the application I've just installed at the end of the installation.

However, the application relies on being launched in an environment which has the PATH set.
I am using the environment variables option in Advanced Installer to append the directory I need to the PATH environment variable.

The problem is that the post-install launch of the application is a child process of the MSI Installer process, and only gets its original environment, that is, minus the added-to PATH.

This one is driving me nuts.

Any child process spawned just inherits its parent's environment, and does not pick up a newly modified or set env var. Only a "top-level" launch of a new process will get the newly set env vars.

I'd like to request that Advanced Installer add a way of doing a slightly deferred action (but which is not post-reboot, because I don't need a reboot), where somehow the deferred action is not launched as a sub-process of the MSI installer process. Could something be scheduled using the Windows task scheduler (for like 2 seconds in the future or similar).

By the way, I know that I could use various shell commands in my application launch script to SET PATH, SETX PATH, or SETLOCAL SET PATH etc. but none of those actually seem to affect the currently executing command interpreter and its executable-search path.
Eusebiu
Posts: 4959
Joined: Wed Nov 14, 2012 2:04 pm

Re: launch application using updated PATH var

Hi and welcome to Advanced Installer forums.

Please keep in mind that in order to launch the installed application at the end of the installation, you can simply go on the "ExitDialog" from the Dialogs page or you can use Windows Installer properties.

Indeed, using environment variables you encounter the Operating System limitation that you mentioned. The environment variables are written to the System, but they are not refreshed by Windows yet and the application cannot see them.

In order to go around this problem, you can take a look on the SendMessageTimeout function that you can call in a custom action to be able to use the recently written environment variables. However, the refreshed environment variables will be available only in that custom action, so the application should be launched from the same custom action in order to see them.

You can take a look on the Environment Variable thread which debates a similar problem.

Let us know if this helped, otherwise give us more details about your scenario.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
wastan
Posts: 1
Joined: Fri Sep 19, 2014 8:31 am

Re: launch application using updated PATH var

ny child process spawned just inherits its parent's environment, and does not pick up a newly modified or set env var. Only a "top-level" launch of a new process will get the newly set env vars. :geek: :ugeek: :twisted: :evil:



____________
You can try out our pass4sure and latest Mount Washington College to get high flying success in final Avaya exams.
Last edited by wastan on Wed Oct 01, 2014 7:55 am, edited 1 time in total.
Eusebiu
Posts: 4959
Joined: Wed Nov 14, 2012 2:04 pm

Re: launch application using updated PATH var

Hi and welcome to Advanced Installer forums.

Please take a look on the Environment Variables thread which debates the same problem, so you can find more details about it.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Feature Requests”