Difference between revisions of "Package dependencies"

From WPKG | Open Source Software Deployment and Distribution
Jump to: navigation, search
(Depending a package)
(Chaining a package: added warning to chain about priorities)
Line 32: Line 32:
  
 
== Chaining a package ==
 
== Chaining a package ==
By using '''chain''' you ''chain'' a package to the current package, meaning that if this package is installed, the other package also has to be installed but right ''after'' the current package independently of the priority of the packages.
+
By using '''chain''' you ''chain'' a package to the current package, meaning that if this package is installed, the other package also has to be installed but right ''after'' the current package.
 +
'''Attention:''' a chained package might also be installed before the package chaining it. This might happen if the chained package is either already installed (possible by another dependency) or has higher priority than the package which references it by chain. If you need to ensure that a package is installed before another one please specify a dependency (see [[Depending on a package]])
  
 
The example used in [[Packages.xml]] has been modified to make it chain another package called  "other-package":
 
The example used in [[Packages.xml]] has been modified to make it chain another package called  "other-package":

Revision as of 15:18, 18 August 2009

Packages can depend on each other (i.e., you have to install Firefox before installing some Firefox plugin etc.).

There are two types of dependencies:

depend - depends the current package to another specified package.

chain - chains another specified package to this package.

Depending on a package

By using depend you make a package depending on another package, meaning that this package needs the other package for correct functionality. This dependency can already be needed during the installation or upgrade, therefore a dependency is always installed right before the current package independently of the priority of the packages.

The format is very simple, and similar to the one used for profile dependencies

The example used in Packages.xml has been modified to make it dependent on another package called "other-package":

<packages>
<package
id="wpkg1"
name="Windows Packager sample 1"
revision="1"
reboot="false"
priority="0">

<depends package-id="other-package" />

...

In this example the dependency makes that "other-package" is installed right before the current package "wpkg1".

Chaining a package

By using chain you chain a package to the current package, meaning that if this package is installed, the other package also has to be installed but right after the current package. Attention: a chained package might also be installed before the package chaining it. This might happen if the chained package is either already installed (possible by another dependency) or has higher priority than the package which references it by chain. If you need to ensure that a package is installed before another one please specify a dependency (see Depending on a package)

The example used in Packages.xml has been modified to make it chain another package called "other-package":

<packages>
<package
id="wpkg1"
name="Windows Packager sample 1"
revision="1"
reboot="false"
priority="0">

<chain package-id="other-package" />

...

In this example the chain makes that "other-package" is installed right after the current package "wpkg1".

In fact it would be exactly the same if "other-package" would be depending on this package "wpkg1". But with some packages it may be more logical and even more practical by chaining another package instead of being the other package's dependant.

For example if you have a package "Gimp" for the application "The Gimp" and a package "GimpHelp" containing the Help files of the application. And you want "GimpHelp" always installed together with "Gimp". The "GimpHelp" package depends on "Gimp" as it needs a Gimp installation before it can be installed, so you could use 'depend' in the "GimpHelp" package. But in this case it is more logical to 'chain' "GimpHelp" to "Gimp" as it will be "Gimp" that you would want to assign to a profile.

In general the best practice is that if some main package needs certain other packages (containing components, libraries, frameworks, ...) to be able to work, that main package should depend on the needed other packages. But if (maybe due to a company policy) the main package always needs to be extended with certain packages (help-files, clipart, ...), then you should chain the extending packages from the main package. Be ware that if you don't want certain application extensions to be installed always (for example firefox developer extensions), you should not chain them from the main package, but let them depend on the main package and then assign them individually to the profiles where needed.