milanche
Posts: 14
Joined: Mon Sep 10, 2012 5:41 pm

Search for local file locations, and populate combobox

Hello guys,

i was thinking is it possible to do next.

I'm installing plugins for one application. And i have one dialog box where i'm asking user does he have that application installed.
If he don't have it, i'm installing complete application + plugins.
If he have it, he will have button to search for existing installs.
And because many users have more instances of this application installed (trading software), can i somehow search for app executable filename on local drive, and get directory path from every found file, then populate result directories to combobox?
So user can choose one of existing install folders.

Thank you.
milanche
Posts: 14
Joined: Mon Sep 10, 2012 5:41 pm

Re: Search for local file locations, and populate combobox

Damn, i thought that someone has a solution to my problem, and when i opened topic i saw this. ;)
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Search for local file locations, and populate combobox

Hello,

In order to achieve what you want you can add file searches on our "Search" page. Then you can add a custom action which will "Find the folder which contains a file" and will store the folder path in a property (e.g. PARENT_FOLDER).

Also, you can take a look on the following articles:
Working with Windows Installer ComboBox and ListBox controls
How do I show a custom feature selection dialog?

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
milanche
Posts: 14
Joined: Mon Sep 10, 2012 5:41 pm

Re: Search for local file locations, and populate combobox

Hello,

i tried file search, but that will search for only one file.
I'm trying to find a way how to search e.g. Program Files folder, for specific filename, and get all folders containing that file. Because it can be more that one installation.
Is it possible?

Thanks
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Search for local file locations, and populate combobox

Hello,

I'm afraid we don't have predefined support for this. However, you can create your own custom action in order to achieve this.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
milanche
Posts: 14
Joined: Mon Sep 10, 2012 5:41 pm

Re: Search for local file locations, and populate combobox

Hello

i see.
Is there some example how that can be done, it's probably vbs script?
Can combo box be populated from script search results?

Thanks
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Search for local file locations, and populate combobox

Hello,
Is there some example how that can be done, it's probably vbs script?
I'm afraid we don't have any examples regarding this scenario. However, you can take a look on the following articles which may be helpful for you:
- VBScript to search for and delete file
- VBS script find and delete file
Can combo box be populated from script search results?
In order to achieve this you should store the custom action search results in properties (e.g. you can use the Session.Property property within a VB Script custom action). Then, you can add new items for combo box control using the above properties.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”