[wpkg-users] /noUpgradeBeforeRemove switch seems to have broken upgrade-before-remove feature

Pendl Stefan stefan.pendl at haidlmair.at
Thu Jun 18 15:18:40 CEST 2009


Rainer,

it seems that with WPKG 1.1.1-RC5 the default is to disable upgrade before remove.



config.xml:

>>

 <!--
  ****************************************************************************
  * Usually WPKG upgrades a package to the latest available version before it
  * removes the package. This allows administrators to fix bugs in the package
  * and assure proper removal.
  * However this feature can lead to (sometimes unexpected) re-execution of
  * packages. For example if execution=always is used the package will run
  * once again before it is finally removed.
  * It's advised to leave this option on default unless you really know what
  * you're doing.
  *
  * True : Disables the upgrade-before-remove feature
  * False: Leave the upgrade-before-remove feature enabled
  *
  * Default value      : false
  * Command-line switch: /noUpgradeBeforeRemove
  ****************************************************************************
 -->
 <!--
  <param name='noUpgradeBeforeRemove' value='false' />
 -->
<<



wpkg.js:



line 329

>>

/**
 * Set to true to disable upgrade-before-remove feature by default
 */
var noUpgradeBeforeRemove = true;
<<



This breaks existing behavior, I think line 329 should assign false as the value to the variable, so the config and the defaults are in sync.



To test this I used the following package.



>>

 <package
  id="UpgradeBeforeRemoveTest"
  name="Test Upgrade Before Remove Feature"
  revision="1"
  reboot="false"
  priority="10">

  <check type="file" condition="exists" path="%TMP%\firefox.tmp" />

  <!-- create an empty file for testing -->
  <install cmd='%ComSpec% /c type NUL >"%TMP%\firefox.tmp"' />

  <upgrade cmd='%ComSpec% /c type NUL >"%TMP%\firefox.tmp"' />

  <remove cmd='%ComSpec% /c if exist "%TMP%\firefox.tmp" type NUL >"%TMP%\firefox.tmp"' />
 </package>
<<



Apply this package to any host and install it, after installation change the revision to 1.1 and remove the packge from the hosts profile.



Notice there will be no upgrade, just the remove.



---

Stefan





More information about the wpkg-users mailing list