Difference between revisions of "WPKG"
m |
|||
Line 4: | Line 4: | ||
<source lang="dos"> | <source lang="dos"> | ||
− | taskkill /F /IM | + | taskkill /F /IM WPKGSrv.exe |
− | msiexec /qn /i "%SOFTWARE%\ | + | ping -n 1 127.0.0.1 >nul |
+ | msiexec /norestart /qn /i "%SOFTWARE%\WPKG\WPKG Client 1.2.1.msi" ALLUSERS=1 SETTINGSFILE="%SOFTWARE%\WPKG\settings.xml" | ||
+ | exit | ||
</source> | </source> | ||
Line 11: | Line 13: | ||
Here is the XML which '''does not''' contain killing WPKGsrv.exe: | Here is the XML which '''does not''' contain killing WPKGsrv.exe: | ||
− | < | + | <?xml version="1.0" encoding="UTF-8"?> |
+ | |||
+ | <packages> | ||
+ | |||
<package | <package | ||
− | + | id="wpkg_client" | |
− | + | name="WPKG Client 1.2.1" | |
− | + | revision="6" | |
− | + | reboot="false" | |
− | + | priority="10"> | |
− | + | ||
− | + | <check type="uninstall" condition="exists" path="WPKG" /> | |
− | + | <check type="file" condition="sizeequals" path="%PROGRAMFILES%\wpkg\wpkginst.exe" versionequalto="1.0.0.8" /> | |
− | + | ||
− | + | <install cmd='cmd /C start C:\wpkg\software\WPKG\wpkg_upgrade.bat' /> | |
− | + | ||
− | + | <upgrade cmd='cmd /C start C:\wpkg\software\WPKG\wpkg_upgrade.bat' /> | |
− | + | ||
− | + | </package> | |
− | + | ||
+ | </packages> | ||
+ | |||
<!-- uncomment whichever is appropriate below, depending on your client version --> | <!-- uncomment whichever is appropriate below, depending on your client version --> | ||
<!-- <remove cmd='msiexec /qn /x{49676893-9829-4674-953D-1107C6B2C127}' /> --> <!-- 1.0rc2 --> | <!-- <remove cmd='msiexec /qn /x{49676893-9829-4674-953D-1107C6B2C127}' /> --> <!-- 1.0rc2 --> | ||
Line 43: | Line 50: | ||
<depends package-id="wpkg"/> | <depends package-id="wpkg"/> | ||
− | <install cmd='%PROGRAMFILES%\WPKG\wpkginst.exe --SETTINGSFILE=% | + | <install cmd='%PROGRAMFILES%\WPKG\wpkginst.exe --SETTINGSFILE=%SOFTWARE%\WPKG\settings.xml' /> |
− | <upgrade cmd='%PROGRAMFILES%\WPKG\wpkginst.exe --SETTINGSFILE=% | + | <upgrade cmd='%PROGRAMFILES%\WPKG\wpkginst.exe --SETTINGSFILE=%SOFTWARE%\WPKG\settings.xml' /> |
<remove cmd='echo "nothing"' /> | <remove cmd='echo "nothing"' /> | ||
</package> | </package> |
Revision as of 20:16, 20 April 2008
Computer scientists love recursion, or bootstrap, so this it a try to write a WPKG xml file that... installs itself.
NOTE: upgrade will not work if WPKG service is running. Therefore, you have to kill WPKGsrv.exe process first. On XP, it can be done like below; on Windows 2000, which doesn't have taskkill
command, you can use an external pskill
command.
taskkill /F /IM WPKGSrv.exe
ping -n 1 127.0.0.1 >nul
msiexec /norestart /qn /i "%SOFTWARE%\WPKG\WPKG Client 1.2.1.msi" ALLUSERS=1 SETTINGSFILE="%SOFTWARE%\WPKG\settings.xml"
exit
Here is the XML which does not contain killing WPKGsrv.exe:
<?xml version="1.0" encoding="UTF-8"?>
<packages>
<package
id="wpkg_client" name="WPKG Client 1.2.1" revision="6" reboot="false" priority="10">
<check type="uninstall" condition="exists" path="WPKG" /> <check type="file" condition="sizeequals" path="%PROGRAMFILES%\wpkg\wpkginst.exe" versionequalto="1.0.0.8" />
<install cmd='cmd /C start C:\wpkg\software\WPKG\wpkg_upgrade.bat' />
<upgrade cmd='cmd /C start C:\wpkg\software\WPKG\wpkg_upgrade.bat' />
</package>
</packages>
</package>
<package
id="wpkg-settings" name="WPKG Settings" revision="5" priority="5" reboot="false" execute="once"> <depends package-id="wpkg"/> <install cmd='%PROGRAMFILES%\WPKG\wpkginst.exe --SETTINGSFILE=%SOFTWARE%\WPKG\settings.xml' /> <upgrade cmd='%PROGRAMFILES%\WPKG\wpkginst.exe --SETTINGSFILE=%SOFTWARE%\WPKG\settings.xml' /> <remove cmd='echo "nothing"' />
</package> </source>
I use this setup from now to install all the stuff with a single command; I've simply build up a batch file that defines the same environment variable defined in settings.xml and start directly wpkg.js, as:
:: Startup script for wpkg, for the first installation
::
:: These are not (still) defined elsewhere, define it.
::
set WPKGROOT=\\FILE\wpkg
set SOFTWARE=\\MEDIA\Software
set VPSERVER=MORPHEUS
:: Call directly wpkg.js, note the %* at the end, that permit to add custom parameters...
::
cscript %WPKGROOT%\wpkg.js /synchronize %*
install Log for computers
<package id="wpkglog" name="wpkg.xml files from workstations" revision="1" priority="0" execute="always">
<install timeout="15" cmd='cmd /C copy /Y "%SYSTEMROOT%\system32\wpkg.xml" "\\serwer\hostlogs\%COMPUTERNAME%-wpkg.xml"' />
</package>
remove wpkg.xml
<package id="wpkgxmlremove" name="wpkg.xml remove" revision="1" priority="0" execute="once">
<install timeout="15" cmd='cmd /C del /Q "%SYSTEMROOT%\system32\wpkg.xml"' />
</package>