Problem: Setting Environment Variable - Advanced Installer Community
debian69
Posts: 9
Joined: Mon May 02, 2011 3:57 pm

Problem: Setting Environment Variable

Hi Folks!
What do i want to do?
I try to set an Environment Variable "LocalData" to the value of a Property, I control with the help of a Custom Action. The Custom Action sets the value of the property to "C:\ProgramData" if the condition VersionNT >= "600" is true or to "C:\Daten" if the condition VersionNT < "600" is true.

Where is my problem?
The setup is working with one exception: Advanced Installer adds ervery time a Backslash ("\") at the end of the Path. How can I avoid this? The Environment should be for example "C:\ProgramData", not "C:\ProgramData\".

Thanks for your support.
Thorsten
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Problem: Setting Environment Variable

Hi Thorsten,

Windows Installer always add an extra slash at the end of a folder path (not a file path) as described on the Windows Installer Folders page.
To remove it you need to create a custom action. You can follow our removing extra backslash user guide FAQ.

Please let us know if that helped.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
debian69
Posts: 9
Joined: Mon May 02, 2011 3:57 pm

Re: Problem: Setting Environment Variable

Hi Dan,
thanks for your quick help - problem solved!

Best regards,
Thorsten
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Problem: Setting Environment Variable

You're welcome Thorsten,

I'm glad you got this working. If you have other questions, please let us know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”