[wpkg-users] Empty remove command

Rainer Meier r.meier at wpkg.org
Mon Nov 21 19:52:59 CET 2011


Hi Alan,

On 21.11.2011 18:19, Alan Adams wrote:
> This is a problem for me as well. i had a massive problem after I made
> a typo in the script for Google Earth. I had to remove the package as
> it was failing to install, and rebooting each time. Now it tries to
> uninstall, then reboots, then tries to uninstall, then reboots ...

Simply fixing the package (fixing your typo) on server side should do the job 
here. WPKG will (due to the typo) never install the package and therefore re-try 
on subsequent synchronizations. It will always take the package definition on 
server side for this - so you have all possibilities to fix your typo. You might 
also increment the package revision to reflect your update in the package.

About the uninstall reboot loop: This seems to be some serious bug in your 
package definition too. If you specify an immediate reboot on remove commands 
then WPKG will of course just run the same commands over and over again just to 
reboot. But reboot shall be used only if the package really requires it - and 
not just on every command run.


> I had to boot each computer in safe mode and remove wpkg.xml from
> c:\windows\system32 - that being the file which remembers the
> uninstall command.

Another option: Just fix your package definition so it won't reboot indefinitely 
any more. Then increment the revision. On next synchronization WPKG will first 
perform an upgrade to upgrade to the latest revision on server side. This is 
supposed then to fix the your broken local package definition. Then WPKG will 
perform the (fixed) uninstall procedure automatically.


> After this experience I generally create packages without uninstall
> commands - and have to live with the "uninstall failed" messages.

It's up to you to do that, but WPKG gives you all options to fix such package 
mistakes by simply fixing the package and incrementing the revision.


> I can see little advantage in caching the uninstall commands like
> this, and as you see above, major potential disadvantages. If instead
> the uninstall command is always read from the package on the server,
> then removing the package from a profile would cause an uninstall,
> while removing it from packages.xml would not. This would seem to give
> an additional useful flexibility.

There is no "caching". But the reboot flag is special in the sense that the 
state of uninstallation cannot be stored to wpkg.xml before the reboot finished 
since the reboot flag exactly tells WPKG that the action is not yet complete 
before reboot completed. So it would be totally wrong to WPKG to execute checks 
before the reboot or apply any modifications to wpkg.xml before the reboot took 
place. If you don't want WPKG to reboot immediately just use postponed or 
delayed reboot (as applicable) or no reboot at all.

Reading uninstall commands from server-side packages.xml is an extremely bad 
idea. The package installed on client is listed in wpkg.xml and not in 
packages.xml. The package in packages.xml might have a completely different 
revision and uninstall commands on server side might not work at all for the 
version installed. The commands in wpkg.xml are supposed to correspond to the 
software on client side.


> Or have I missed something which allows this anyway?

Maybe you did... see explanations above.

If you want to prevent WPKG to remove any package try the /noremove flag, but I 
strongly recommend not do do so unless you know exactly what you're doing.

Alternatively you can also use the latest wpkg 1.2.1 release candidate and make 
use of conditional commands in order to execute uninstall commands based on 
conditions (like environment variables). So if you wish to skip uninstall 
commands in certain cases, then define conditions which make WPKG just to skip 
specific commands.

br,
Rainer



More information about the wpkg-users mailing list