[wpkg-users] Problem with variables

Daniel Dehennin daniel.dehennin at ac-caen.fr
Thu Feb 5 13:50:16 CET 2009


Hello,

I have a problem when using variables in a package definition:

=====
<?xml version='1.0' encoding='utf-8'?>
<packages>
  <package
      id='disable-network-services'
      name='Windows XP disabled network services'
      revision='1'
      reboot='false'
      priority='700'>

    <variable name='NETCFG' value='%WPKGBIN%\snetcfg_wxp.exe'/>

    <check type='logical' condition='and'>
      <check type='execute' path='%ComSpec% /c %NETCFG% -q ms_psched | %WPKGBIN%\grep.exe "is not installed"'/>
      <check type='execute' path='%ComSpec% /c %NETCFG% -q ms_alg | %WPKGBIN%\grep.exe "is not installed"'/>
      <check type='execute' path='%ComSpec% /c %NETCFG% -q ms_gpc | %WPKGBIN%\grep.exe "is not installed"'/>
    </check>

    <install cmd='%ComSpec% /c %NETCFG% -u ms_psched'>
        <exit code='0'/>
        <exit code='1'/>
    </install>

    <install cmd='%ComSpec% /c %NETCFG% -u ms_alg'>
        <exit code='0'/>
        <exit code='1'/>
    </install>

    <install cmd='%ComSpec% /c %NETCFG% -u ms_gpc'>
        <exit code='0'/>
        <exit code='1'/>
    </install>

  </package>
</packages>
=====

The check works:

====
Execute check for program 'C:\WINDOWS\system32\cmd.exe /c %WPKGBIN%\snetcfg_wxp.exe -q ms_psched \| %WPKG%\bin\grep.exe "is not installed"' returned '0'. Evaluating condition 'null' revealed true when comparing to expected value of '0'

Execute check for program 'C:\WINDOWS\system32\cmd.exe /c %WPKGBIN%\snetcfg_wxp.exe -q ms_alg \| %WPKG%\bin\grep.exe "is not installed"' returned '1'. Evaluating condition 'null' revealed false when comparing to expected value of '0'
Result of logical 'AND' check is false
====

but not the install commands with the variable:

====
Executing command : %ComSpec% /c %WPKGBIN%\snetcfg_wxp.exe -u ms_psched
Command '%ComSpec% /c %WPKGBIN%\snetcfg_wxp.exe -u ms_psched' returned  exit code [1]. This exit code is not an error
Command in installation of Windows XP disabled network services returned exit code [1]. This exit code indicates success
Executing command : %ComSpec% /c %WPKGBIN%\snetcfg_wxp.exe -u ms_alg
Command '%ComSpec% /c %WPKGBIN%\snetcfg_wxp.exe -u ms_alg' returned  exit code [0]. This exit code is not an error.
Command in installation of Windows XP disabled network services returned exit code [0]. This exit code indicates success.
Executing command : %ComSpec% /c %NETCFG% -u ms_gpc
Command '%ComSpec% /c %NETCFG% -u ms_gpc' returned  exit code [1]. This exit code is not an error.
Command in installation of Windows XP disabled network services returned exit code [1]. This exit code indicates success.
====

Before WPKG runs:
- ms_psched (QoS) is not installed
- ms_alg is installed
- ms_gpc is installed

ms_gpc is never removed, the return code should be 0 like with ms_alg but it's not.

wpkg.js version 1.1.0-M8 from[1].

Regards.

Footnotes: 
[1]  http://wpkg.svn.sourceforge.net/svnroot/wpkg/wpkg/current-development

-- 
Daniel Dehennin
RAIP de l'Orne



More information about the wpkg-users mailing list