Conditionally install files

Got a problem you cannot solve? Try here.
Sheri_Steeves
Posts: 124
Joined: Mon Oct 22, 2012 2:14 pm

Conditionally install files

Postby Sheri_Steeves » Wed Feb 03, 2021 4:01 pm

I have versioned install projects that all use the same underlying mia script.

I want to include/install a collection of files only if a version number (it could be any variable, really) is greater than a set value.

Can I do this? Right now it throws an error that the older project version cannot find the files.

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Conditionally install files

Postby FrancescoT » Thu Feb 04, 2021 1:54 pm

Can you share some more details on how you have implemented this currently?
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

Sheri_Steeves
Posts: 124
Joined: Mon Oct 22, 2012 2:14 pm

Re: Conditionally install files

Postby Sheri_Steeves » Mon Feb 08, 2021 2:00 pm

I have created a single underlying .mia script used by each versioned project. I need to be able to continue building a "release" version along with a "development" version and was trying to reduce the number of files and editing I needed to do. As well, the mia script is used by three projects as "flavors" of builds.

The latest version needs a subfolder of files that the older version does not have, so I tried conditionally including it as follows:

Code: Select all

    if Variable INSTALLTREEVERSION not Equals 12.0.000
      Install Files c:\ss\work5\vector5\installs\#installtree_product#\installtree\#installtree_version#\comsamples\*.* to $TARGETDIR$\COMSamples, include subfolders
      Install Files c:\ss\work5\vector5\installs\#installtree_product#\installtree\#installtree_version#\runcommands\*.* to $TARGETDIR$\RunCommands, include subfolders
    end


Trying to build this gives this error:

Error during build: No files matching pattern "c:\ss\work5\vector5\installs\TIFF Image Printer 12.0\installtree\12.0.000\comsamples\*.*"

I've set the variable INSTALLTREEVERSION to be ny compiler variable (set per project) and it is 12.0.000.

Is there a better way or a different way I need to handle this requirement?

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Conditionally install files

Postby FrancescoT » Mon Feb 08, 2021 2:38 pm

Dear Sheri,

you are using a Custom Script Variable, and NOT a Custom Compiler Variable ...this is why you are having such problem.
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

Sheri_Steeves
Posts: 124
Joined: Mon Oct 22, 2012 2:14 pm

Re: Conditionally install files

Postby Sheri_Steeves » Tue Feb 09, 2021 7:45 am

Franscesco,

Aha! That was what I was missing. I'll keep that knowledge for future use.

I had to get the new build version ready for testing yesterday. I worked around it by copying the underlying .mia file and changing the script file set for each project in the MSICode tab.

I only need to do that when my install file collection changes which should be a rare occurrence now. It is one more file to maintain but not having conditionals for each version in a single file makes it easier to read.

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Conditionally install files

Postby FrancescoT » Tue Feb 09, 2021 11:22 am

:)
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 32 guests