Easiest:
<package id='WinMerge' name='WinMerge' revision='21040' priority='50' reboot='false' > <check type='uninstall' condition='exists' path='WinMerge 2.10.4.0' /> <install cmd='"%SOFTWARE%\WinMerge\unattended.cmd"' /> <remove cmd='"%SOFTWARE%\WinMerge\unattended-uninstall.cmd"' /> <upgrade cmd='"%SOFTWARE%\WinMerge\unattended.cmd"' /> </package>
This uses a command-script to install WinMerge. Here is the code of the two scripts:
@echo off echo Installing WinMerge set BINARY=WinMerge-2.10.4-Setup.exe set INSTALL_LOC=%~dp0 start /wait "WinMerge" "%INSTALL_LOC%%BINARY%" /VERYSILENT /SP- /NORESTART
@echo off echo Removing WinMerge set PROG_FILES=%ProgramFiles% if not "%ProgramFiles(x86)%" == "" set PROG_FILES=%ProgramFiles(x86)% start /wait "WinMerge" "%PROG_FILES%\WinMerge\unins000.exe" /VERYSILENT /SP- /NORESTART
This uses the unattended-uninstall.cmd
script to support the %ProgramFiles(x86)% location on Windows x64 editions.
If you do not need to support x64 editions you might simply include the command lines within the XML file:
<package id='WinMerge' name='WinMerge' revision='21040' priority='50' reboot='false' > <check type='uninstall' condition='exists' path='WinMerge 2.10.4.0' /> <install cmd='"%SOFTWARE%\WinMerge\WinMerge-2.10.4-Setup.exe" /VERYSILENT /SP- /NORESTART' /> <remove cmd='"%ProgramFiles%\WinMerge\unins000.exe" /VERYSILENT /SP- /NORESTART' /> <upgrade cmd='"%SOFTWARE%\WinMerge\WinMerge-2.10.4-Setup.exe" /VERYSILENT /SP- /NORESTART"' /> </package>
Or with X64 support, and no cmd files:
<package id="winmerge" name="WinMerge" revision="2" reboot="false" priority="1"> <variable name="version" value="2.12.4" /> <variable name="packagedir" value="%SOFTWARE%\Standard\WinMerge" /> <check type="uninstall" condition="exists" path="WinMerge %version%" /> <install cmd='%packagedir%\WinMerge-%version%-Setup.exe /VERYSILENT /SP- /NORESTART' /> <upgrade cmd='%packagedir%\WinMerge-%version%-Setup.exe /VERYSILENT /SP- /NORESTART' /> <remove cmd='"%ProgramFiles%\WinMerge\unins000.exe" /VERYSILENT /SP- /NORESTART' architecture="x86" /> <remove cmd='"%ProgramFiles(x86)%\WinMerge\unins000.exe" /VERYSILENT /SP- /NORESTART' architecture="x64" /> </package>
View inventory records anonymously contributed by opt-in users of the K1000 Systems Management Appliance.