Difference between revisions of "WPKG"

From WPKG | Open Source Software Deployment and Distribution
Jump to: navigation, search
m (WPKG Client upgrade)
m (WPKG Client upgrade)
Line 19: Line 19:
 
= WPKG Client upgrade =
 
= WPKG Client upgrade =
  
Computer scientists love recursion, or bootstrap, so this it a try to write a WPKG xml file that... installs itself.
+
You need Windows Installer 3.1 installed to upgrade WPKG if the service is running (or any other Windows MSI package, where the software runs during the upgrade).
 
+
Some theory first.<br />
+
Upgrade will not work if WPKG service is running. Therefore, you have to kill WPKGsrv.exe process first. On XP, it can be done with <code>taskkill</code> command; on Windows 2000, which doesn't have <code>taskkill</code> command, you can use an external <code>pskill</code> command.
+
 
+
'''NOTE: this won't work if you use logon delay feature.'''
+
  
 
<source lang="xml">
 
<source lang="xml">
Line 41: Line 36:
 
   <check type="file" condition="versionequalto" path="%PROGRAMFILES%\wpkg\wpkginst.exe" value="1.0.0.8" />
 
   <check type="file" condition="versionequalto" path="%PROGRAMFILES%\wpkg\wpkginst.exe" value="1.0.0.8" />
  
   <install cmd='cmd /C start C:\wpkg\software\WPKG\wpkg_upgrade.bat' />
+
   <install cmd='msiexec /norestart /qn /i "%SOFTWARE%\WPKG\WPKG Client 1.2.1.msi" ALLUSERS=1 SETTINGSFILE="%SOFTWARE%\WPKG\settings.xml"' />
  <!-- ping is to make sure wpkg.js pauses and doesn't reboot on some later package
+
 
        while WPKG Client is still being installed or upgraded -->
+
   <upgrade cmd='msiexec /norestart /qn /i "%SOFTWARE%\WPKG\WPKG Client 1.2.1.msi" ALLUSERS=1 SETTINGSFILE="%SOFTWARE%\WPKG\settings.xml"' />
   <install cmd='ping -n 120 127.0.0.1 >nul' />
+
  
  <upgrade cmd='cmd /C start C:\wpkg\software\WPKG\wpkg_upgrade.bat' />
 
  <upgrade cmd='ping -n 120 127.0.0.1 >nul' />
 
  
 
</package>
 
</package>
Line 58: Line 50:
 
<!-- <remove cmd='msiexec /qn /x{D6D68FEC-0044-4E2A-9333-6C4BC1D5B1DE}' /> -->  <!-- 1.2rc5 -->
 
<!-- <remove cmd='msiexec /qn /x{D6D68FEC-0044-4E2A-9333-6C4BC1D5B1DE}' /> -->  <!-- 1.2rc5 -->
 
</package>
 
</package>
</source>
 
 
 
Here is <code>wpkg_upgrade.bat</code> script:
 
 
<source lang="dos">
 
taskkill /F /IM WPKGSrv.exe
 
ping -n 5 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>
  

Revision as of 12:21, 6 July 2008

Initial WPKG Client deployment

WPKG Client is available as a MSI package.

It can be installed silently from command line or in a script like below:

msiexec /norestart /qn /i "%SOFTWARE%\WPKG\WPKG Client 1.2.1.msi" ALLUSERS=1 SETTINGSFILE="%SOFTWARE%\WPKG\settings.xml"


If you have wpkg.js already configured, simply add the XML file below (see "WPKG Client upgrade") to your packages/profiles and run:

cscript \\path\to\wpkg.js /synchronize /quiet


WPKG Client upgrade

You need Windows Installer 3.1 installed to upgrade WPKG if the service is running (or any other Windows MSI package, where the software runs during the upgrade).

<?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="versionequalto" path="%PROGRAMFILES%\wpkg\wpkginst.exe" value="1.0.0.8" />

   <install cmd='msiexec /norestart /qn /i "%SOFTWARE%\WPKG\WPKG Client 1.2.1.msi" ALLUSERS=1 SETTINGSFILE="%SOFTWARE%\WPKG\settings.xml"' />

   <upgrade cmd='msiexec /norestart /qn /i "%SOFTWARE%\WPKG\WPKG Client 1.2.1.msi" ALLUSERS=1 SETTINGSFILE="%SOFTWARE%\WPKG\settings.xml"' />


</package>

</packages>

        <!-- 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{2F7AB97F-17EC-4128-9BD1-903FC71F1B52}' /> --> <!-- 1.2rc6 -->
<!-- <remove cmd='msiexec /qn /x{D6D68FEC-0044-4E2A-9333-6C4BC1D5B1DE}' /> -->  <!-- 1.2rc5 -->
</package>

Changing WPKG Client settings

<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>


Other

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 %*


Copy wpkg.xml entry from workstation to the server:

<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>