removing the "\" charachter from the path - 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!

abedb
Posts: 6
Joined: Wed Oct 24, 2007 4:01 pm

removing the "\" charachter from the path

hello all

I'm using the [APPDIR] property inorder to retrieve the path for the installed application, later on I'm storing this path at the registry.

My problem is that the [APPDIR] property returns the full path along with one extra charachter that crashes my software.. and that is the last charachter of the path.. the "\" character.

Is there any way to tell the advenced installer to ignore this slash? can I delete it by myself?

please help..
it's really urgent

thanks in advance,
Abed
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

This can be done by using a custom action and a public property. Here are the steps:

- you will use a public property (MY_APPDIR) to store the path which doesn't end with the "\" character
- in the "Registry" page you create a registry value by using [MY_APPDIR] in the "Data" field of that value
- 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:

Code: Select all

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
abedb
Posts: 6
Joined: Wed Oct 24, 2007 4:01 pm

exactly what I wanted

Hi Cosmin

Your answer couldn't be more exact and clear :)

thank you very much for your help

Abed

Return to “Common Problems”