[wpkg-users] update vs. install check

Rainer Meier r.meier at wpkg.org
Mon Nov 17 20:18:21 CET 2008


Hi Matt,

Matt Miller wrote:
> I have a question about which takes priority, the revision number or the
> installation check. This becomes an issue with packages like Firefox
> that put version numbers in the Add/Remove Programs entry.
> 
> For instance, my Firefox 3 package for wpkg looks something like this:
> 
> <package
>     id="firefox3"
>     name="Mozilla Firefox 3"
>     revision="3"
>     reboot="false"
>     priority="11">
>     <check type="logical" condition="or">
>         <check type="uninstall" condition="exists" path="Mozilla Firefox
> (3.0)" />
>         <check type="uninstall" condition="exists" path="Mozilla Firefox
> (3.0.3)" />
>     </check>
> 
>     <install cmd="\\%software%\firefox3\install-silent.cmd">
>         <exit code="0" />
>     </install>
>     <install cmd="\\%software%\firefox3\post-install.cmd" />
> 
>     <upgrade cmd="\\%software%\firefox3\install-silent.cmd" />
>     <upgrade cmd="\\unattended\wpkg\pkg\firefox3\post-upgrade.cmd" />
> 
>     <remove cmd="\\%software%\firefox3\remove-silent.cmd" />
>     <remove cmd="\\%software%\firefox3\post-remove.cmd" />
> </package>
> 
> 
> The logical condition "or" check lists two versions of Firefox 3. I
> assume that the recent update will list "Firefox (3.0.4)" in Add/Remove
> Programs. I'd like to eliminate the potential long list of logical
> checks if possible.
> 
> My question is, if increment the revision and make the check section
> <check type="uninstall" condition="exists" path="Mozilla Firefox (3.0.4)" />
> will WPKG attempt to run the install command or the upgrade command?
> Initially, the check will fail, but it has a lower revision...

It is common practice (well, I do it like this) to increment the package
revision AND update the check according to the conditions it should have
_after_ upgrade/install.
What will happen on your clients is depending on the client state.

1. Client with Firefox prior to 3.0.3 installed:
Here the client already has a Firefox package installed where the
revision of the installed package is lower than the one on the server.
In this case WPKG will detect FIRST that the package revision has been
increased and it will try to execute the upgrade command(s). And then
verify what has been installed by executing the checks.

2. Client without any Firefox installed:
Here WPKG will simply run the install commands and then verify if the
package has been installed (using the checks defined).


In general WPKG uses the checks defined for a package to verify that the
package is (still) installed properly. So in case WPKG installed Firefox
3.0.4 and the user is manually remove it WPKG will detect this (by
failed check) and re-execute the install commands.


Just changing the checks of a package without increasing the revision
number of the package will not have any effect on existing clients. WPKG
will verify the installed packages via the local package definitions and
since the server-side revision is not upgraded it will not do any
upgrade. Just for new clients of course the new (updated) package
definition will be used.

br,
Rainer



More information about the wpkg-users mailing list