[wpkg-users] Conditional installation of a package

Rainer Meier r.meier at wpkg.org
Thu Sep 4 14:29:08 CEST 2008


Hi Johannes,

Johannes.Brix at evidian.com wrote:
> Hello,
> 
> I just began working with WPKG one month ago. And in the meanwhile, I have
> a bunch of questions.
> Here is the first one:
> 
> Is it possible to NOT install a package under some conditions like other
> installed programs, OS level
> and so on?

In general an administrator knows which OS is running on a machine. In 
addition most administrators try to keep their machines in a small 
number of "device classes" - like "Windows XP clients", "Windows Vista 
clients" or similar. Therefore I suggest creating a profile for each of 
these profiles. I usually create a profile hierarchy:

- company-global (packages which are installed on _all_ machines and 
operating systems)

- company-xp (xp-only packages, only applied to XP system. The profile 
depends on the global profile and therefore automatically includes all 
its packages. Usually there is only a very very limited number of 
packages within this profile)

- company-vista (vista-only packages, only applied to Vista systems. The 
profile depends on the global profile and therefore automatically 
includes all its packages. Usually there is only a very very limited 
number of packages within this profile)


A similar profile structure might be applies in your case.


In addition the latest WPKG 1.1.x milestone release contains a new type 
of checks: "execute" checks.
This allows to execute an external check script (for example a cmd 
script). This script could return 0 (package installed properly) on 
systems where you do not want to apply the package at all. This makes 
WPKG think that it is already installed on the system and it will 
neither execute the install nor the update commands.

Unfortunately it will still apply the "update" commands when you 
increase the package version number at a later stage. So this is not a 
solution for every case.

Still the best solution not to apply a package to a specific host is not 
to include it to the profile assigned to the host.
There are also no plans to change this since such "conditions" would be 
quite complex an WPKG would require to check all this conditions on each 
run. e.g.
- check if package is installed
- not installed?
   - run all pre-condition checks
   - do not apply the package

It sounds quite silly to me to assign a package to a host which should 
not be installed on the host actually.

Most pre-conditions include pre-requirements to the package (like 
software xy needs Java runtime installed). These can be resolved by 
package dependencies. So the pre-requirements are met before the package 
is actually applied.


br,
Rainer



More information about the wpkg-users mailing list