Difference between revisions of "WPKG"

From WPKG | Open Source Software Deployment and Distribution
Jump to: navigation, search
m
Line 1: Line 1:
 
Computer scientists love recursion, or bootstrap, so this it a try to write a WPKG xml file that... installs itself.
 
Computer scientists love recursion, or bootstrap, so this it a try to write a WPKG xml file that... installs itself.
<pre>
+
 
<package
+
'''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 <code>taskkill</code> command, you can use an external <code>pskill</code> command.'''
 +
 
 +
<source lang="dos">
 +
taskkill /F /IM /WPKGsrv.exe
 +
msiexec /qn /i "%SOFTWARE%\wpkg\WPKG Client 1.2-rc1.msi" ALLUSERS=1 SETTINGSFILE="%SOFTWARE%\wpkg\settings.xml"
 +
</source>
 +
 
 +
 
 +
Here is the XML which '''does not''' contain killing WPKGsrv.exe:
 +
 
 +
<source lang="xml">
 +
<package
 
         id="wpkg"
 
         id="wpkg"
 
         name="WPKG"
 
         name="WPKG"
Line 21: Line 32:
 
<!-- <remove cmd='msiexec /qn /x{2F7AB97F-17EC-4128-9BD1-903FC71F1B52}' /> --> <!-- 1.2rc6 -->
 
<!-- <remove cmd='msiexec /qn /x{2F7AB97F-17EC-4128-9BD1-903FC71F1B52}' /> --> <!-- 1.2rc6 -->
 
<!-- <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>
 
   
 
   
<package
+
<package
 
         id="wpkg-settings"
 
         id="wpkg-settings"
 
         name="WPKG Settings"
 
         name="WPKG Settings"
Line 35: Line 46:
 
         <upgrade cmd='%PROGRAMFILES%\WPKG\wpkginst.exe --SETTINGSFILE=%WPKGROOT%\settings.xml' />
 
         <upgrade cmd='%PROGRAMFILES%\WPKG\wpkginst.exe --SETTINGSFILE=%WPKGROOT%\settings.xml' />
 
         <remove cmd='echo "nothing"' />
 
         <remove cmd='echo "nothing"' />
</package>
+
</package>
</pre>
+
</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:
 
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
+
<source lang="dos">
::
+
:: Startup script for wpkg, for the first installation
+
::
:: These are not (still) defined elsewhere, define it.
+
 
::
+
:: These are not (still) defined elsewhere, define it.
set WPKGROOT=\\FILE\wpkg
+
::
set SOFTWARE=\\MEDIA\Software
+
set WPKGROOT=\\FILE\wpkg
set VPSERVER=MORPHEUS
+
set SOFTWARE=\\MEDIA\Software
+
set VPSERVER=MORPHEUS
:: Call directly wpkg.js, note the %* at the end, that permit to add custom parameters...
+
 
::
+
:: Call directly wpkg.js, note the %* at the end, that permit to add custom parameters...
cscript %WPKGROOT%\wpkg.js /synchronize %*
+
::
 +
cscript %WPKGROOT%\wpkg.js /synchronize %*
 +
</source>
 +
 
  
 
install Log for computers
 
install Log for computers
  
<pre>
+
<source lang="xml">
 
<package id="wpkglog" name="wpkg.xml files from workstations" revision="1" priority="0" execute="always">
 
<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"' />
 
         <install timeout="15" cmd='cmd /C copy /Y "%SYSTEMROOT%\system32\wpkg.xml" "\\serwer\hostlogs\%COMPUTERNAME%-wpkg.xml"' />
 
</package>
 
</package>
</pre>
+
</source>
 +
 
  
 
remove wpkg.xml
 
remove wpkg.xml
  
<pre>
+
<source lang="xml">
 
<package id="wpkgxmlremove" name="wpkg.xml remove" revision="1" priority="0" execute="once">
 
<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"' />
 
         <install timeout="15" cmd='cmd /C del /Q "%SYSTEMROOT%\system32\wpkg.xml"' />
 
</package>
 
</package>
</pre>
+
</source>
  
  
 
[[Category:Silent Installers]]
 
[[Category:Silent Installers]]

Revision as of 14:24, 17 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
msiexec /qn /i "%SOFTWARE%\wpkg\WPKG Client 1.2-rc1.msi" ALLUSERS=1 SETTINGSFILE="%SOFTWARE%\wpkg\settings.xml"


Here is the XML which does not contain killing WPKGsrv.exe:

<package
        id="wpkg"
        name="WPKG"
        revision="80"
        priority="100"
        reboot="false">
 
        <check type="uninstall" condition="exists" path="WPKG" />
 
        <install cmd='msiexec /qb /i %SOFTWARE%\WPKG\WPKGSetup.msi SETTINGSFILE=%WPKGROOT%\settings.xml' />
        <upgrade cmd='msiexec /qb /i %SOFTWARE%\WPKG\WPKGSetup.msi' />
        <upgrade cmd='%PROGRAMFILES%\WPKG\wpkginst.exe --SETTINGSFILE=%WPKGROOT%\settings.xml' />
        <remove cmd='%SOFTWARE%\pstools\pskill.exe /accepteula WPKGSrv.exe' >
            <exit code="-1" /> <!--  If wpkg client is not running pskill.exe will fail with -1 exit code.
                                      -->
        </remove>
        <!-- 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>
 
<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=%WPKGROOT%\settings.xml' />
        <upgrade cmd='%PROGRAMFILES%\WPKG\wpkginst.exe --SETTINGSFILE=%WPKGROOT%\settings.xml' />
        <remove cmd='echo "nothing"' />
</package>

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>