Changes

Jump to: navigation, search

Settings.xml

3,266 bytes added, 09:47, 22 June 2017
Added a way to update settings with WPKG
** using a WPKG Client GUI (graphical user interface), where the settings file can be imported - just start <code>%PROGRAMFILES%\wpkg\wpkginst.exe</code> 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 [[WPKG|(example)]]
 
 
== Changing settings with WPKG ==
We'll need two files to manage this first our usual xml file and then a batch script for the check.
<source lang="xml">
<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>
</source>
 
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.
 
<source lang="bat">
@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
</source>
[[category:Documentation]]
[[category:Installation]]
[[category:Config_Files]]
27
edits

Navigation menu