Settings.xml

From WPKG | Open Source Software Deployment and Distribution
Jump to: navigation, search

This document in other languages: Spanish


settings.xml is a settings file used by the WPKG Client.

Typically, configuration process looks like below:

  • WPKG Client is configured on one workstation
  • settings are exported to a settings.xml file
  • on other workstations, WPKG Client can be configured by:
    • using a WPKG Client GUI (graphical user interface), where the settings file can be imported - just start %PROGRAMFILES%\wpkg\wpkginst.exe and use the "Import settings..." button
    • using a CLI (command-line interface) mode of WPKG Client (recommended) - settings can be imported during installation, or later (example)

CLI / command line mode[edit]

You can generate the settings.xml file by pressing the "Export settings..." button.


Notes:

  1. Filenames surrounded with quotes will not work in current version (1.2rc6)
  2. Command line options for import/export of settings in 1.2rc6 are different
--import=\\server\deploy\settings\settings.xml
--export=%PROGRAMFILES%\Wpkg\exported-settings.xml

Changing settings with WPKG[edit]

We'll need two files to manage this first our usual xml file and then a batch script for the check.

<package
  id="wpkg-settings"
  name="WPKG Settings"
  revision="1"
  priority="100"
  reboot="false">

  <check type="execute" path="%SOFTWARE%\..\scripts\wpkgsettings.bat" condition="exitcodelessorequal" value="0" />
   
  <!-- Import the created file -->
  <install cmd='"%PROGRAMFILES%\WPKG\wpkginst.exe" --import=%temp%\wpkgsettings.xml' />
  <!-- Delete created settings files -->
  <install cmd='%COMSPEC% /C if exist "%temp%\wpkgsettings.xml" del "%temp%\wpkgsettings.xml"' />
  <install cmd='%COMSPEC% /C if exist "%temp%\exported-settings.xml" del "%temp%\exported-settings.xml"' />

  <upgrade include="install" />
</package>

This file looks a little messy (if you know how to make it look tidier please feel free to sort it), as it creates the config file. We've modified ours to have a few variables in the config.

@echo off
REM This file is for checking desired WPKG settings against the settings we actually have

REM Remove old settings file (They may have been deleted already)
if exist "%temp%\wpkgsettings.xml"      del "%temp%\wpkgsettings.xml"
if exist "%temp%\exported-settings.xml" del "%temp%\exported-settings.xml"

REM Export current settings from WPKG
"%PROGRAMFILES%\wpkg\wpkginst.exe" --export=%temp%\exported-settings.xml

REM Generate a settings file with personalised settings for that computer
echo ^<?xml version="1.0" encoding="UTF-8"?^>>> %temp%\wpkgsettings.xml
echo ^<configuration^>^<file^>\\software\updates\wpkg.js^</file^>^<net-use-machine-account^>NO^</net-use-machine-account^>^<path-user^>^</path-user^>^<path-password^>^</path-password^>^<exec-user^>SYSTEM^</exec-user^>^<exec-password^>^</exec-password^>^<parameters^>/synchronize /nonotify /quiet^</parameters^>^<silent^>YES^</silent^>^<pre-action^>^</pre-action^>^<post-action^>^</post-action^>^<show-GUI^>NO^</show-GUI^>^<logon-delay^>0^</logon-delay^>^<logon-message-title^>WPKG Software Deployment^</logon-message-title^>^<logon-message-logo-picture^>^</logon-message-logo-picture^>^<logon-message-1^>WPKG is installing applications and applying settings...^</logon-message-1^>^<logon-message-2^>Please wait, don't restart or power off your computer...^</logon-message-2^>^<script-variable name="software"^>\\software\updates\packages^</script-variable^>^<priority^>normal^</priority^>^<stop-service-after-done^>YES^</stop-service-after-done^>^<laptop-mode^>NO^</laptop-mode^>^<server-connecting-method^>standard^</server-connecting-method^>^<server-connecting-ip^>^</server-connecting-ip^>^<server-connecting-timeout^>3^</server-connecting-timeout^>^<server-connecting-script-timeout^>3^</server-connecting-script-timeout^>^<server-connecting-script-file^>^</server-connecting-script-file^>^<log-file^>^</log-file^>^<run-on-shutdown^>NO^</run-on-shutdown^>^<shutdown-delay^>10^</shutdown-delay^>^<logon-interrupt-password^>^</logon-interrupt-password^>^<repeat-count-on-failure^>10^</repeat-count-on-failure^>^</configuration^>>> %temp%\wpkgsettings.xml

REM check if the settings files are the same
echo n|comp %temp%\exported-settings.xml %temp%\wpkgsettings.xml