How to copy files conditionally - 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!

Vicente
Posts: 20
Joined: Sat Oct 08, 2011 12:21 am

How to copy files conditionally

Hi!

I have a problem that I am not sure how to approach. I have a product that when installing will install some Visual Studio project templates. Things should work something like this:

- If Visual Studio 2010 is detected, install Visual Studio 2010 project templates.
- Run a custom action that calls devenv.ese /someflag here to make Visual Studio 2010 realize about the new templates
- If Visual Studio 2012 is detected, install Visual Studio 2012 project templates.
- Run a custom action that calls devenv.ese /someflag here to make Visual Studio 2012 realize about the new templates

(if both are detected, install both)

In the custom installation UI, those options should only appear if Visual Studio 2010 and/or Visual Studio 2012 are detected.

How could I do this using Advanced Installer? Regards!

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

Re: How to copy files conditionally

Hello Vicente,

In order to achieve what you want you can proceed like this:
- Go to "Search" page add two searches (Search_VS2010 and Search_VS2012) which will verify if Visual Studio 2010 and Visual Studio 2012 are installed.
- From "Organization" page add the components of the related Visual Studio project templates resources in two features (i.e Template_1 and Template_2). Then you can condition these feature installation using the above searches (Search_VS2010 and Search_VS2012). Also, you can take a look on our "Show a custom feature selection dialog" article.
- In order to run the custom action which calls devenv you can use a BAT file. Please take a look on our "Launch a CMD or BAT file" article.

Let us know if this helps, otherwise please give us more details about your scenario.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Vicente
Posts: 20
Joined: Sat Oct 08, 2011 12:21 am

Re: How to copy files conditionally

Thanks a lot, this was exactly what I was searching. I didn't know about Search, nice feature :)

Regards!

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

Re: How to copy files conditionally

You're welcome. Glad to help!

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

Return to “Common Problems”