[wpkg-users] Env variables within WPKG vars in <check /> statements do not resolve

Rainer Meier r.meier at wpkg.org
Tue Jun 9 22:24:25 CEST 2009


Hi both,

Pendl Stefan wrote:
> Chris Allen wrote:
> <variable name='cygroot' value='%SYSTEMDRIVE%\cygwin' />
> <check type="file" condition="exists" path="%cygroot%\Cygwin.bat" />
> The problem appears only when using nested variables.  These examples work fine:
> 
> <variable name='cygroot' value='C:\cygwin\cygwin' />
> <check type="file" condition="exists" path="%cygroot%\Cygwin.bat" />
> 
> Or:
> 
> <check type="file" condition="exists" path="%SYSTEMDRIVE%\cygwin\Cygwin.bat" />
...

> // --- insert this
> 
> var shell = new ActiveXObject("WScript.Shell");
>   variableValue = shell.ExpandEnvironmentStrings(variableValue);
> 
> // --- end insert
> 
...

The proposal actually looks good. I hope it's not having some strange
side-effects. But immediately expanding variables could make sense here. So I've
added this change to WPKG 1.1.1-RC2. You might get it from here:

<http://wpkg.svn.sourceforge.net/viewvc/wpkg/wpkg/stable/1.1/wpkg.js?view=log>

Or download Revision 77 directly from here:

<http://wpkg.svn.sourceforge.net/viewvc/wpkg/wpkg/stable/1.1/wpkg.js?revision=77>


It contains a bunch of other fixes/enhancements too:

NEW: Added a new switch: /noUpgraeBeforeRemove.
     This switch allows to disable the upgrade-before-remove feature.
     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.
	 Thanks to Simon.
MOD: Fixed typo in in database-inconsistency message. Thanks to Gerd Ott.
MOD: Changed Wording after successful installation of a package.
     Thanks to Simon.
MOD: Enhanced variable expansion within <variable /> nodes. If the value
     contains shell variables they are expanded immediately.
     Thanks to Chris Allen for reporting and Stefan Pendl for fix suggestion.


@Simon: If you read this you probably noticed that it also contains a change for
you which allows to disable the upgrade-before-remove feature. You might test it
and give feedback if it serves your needs.


If it works fine I will release it soon.

br,
Rainer



More information about the wpkg-users mailing list