[wpkg-users] [Bug 231] New: Do Extended host attribute matching on <check> nodes

Stefan Pendl stefan.pendl.71 at gmail.com
Thu Jul 21 16:44:02 CEST 2011


> Version is 1.2 (not available as a version in Bugzilla)
>
> I would like to have extended host attribute matching on <check> nodes to be
> able to do something like this:
>
> <package
>  id="7zip"
>  name="7zip compression tools"
>  revision="1"
>  reboot="false"
>  priority="1">
>  <check type="uninstall" condition="exists" path="7-Zip 9.20"
> architecture="x86" />
>  <install cmd='"%SOFTWARE%\standard\7zip\7z920.exe" /S' architecture="x86" />
>  <remove  cmd='"%ProgramFiles%\7-Zip\Uninstall.exe" /S' architecture="x86" />
>
>  <check type="uninstall" condition="exists" path="7-Zip 9.20 (x64 edition)"
> architecture="x64" />
>  <install cmd='msiexec /qn /i "%SOFTWARE%\standard\7zip\7z920-x64.msi"'
> architecture="x64" />
>  <remove  cmd='msiexec /qn /x {23170F69-40C1-2702-0920-000001000000}'
> architecture="x64" />
> </package>
>
> I think this can be achieved with the attached patch (at least it works with
> the above package).
>

I am currently achieving this with variables or pattern matching:

    <package id="SevenZip"
            name="7-Zip"
            revision="%PKG_VERSION%"
            reboot="false"
            priority="10">

        <variable name="PKG_VERSION"     value="9.20" />
        <variable name="PKG_MSI_VERSION" value="920" />
        <variable name="PKG_DEST"        value="%ProgramFiles%\7-Zip"
    architecture="x86"/>
        <variable name="PKG_DEST"
value="%ProgramFiles(x86)%\7-Zip" architecture="x64"/>

        <check type="uninstall" condition="versiongreaterorequal"
path="7-Zip .+"            value="%PKG_VERSION%" />
        <check type="file"      condition="versiongreaterorequal"
path="%PKG_DEST%\7zFM.exe" value="%PKG_VERSION%" />

        <install cmd='msiexec /passive /i
"%SOFTWARE%\NT-Install\7-Zip\7z%PKG_MSI_VERSION%_%PROCESSOR_ARCHITECTURE%.msi"'
>
            <exit code="1641" />
        </install>

        <upgrade cmd='msiexec /passive /i
"%SOFTWARE%\NT-Install\7-Zip\7z%PKG_MSI_VERSION%_%PROCESSOR_ARCHITECTURE%.msi"'
>
            <exit code="1641" />
        </upgrade>

        <remove cmd='msiexec /passive /x
"%SOFTWARE%\NT-Install\7-Zip\7z%PKG_MSI_VERSION%_%PROCESSOR_ARCHITECTURE%.msi"'>
            <exit code="1605"/>
        </remove>
    </package>

---
Stefan



More information about the wpkg-users mailing list