[wpkg-users] Multiple remove actions for a package?

Rainer Meier r.meier at wpkg.org
Sat Sep 5 16:24:25 CEST 2009


Hi Kevin,

Kevin Keane wrote:
> I am trying to create a package that removes several individual MSIs.
> Based on the documention, I was under the impression that I'd simply
> have to add multiple <remove> tags to the package. But when I do that,
> processing stops after the first successful remove action (it continues
> only if the action returns an error code).

It's entirely correct that WPKG should always continue with the next command.
I've verified the loop "continue" instruction of cscript and then I made a small
test using the following package definition:

<?xml version="1.0" encoding="utf-8" ?>
<packages>

<package id='test' name='test package' revision='1' priority='50' reboot='false' >
  <check type='logical' condition='and'>
  <check type='file' condition='exists' path='%ProgramFiles%\test\test1.txt' />
  <check type='file' condition='exists' path='%ProgramFiles%\test\test2.txt' />
  </check>
  <install cmd='cmd /c mkdir "%ProgramFiles%\test"' >
    <exit code='1' />
  </install>
  <install cmd='cmd /c echo test1 > "%ProgramFiles%\test\test1.txt"' />
  <install cmd='cmd /c echo tes2 > "%ProgramFiles%\test\test2.txt"' />
  <remove cmd='cmd /c del /F /Q "%ProgramFiles%\test\test1.txt"' />
  <remove cmd='cmd /c del /F /Q "%ProgramFiles%\test\test2.txt"' />
  <remove cmd='cmd /c rmdir /s /q "%ProgramFiles%\test"' />
  <upgrade cmd='cmd /c mkdir "%ProgramFiles%\test"' >
    <exit code='1' />
  </upgrade>
  <upgrade cmd='cmd /c echo test1 > "%ProgramFiles%\test\test1.txt"' />
  <upgrade cmd='cmd /c echo tes2 > "%ProgramFiles%\test\test2.txt"' />
</package>

</packages>




As you can see the package is supposed to first remove "test1.txt" and then
"test2.txt" and then the containing directory "test". So if WPKG would fail like
you describe it then it should only remove test1.txt and then stop. Instead I
can see the following in the log:

...
2009-09-05 16:19:40, DEBUG   : Executing command: cmd /c del /F /Q
"%ProgramFiles%\test\test1.txt"
2009-09-05 16:19:41, DEBUG   : Command returned result: 0
2009-09-05 16:19:41, DEBUG   : Command in removal of test package returned exit
code [0]. Success.
2009-09-05 16:19:42, DEBUG   : Executing command: cmd /c del /F /Q
"%ProgramFiles%\test\test2.txt"
2009-09-05 16:19:43, DEBUG   : Command returned result: 0
2009-09-05 16:19:43, DEBUG   : Command in removal of test package returned exit
code [0]. Success.
2009-09-05 16:19:43, DEBUG   : Executing command: cmd /c rmdir /s /q
"%ProgramFiles%\test"
2009-09-05 16:19:44, DEBUG   : Command returned result: 0
2009-09-05 16:19:44, DEBUG   : Command in removal of test package returned exit
code [0]. Success.
2009-09-05 16:19:44, DEBUG   : Restoring previous environment.
..


So it's correctly executing all remove commands in order.

Could you please attach your package definition and the full execution debug log?


I was using WPKG 1.1.2-RC14 for testing:
<http://wpkg.svn.sourceforge.net/viewvc/wpkg/wpkg/stable/1.1/wpkg.js?revision=108>


br,
Rainer



More information about the wpkg-users mailing list