C4 Data - Advanced Options

There are some cases when you need to do more complicated things with the C4 profile. Especially if you have applications that can install in different environments but require different actions for each of them.

PreDependency Overrides


when a profile specifies a [PreDependency|c4p_DataPreInstall#PreDependency] there may be cases where you need to change some of the aspects of that dependency's profile. The most common case is [LocalInstallerGlob|c4p_datainstall#LocalInstallerGlob]. By setting the LocalInstallerGlob for a dependency you can point to where the dependency's installer may be on an applications CD.

You can override any aspect of a dependency's install profile.

UseIf


<useif>...</useif>

UseIf is a way to specify when to use a secondary installation profile. If the condition specified by the UseIf tag evaluates to true, then it is merged with the main install profile. Otherwise it is ignored.

In the CrossTie editor presently there is a free-form XML block for the UseIf field. You will have to put in the complete UseIf block including the <useif> </useif> tags.

The comparison operators


equal -- string
lt -- string
le -- string
ge -- string
gt -- string

<useif><equal name="...">...</equal></useif>

The five operators compare the property specified by the 'name' attribute with the given value and return true if, respectively, the property is equal, less than, less then or equal, greater than or equal, or greater than the value.


match -- regular expression

<useif><match name="...">...</match></useif>

This operator returns true if the given regular expression matches the value of the property specified by the 'name' attribute. Regular expression matches are not supported on Android.

The logical operators

not -- matching type

<useif> <not>...</not></useif>


and -- matching type

<useif> <and>...</and></useif>


or -- matching type

<useif> <or>...</or></useif>

The properties

All the properties are strings. To ensure backward compatibility, any unknown property is treated as an empty string.


appid

This is the application id of the application being installed. Note that for dependencies this is different from the CrossTie's own application id.


locale

If the main application's CrossTie is affected by language, either by a string comparison with this field or language-specific download URL's, this is the language selected by the user.

Since CrossOver 15.0.1, if the main application's CrossTie is not affected by language, this is the user's locale. In earlier versions, it would be an empty string in this case.


bottletemplate

This is the type of the bottle the application will be installed into.


sourcetype
Since CrossOver 11.0

The "sourcetype" field will be one of the following values, depending on the install source:

  • file - If the install source is a local file or download.
  • cd - If the install source is a CD or other directory.
  • steam - If the install source is steam (only possible if the steamid tag is in the application profile).
  • unset - If no install source has been selected yet. The install cannot begin until a source has been selected, so this is only useful to set install notes.
  • dependency - If this profile is being installed as a dependency of another profile.

This property is not supported on Android.


platform
Since CrossOver 11.0

The "platform" field will be one of the following values, depending on the host OS platform:

  • Mac - the install is on a Mac OS X machine
  • Linux - the install is on a Linux machine.
  • Android - the install is on an Android or ChromeOS machine

NOTE: Much work has been gone into making the application installation and behavior identical between Linux and Mac. In particular it should be possible to move a bottle back and forth between Linux and Macs. So checking for the platform in CrossTies by means of the UseIf statement is strongly discouraged and should be a last resort.


product
cxversion
cxversion.x
cxversion.y
Since CrossOver 11.0

These properties are meant to help you write CrossTies that work well with all CrossOver products and versions. They are set, respectively, to the the product's standard product id, its internal version, that version's major number and its minor number. The latter two properties are prefixed with a zero if needed to help comparisons. This way if comparing the major number of version 9.0 with 10.0, you end up doing string comparisons on '09' and '10' which gives sensible results.

These properties are not supported on Android.


display.depth
Since CrossOver 11.2

The number of colors the screen can display in bits per pixel. See also the Low X11 Screen Depth cxdiag check.

This property is not supported on Android.


opengl.vendor
opengl.version
opengl.renderer
Since CrossOver 11.2

The OpenGL vendor, version and renderer properties respectively.

This property is not supported on Android.

NOTE: It should be possible to move a bottle from one system to another that has a different graphics card. So these should not be used to impact the configuration of the resulting bottle except as a last resort. They may however be used to warn (through an install note) the user of a verified issue with the specific configuration inferred from these properties.


sourcefile
Since CrossOver 14.0.0

The sourcefile field is used to match the specific name of an executable file. It is useful if there is more than one distributor of an application or if there is more than one way to install the application.

This property is not supported on Android.

NOTE: this field should NEVER match a generic name like setup.exe. This value should only be set for installers with very specific names.

Examples

To add a dependency when installing the Japanese version of an application you would do:

    <installprofile>
      <useif>
        <equal name="locale">ja</equal>
      </useif>
      <predependency>com.codeweavers.c4.jfont</predependency>
    </installprofile>

To issue a special installation note when installing the Chinese version of an application in a Windows 98 bottle you would write:

    <installprofile>
      <useif>
        <and>
          <match name="locale">^zh</match>
          <equal name="bottletemplate">win98</equal>
        </and>
      </useif>
      <installnotes>You are installing a Chinese application in a Windows 98 bottle.</installnotes>
    </installprofile>

To register a specific dll only when installing in a non Windows 98 bottle, do:

    <installprofile>
      <useif>
        <not><equal name="bottletemplate">win98</equal></not>
      </useif>
      <postregisterdll>thedll.dll</postregisterdll>
    </installprofile>

To match the name of an installer file:

    <installprofile>
      <useif>
        <match name="sourcefile">specificname.exe</a>
      </useif>
    </installprofile>

Finally if instead you wanted to only register this dll on CrossOver 9.2.z and lower you would write:

    <installprofile>
      <useif>
        <or>
          <lt name="cxversion.x">09</lt>
          <and>
            <equal name="cxversion.x">09</equal>
            <le name="cxversion.y">02</le>
          </and>
        </or>
      </useif>
      <postregisterdll>thedll.dll</postregisterdll>
    </installprofile>

Next Step: C4 Data - Examples

Last modified on 2023-09-29 20:43:49 UTC by Andrew Balfour