Conditionally install one file or another?

Got a problem you cannot solve? Try here.
tlmii
Posts: 8
Joined: Tue May 29, 2007 10:32 am

Conditionally install one file or another?

Postby tlmii » Tue May 29, 2007 10:38 am

Is there a way to install one file if feature X was chosen, but install another file (of the same name, to the same location) if feature Y was chosen? No matter what, you get that file, but which file it is depends on the features selection?

Also, can it be done in a more complicated manner - if they chose feature X, they get x, if they chose features X and Y, they get xy, if they chose features Y and Z, they get yz? Always the same file name/location, just different source files...

Thanks.

tlmii
Posts: 8
Joined: Tue May 29, 2007 10:32 am

Postby tlmii » Thu May 31, 2007 9:04 am

Anyone have any comments on this?

This might be the deciding factor for whether or not it is worth it to us to buy a package like this instead of using the installer services that come with Visual Studio - our needs are not very much right now, so it does the job well.

SteveDude
Posts: 253
Joined: Wed Apr 11, 2007 6:07 pm

Feature List

Postby SteveDude » Thu May 31, 2007 11:15 am

If I understand you correctly this can be done easily by adding specific feature selections to the script. This can be done visually and/or in the script editor.

tlmii
Posts: 8
Joined: Tue May 29, 2007 10:32 am

Postby tlmii » Thu May 31, 2007 1:25 pm

I see (i think) an easy way to do it that if it's one feature, then it's one file, another feature then another file.

But what about the more complication scenario with combinations of features meaning different things?

SteveDude
Posts: 253
Joined: Wed Apr 11, 2007 6:07 pm

Conditional Statements

Postby SteveDude » Thu May 31, 2007 10:10 pm

There are really many ways to do it. One of the reasons If statements exist. If this is whatever, do this or not.

I have a Photoshop compatible plugin that actually works in many different programs so I check for each one of them and if they exist I install the plug-in to work with that program. Same file, but installed in multiple places.

Another plugin I have is version specific so if one version is installed it installs one file, if it is another then installs a different one.

InstallAware makes conditional statements easy while it is much more complicated in other setup apps. There are some limitations on nested conditionals, but I haven't run into any problems.

Your best bet is just to try it.

SteveDude
Posts: 253
Joined: Wed Apr 11, 2007 6:07 pm

...to actually answer your question

Postby SteveDude » Thu May 31, 2007 10:12 pm

If a feature is selected, it is installed, if not it isn't. Select more than one and they are installed.

tlmii
Posts: 8
Joined: Tue May 29, 2007 10:32 am

Postby tlmii » Fri Jun 01, 2007 9:47 am

OK, i think i get it. At first glance in the code, i didn't see what i needed, but now i think i do...

So i can do something like this:

Get Component ComponentX Selection State into Variable XSELECTED
Get Component ComponentY Selection State into Variable YSELECTED

if Variable XSELECTED Equals TRUE
if Variable YSELECTED Equals TRUE
Install Files ...
Install Files ...
else
Install Files ...
Install Files ...
end
end

Is that about right?


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 121 guests