installing either of two files based on property - 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!

shelmers
Posts: 63
Joined: Thu Sep 03, 2009 9:02 pm
Location: Andover, Massachusetts USA

installing either of two files based on property

I need to install one of two files based on a property value. This would be trivial except that the installed file must have a specific name. To say this another way, the end result I need is for this specific file to be installed: [APPDIR]xyz.txt
The source file will either be abc.txt or def.txt depending on the property value.

I've tried two things:

1) Put two files named xyz.txt into [APPDIR] and make the two components conditional on the property value. Not surprisingly, AI won't let me put two files with the same name in [APPDIR].

2) Include abc.txt and def.txt as temporary files and use File Copy/Move. However, I can't figure out a way to make the Copy/Move operation conditional. I thought perhaps I could make installation of the temporary files conditional but a temp file doesn't appear to create a component so I can't make the component conditional. Plus I can't create two copy/move operations with the same name.

Any suggestions for copying or renaming one of two files based on a property value so that the result is a file called xyz.txt in [APPDIR]? BTW, I don't want to leave abc.txt and def.txt on the target system after the installation is complete.

Thanks...
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: installing either of two files based on property

Hello,

Our guide contains an example of such a case when one of two versions of the same file needs to be conditionally installed on a system, and how to implement it. The example explains how to conditionally install different versions of a file depending on the Operating System (32/64-bit). You can easily adapt it by replacing the conditions in that example with conditions more suited to your needs. I hope you will find it of use.

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
shelmers
Posts: 63
Joined: Thu Sep 03, 2009 9:02 pm
Location: Andover, Massachusetts USA

Re: installing either of two files based on property

Thank you. I had searched all through the Guide, but missed this example -- perhaps because 32-bit/64-bit issues weren't my concern! In any case, thanks for pointing this out.

Scott

Return to “Common Problems”