Changes

UltraDefrag

2,330 bytes added, 14:08, 11 November 2012
added example of deploying configuration
; terminate the execution
exit
</source>
 
 
== Deploy custom configuration ==
 
There is a general configuration deployed and two examples show how to deploy based on computer name or operating system version.
 
<source lang="xml">
<package id="UltraDefragConfig" name="Ultra Defragmenter Config" revision="2012.11.10" reboot="false" priority="10">
<depends package-id="UltraDefrag"/>
 
<check type="file" condition="sizeequals" path="%SystemRoot%\system32\ud-boot-time.cmd" value="2180" os="5\.\d\.\d{4}" />
<check type="file" condition="sizeequals" path="%SystemRoot%\system32\ud-boot-time.cmd" value="2588" hostname="SATELLITE" />
<check type="file" condition="sizeequals" path="%UD_INSTALL_DIR%\options\guiopts.lua" value="17206" os="5\.\d\.\d{4}" />
<check type="file" condition="sizeequals" path="%UD_INSTALL_DIR%\options\guiopts.lua" value="13987" hostname="SATELLITE" />
 
<!-- general configuration -->
<install cmd='%ComSpec% /C copy /b /v /y "%SOFTWARE%\UltraDefrag\ud-boot-time.cmd" "%SystemRoot%\system32\ud-boot-time.cmd" &gt;"%TMP%\UltraDefrag.log"' />
<install cmd='%ComSpec% /C copy /b /v /y "%SOFTWARE%\UltraDefrag\guiopts.lua" "%UD_INSTALL_DIR%\options\guiopts.lua" &gt;&gt;"%TMP%\UltraDefrag.log"' />
 
<!-- configuration applied via computer name -->
<install cmd='%ComSpec% /C copy /b /v /y "%SOFTWARE%\UltraDefrag\ud-boot-time_%COMPUTERNAME%.cmd" "%SystemRoot%\system32\ud-boot-time.cmd" &gt;&gt;"%TMP%\UltraDefrag.log"' >
<condition>
<check type="file" condition="exists" path="%SOFTWARE%\UltraDefrag\ud-boot-time_%COMPUTERNAME%.cmd"/>
</condition>
</install>
 
<!-- configuration applied via operating system version -->
<install cmd='%ComSpec% /C copy /b /v /y "%SOFTWARE%\UltraDefrag\guiopts_WinNT5x.lua" "%UD_INSTALL_DIR%\options\guiopts.lua" &gt;&gt;"%TMP%\UltraDefrag.log"' >
<condition>
<check type="host" condition="os" value="5\.\d\.\d{4}"/>
</condition>
</install>
 
<upgrade include="install" />
<downgrade include="install" />
 
<remove cmd='%ComSpec% /c if exist "%SystemRoot%\system32\ud-boot-time.cmd" del /f /q "%SystemRoot%\system32\ud-boot-time.cmd"' />
<remove cmd='%ComSpec% /c if exist "%UD_INSTALL_DIR%\options\guiopts.lua" del /f /q "%UD_INSTALL_DIR%\options\guiopts.lua"' />
</package>
</source>
0
edits