We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

Lee Bornstein
Posts: 23
Joined: Sat Feb 11, 2006 5:44 am
Location: Las Vegas, NV
Contact: Website

Environment Variable "PATH"

GiGi:

Need help again....

I'm using the Environment Variable in my installer project to 'prepend' a path to the existing system search path.

My Exit Dialog launches my application upon exit and at that time the search path, although it has been updated, does not allow Windows to find my files via the search path. If I abort my application and restart, (Win XP) then the new path works.

While Exit Dialog is displayed I can run SET PATH in a DOS window and see newly defined path on my WinXP machine but it's not functional.

On my Vista machine the SET PATH does not display the new path after instalation. If I go to Control Panel - System/Advanced and look at Environemt variable for PATH it does show new value. If I save it at that point and look at SET PATH again the new value is displayed.

Is there a way to tell the system that the path has changed and to apply changes immediately? Otherwise I'll have to re-boot inorder for software to work properly.

Are the environment variables processed before Custom Actions (external Programs)?

Any suggestions? Am I missing a step?

Lee
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi Lee,
While Exit Dialog is displayed I can run SET PATH in a DOS window and see newly defined path on my WinXP machine but it's not functional.
This is because the CMD window that is already opened is not updated. Open the CMD window after the "ExitDlg" and you will see that the "Path" variable is updated.
Are the environment variables processed before Custom Actions (external Programs)?
Environment variables are set during the "WriteEnvironmentStrings" standard action. So any custom action that depends on the environment variable needs to be scheduled after this standard action.

Let me know if you encounter any problems.

Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
Lee Bornstein
Posts: 23
Joined: Sat Feb 11, 2006 5:44 am
Location: Las Vegas, NV
Contact: Website

GiGi:

where do I "Schedule" my custom action so it occurs after setting PATH?

My custom action is in the COMMIT section.

Help file says:
Additionally, they can be scheduled to be executed after any of the Standard Actions. These are grouped in three groups: before Initialization, before File Installation and before Finalization.
Can't seem to find how to "schedule" my Action following the "WriteEnvironmentStrings" standard action
Can you point me in the right direction?

Lee
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi Lee,

I don't understand why you want to set the installation folder to the system "Path". Please give me more details.

From your previous post I see that you launch your application via "Finish" dialog ("Finish Actions" tab). From what I know an application first searches for files in the directory from which the application loaded, you don't need to set the installation folder to the system "Path".

Regards,
Gigi
_____________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
Lee Bornstein
Posts: 23
Joined: Sat Feb 11, 2006 5:44 am
Location: Las Vegas, NV
Contact: Website

GiGi:
My installer project installs a Database engine and MyApplication.

Database Engine is in C:\pvsw and MyApp is in program folder wherever user decides to put it.

During the install I prepend the c:\pvsw\bin to Environment Path Variable,
I then start the database engine using Commit Custom Action WindowsVolume\PVSW\bin\w3dbsmgr.exe.

My Exit Dialog then launches my application APPDIR\Trims.exe

At that point, TRIMS.exe makes calls to w3dbsmgr that fail because it cannot be found in the current Path.

Rebooting will allow TRIMS.exe to find w3dbsmgr via path.

I would like to be able to run this install without rebooting.

Previously you said :
Environment variables are set during the "WriteEnvironmentStrings" standard action. So any custom action that depends on the environment variable needs to be scheduled after this standard action.
And I asked:
Can't seem to find how to "schedule" my Action following the "WriteEnvironmentStrings" standard action
Can you point me in the right direction?
Bottom line is..... how do I get New Path to be active before launching MYAPP other than Reboot?

Lee
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Oops, I was wrong. Environment variables that are set during installation are available only after installation. You can read more about this here:
http://msdn2.microsoft.com/en-us/library/aa372883.aspx

So a reboot is required.

Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Common Problems”