Manipulate Installation Path based on Search Result - 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!

VI.Tobias
Posts: 2
Joined: Wed Jun 23, 2010 9:22 am

Manipulate Installation Path based on Search Result

Hi there,

unfortunately I didn't found a thread that solves my problem. Can I manipulate the result from an search result?
Because I want to read a folder-path from the registry and then navigate in the found path one folder up and add a custom path to that result (as installation path).

I already tried [SearchResult]..\[ProductName]. But when I run it the setup tell me that there is no folder "..".

Do I have to use a custom action to manipulate this little thing? If yes: does anybody have an example how to achieve such a scenario? I think I have to use vbs best? Normally I develop with C# and .NET...

Thanks for your help!
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Manipulate Installation Path based on Search Result

Hello Tobias and welcome to Advanced Installer Forums,

Since you are new, I highly recommend you read our tutorials for a better understanding of how to use Advanced Installer to efficiently deploy your products.
This will also help you better understand support team's suggestions now and in the future. The simple and professional tutorials are especially important.

The launch conditions tutorial contains details on how to create a file search/folder search.

You do not need to use a custom action for this.
From what you describe, the SearchResult property appears to be empty. This means the search failed. You can use the Test button to test if your search is configured properly. Make sure you configure the depth of the search, a depth 5 should be ok.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
VI.Tobias
Posts: 2
Joined: Wed Jun 23, 2010 9:22 am

Re: Manipulate Installation Path based on Search Result

Hello Gabriel,

thanks for your reply. Unfortunately the regsitry search result isn't empty (I can install fine in [SearchResult][ProductName] but when I try [SearchResult]..\[ProductName] an error ocurrs). And I already added a custom launch condition for that property to cancel installation if it won't exist.

OK here an example what I mean:
In the registry I'm looking for a path and find it: C:\Program Files\Manufaturer\ProductXYZ
For my current installation I want to extract the parent folder path of the found path (--> C:\Program Files\Manufacturer) and add my own product name... so the installation path should looks like: C:\Program Files\Manufacturer\MyApplication
To achieve this I need to navigate up in the found path from registry search.

How can I do that?

Thanks!
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Manipulate Installation Path based on Search Result

Hello Tobias,

Unfortunately there is no direct support for achieving this. You will have to use a Custom Action to trim the path, then pass it back to the installer through a property.
You can consult MSDN on writing custom action scripts to better understand how to pass data back and forth between the installer and your script.
You can also use a C++ DLL, here is an article from our user guide that has an example on how to access public properties from a DLL.

Regards,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”