Difference between revisions of "Package dependencies"

From WPKG | Open Source Software Deployment and Distribution
Jump to: navigation, search
m
(Removed old outdated information, updated the 'depend' information and added 'chain' information)
Line 1: Line 1:
 
Packages can depend on each other (i.e., you have to install Firefox before installing some Firefox plugin etc.).
 
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:
 +
 +
<div style="margin-left: 30px">
 +
'''depend''' - depends the current package to another specified package.
 +
 +
'''chain''' - chains another specified package to this package.
 +
</div>
 +
 +
== Depending 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 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":
 
The example used in [[Packages.xml]] has been modified to make it dependent on another package called  "other-package":
<pre>
+
<source lang="xml">
 
<packages>
 
<packages>
 
<package
 
<package
Line 11: Line 22:
 
revision="1"
 
revision="1"
 
reboot="false"
 
reboot="false"
priority="0"
+
priority="0">
depends="other-package">
+
 
 +
<depends package-id="other-package" />
 +
 
 +
...
 +
</source>
 +
 
 +
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 independently of the priority of the packages.
 +
 
 +
The example used in [[Packages.xml]] has been modified to make it chain another package called  "other-package":
 +
<source lang="xml">
 +
<packages>
 +
<package
 +
id="wpkg1"
 +
name="Windows Packager sample 1"
 +
revision="1"
 +
reboot="false"
 +
priority="0">
 +
 
 +
<chain package-id="other-package" />
 +
 
 
...
 
...
</pre>
+
</source>
  
Note that "package dependencies" are now defined differently than in 0.9.6 and 0.9.7; this previous format is not supported.
+
In this example the chain makes that "other-package" is installed right ''after'' the current package "wpkg1".
  
A description from wpkg-users mailing list by Dr. Frank Lee:
+
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.  
<pre>
+
The 'dependancy' just adds the packages to the list, which is then
+
installed in order of priority. If 'foo' depends on 'bar' being present
+
for 'foo' to install properly, 'bar' ought to have a higher priority than
+
'foo'.
+
  
In the example above, B should be set at a higher priority than A for  
+
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.
success. (I usually have 900-999 as the priority for OS patches, 700-799
+
for antivirus etc, 500-599 for 'mission critical' applications, 300-399
+
for useful things and 100-199 for end-user things like office. Even
+
numbered centuries are 'reserved for future expansion'...)
+
</pre>
+
  
See also "Priority vs Dependancy -- Order of Installation" thread:<br />
+
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.
http://lists.wpkg.org/pipermail/wpkg-users/2007-November/thread.html#2000
+
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.
  
 
[[category:Documentation]]
 
[[category:Documentation]]

Revision as of 14:51, 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 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 independently of the priority of the packages.

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.