[wpkg-users] several checks in one package

Markus Nagel edv at tekomedia.de
Wed Sep 10 15:33:33 CEST 2008


Hello,
I've got one question concerning the logic of checks in wpkg. I'm
looking for a possibility to use an if.. then...else check in one package.
I.e. I'd like to copy a file to all users Desktop in Windows. If the
Servicepack of the OS Win XP is 1, copy file test1.txt to Desktop, if it
is SP2, copy file test2.txt to the Desktop.
I've tried it with the following code. It results in the fact, that both
files, test1 and test2 are copied to the Dektop. How can I manage it?
Thanks in advance
   
<?xml version="1.0" encoding="UTF-8"?>

<packages>

<package
    id="test"
    name="Testpaket"
    revision="20081"
    reboot="false"
    priority="5">

    <check type="logical" condition="or">
        <check type="logical" condition="not">

	<check type="registry" condition="equals" path="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CSDVersion" value="Service Pack 1" />

        </check>
        <check type="file" condition="exists"
path="%ALLUSERSPROFILE%\Desktop\test1.txt"/>
    </check>

    <install cmd ='xcopy /v /s /i /e /h /c /y /q "%SOFTWARE%\test1.txt"
"%ALLUSERSPROFILE%\Desktop\"' />
    <upgrade cmd ='xcopy /v /s /i /e /h /c /y /q "%SOFTWARE%\test1.txt"
"%ALLUSERSPROFILE%\Desktop\"' />
    <remove cmd ='cmd /c cmd /c del /f /q
"%ALLUSERSPROFILE%\Desktop\test1.txt"' />

    <check type="logical" condition="or">
        <check type="logical" condition="not">

	<check type="registry" condition="equals" path="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CSDVersion" value="Service Pack 2" />

        </check>
        <check type="file" condition="exists"
path="%ALLUSERSPROFILE%\Desktop\test2.txt"/>
    </check>

    <install cmd ='xcopy /v /s /i /e /h /c /y /q "%SOFTWARE%\test2.txt"
"%ALLUSERSPROFILE%\Desktop\"' />
    <upgrade cmd ='xcopy /v /s /i /e /h /c /y /q "%SOFTWARE%\test2.txt"
"%ALLUSERSPROFILE%\Desktop\"' />
    <remove cmd ='cmd /c cmd /c del /f /q
"%ALLUSERSPROFILE%\Desktop\test2.txt"' />

</package>

</packages>




More information about the wpkg-users mailing list