Page 1 of 1

Conditionally install files

Posted: Wed Feb 03, 2021 4:01 pm
by Sheri_Steeves
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.

Re: Conditionally install files

Posted: Thu Feb 04, 2021 1:54 pm
by FrancescoT
Can you share some more details on how you have implemented this currently?

Re: Conditionally install files

Posted: Mon Feb 08, 2021 2:00 pm
by Sheri_Steeves
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?

Re: Conditionally install files

Posted: Mon Feb 08, 2021 2:38 pm
by FrancescoT
Dear Sheri,

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

Re: Conditionally install files

Posted: Tue Feb 09, 2021 7:45 am
by Sheri_Steeves
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.

Re: Conditionally install files

Posted: Tue Feb 09, 2021 11:22 am
by FrancescoT
:)