Application path problem - Advanced Installer Community

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!

XXL66
Posts: 17
Joined: Mon Apr 28, 2008 3:00 pm

Application path problem

Hello,

I was previously using IS installation software and this software didn't include the last "\" of the installation path.
Now when using AI i also write the path using APPDIR variable to the registry. But AI add's a \ to the the path. f.e. "c:\program files\myapp\"

I don't want this last slash how can i remove the last slash before writing this APPDIR to the registry.

Leaving the slash is not an option because everywhere i refer to this path in my code i would have to change.

thank you.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Application path problem

Hi,

Please note that this backslash is added automatically by the Path Edit control used on the "FolderDlg" dialog. You can remove it after the APPDIR property is set by using a custom action:
- you can use a public property (MY_APPDIR) to store the path which doesn't end with the "\" character
- in the Custom Actions page, under "InstallExecuteSequence" you show the "CostFinalize" standard action by using the "Show Standard Action" button on the toolbar
- under "CostFinalize" you create a "Script Inline" custom action which looks like this:

Source Type: Visual Basic Script (*.vbs)
Script Text: appdir = Session.Property("APPDIR") : Session.Property("MY_APPDIR") = Left(appdir, Len(appdir) - 1)

Let me know if you encounter any problems.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
woody
Posts: 9
Joined: Thu Nov 19, 2009 3:53 pm

Re: Application path problem

How does it get it out of the dialog from which the person or persons installing the software see's. I need the backslash to be removed out of the dialog. Can this be done?
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Application path problem

Hello,

I am not sure I understand your question. Simply follow the instructions cosmin wrote in the above post. Store the MY_APPDIR property in the registry, it contains the path without the trailing backslash.
You can follow our tutorials to better understand how an installer works.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”