santoshadvanceinst
Posts: 22
Joined: Mon Nov 05, 2012 12:19 pm

Search Folder and Install

Hi,

Here is what I want to do as a part of installation.
1. Search a particular folder on machine during installation. This folder can reside on any drive.
2. If the folder is found then assign absolute path of that folder to APPDIR property (Absolute path = "C:\Program Files\...... \My Folder)
3. The installation then installs all the components under APPDIR location
4. If the folder is not found then abort installation with a proper message

Can you please guide me to achieve the above.

Thanks in advance.

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

Re: Search Folder and Install

Hello Santosh,

Unfortunately, we don't have predefined support to search for a folder which can reside on any drive from target computer. You can use our folder search support only to search on a specified drive or on the WindowsVolume drive (the drive where Windows is installed).

As a workaround, you can develop your own custom action which will do the folder path search and save the result into a public property (e.g. MY_PATH). Then you can set APPDIR to your MY_PATH property value using a "Set installer property" custom action and you can add a "Display error message" custom action using the NOT MY_PATH condition.

If you have any questions just let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
CynthiaTaylor
Posts: 1
Joined: Fri Apr 22, 2016 9:54 am

Re: Search Folder and Install

Hi santhosh thank you for the question .i also facing the same problem.Now i got the solution
santoshadvanceinst
Posts: 22
Joined: Mon Nov 05, 2012 12:19 pm

Re: Search Folder and Install

Hi Cynthia,

Were you able to implement this? If yes then can you please share the aip file.

Regards,
santosh
santoshadvanceinst
Posts: 22
Joined: Mon Nov 05, 2012 12:19 pm

Re: Search Folder and Install

Hi Daniel,

I was not able to implement the functionality as suggested by you. Do you have any sample project which I can look at to see how it is implemented.
Any help would be of great value.

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

Re: Search Folder and Install

Hello Santosh,

I'm afraid we don't have such a custom action implementation which searches for a file on all computer drives. However, as a starting point to learn how you could create a custom action you can take a look on our "Create fully fledged C# custom actions" article.

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

Return to “Common Problems”