BrianLee
Posts: 3
Joined: Wed May 16, 2012 11:04 pm

Can I copy files from 2 different folders based on property?

Hi there,

Is there any way I can specify different folders from which the files can be copied based on property values?

For example,
If Property = 0, copy files from folder A
If Property = 1, copy files from folder B

Your help is greatly appreciated.
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Can I copy files from 2 different folders based on prope

Hi and welcome to Advanced Installer forums,

From your post I can think of a couple documented possibilities that may help you:
1. If you want to perform a file operation you should take a look on our How do I install a user specific file? article.
2. If you want to conditionally install files with identical name in the same folder you should follow our "Install files with the same name" article steps.

Do you have your files added in your package or they are next to the MSI package?

If the above do not suit your scenario, can you please exemplify and give us more details about the behavior?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
BrianLee
Posts: 3
Joined: Wed May 16, 2012 11:04 pm

Re: Can I copy files from 2 different folders based on prope

I tried option 2 and it does not seem to work. According to the documentation, it will only work with public properties.
I shall try option 1 tomorrow, but here is exactly what I want to do:

I have 2 types of users that need 2 different sets of reports.

1. Declare a private property called "UserType"
2. Get UserType from InstallationUI via user input
3. If UserType is 1, copy files from ReportType1 folder from the source to Reports folder on the target machine.
If UserType is 2, copy files from ReportType2 folder from the source to Reports folder on the target machine.

Again, thank you for your help.
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Can I copy files from 2 different folders based on prope

Hi,

Indeed, accordingly with your scenario you should use the second approach from my previous post. Also, please keep in mind that if your property is set from UI, then you must use a public property in order to condition a component installation.

If you find any confusing step in our tutorial let us know.

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

Return to “Common Problems”