Difference between revisions of "UltraDefrag"

From WPKG | Open Source Software Deployment and Distribution
Jump to: navigation, search
(added example boot time script)
m (Enable boot time processing after WPKG changed something)
Line 86: Line 86:
 
</package>
 
</package>
 
</source>
 
</source>
 +
  
 
It is recommended to use a boot time script that turns off boot time processing when finished.
 
It is recommended to use a boot time script that turns off boot time processing when finished.

Revision as of 14:07, 10 November 2012

Silent installer for UltraDefrag - An Open Source Defragmenter, a disk defragmentation tool with boot time, console and GUI interface.

It uses the NSIS installer, see the UltraDefrag handbook for a list of supported installer command line switches.


Micro Edition (Console Version)

This installs the appropriate version based on the Windows architecture.

<package id="UltraDefrag" name="Ultra Defragmenter" revision="%PKG_VERSION%" reboot="false" priority="10">
    <variable name="PKG_VERSION"       value="5.1.0" />
    <variable name="PKG_ARCHITECTURE"  value="%PROCESSOR_ARCHITECTURE%"/>
    <variable name="PKG_ARCHITECTURE"  value="i386" architecture="x86"/>
    <variable name="PKG_SOURCE"        value="%SOFTWARE%\UltraDefrag\ultradefrag-%PKG_VERSION%.bin.%PKG_ARCHITECTURE%.exe"/>
    <variable name="PKG_DESTINATION"   value="%ProgramFiles%\UltraDefrag"/>
    <variable name="PKG_REMOVE_SWITCH" value="/S _?=%PKG_DESTINATION%"/>

    <!-- install the micro edition -->
    <variable name="PKG_INSTALL_SWITCH" value='/S /MICRO=1' />

    <check type="uninstall" condition="versiongreaterorequal" path="Ultra Defragmenter" value="%PKG_VERSION%" />

    <install cmd='"%PKG_SOURCE%" %PKG_INSTALL_SWITCH% /D=%PKG_DESTINATION%' />

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

    <remove cmd='"%PKG_DESTINATION%\uninstall.exe" %PKG_REMOVE_SWITCH%' />
    <remove cmd='%ComSpec% /C if exist "%PKG_DESTINATION%\uninstall.exe" del /f /q "%PKG_DESTINATION%\uninstall.exe"' />
    <remove cmd='%ComSpec% /C if exist "%PKG_DESTINATION%" rmdir /q /s "%PKG_DESTINATION%"' />
</package>


Standard Edition (Gui Version)

Set the default language with the /LANG installer command line switch depending on the system language.

<package id="UltraDefrag" name="Ultra Defragmenter" revision="%PKG_VERSION%" reboot="false" priority="10">

    <variable name="PKG_VERSION"       value="5.1.0" />
    <variable name="PKG_ARCHITECTURE"  value="%PROCESSOR_ARCHITECTURE%"/>
    <variable name="PKG_ARCHITECTURE"  value="i386" architecture="x86"/>
    <variable name="PKG_SOURCE"        value="%SOFTWARE%\UltraDefrag\ultradefrag-%PKG_VERSION%.bin.%PKG_ARCHITECTURE%.exe"/>
    <variable name="PKG_DESTINATION"   value="%ProgramFiles%\UltraDefrag"/>
    <variable name="PKG_REMOVE_SWITCH" value="/S _?=%PKG_DESTINATION%"/>

    <!-- default language is English -->
    <variable name="PKG_LANG" value="English (US)"/>

    <!-- overwrite default language for German systems -->
    <variable name="PKG_LANG" value="German" lcidOS="407,c07,1407,1007,807"/>

    <!-- install everything -->
    <variable name="PKG_INSTALL_SWITCH" value='/S /LANG="%PKG_LANG%" /FULL=1' />

    <!-- install only start menu icon for Windows 7 and above -->
    <variable name="PKG_INSTALL_SWITCH" value='%PKG_INSTALL_SWITCH% /ICONS=0 /STARTMENUICON=1' os="6\.[1-9]\.\d{4}"/>

    <check type="uninstall" condition="versiongreaterorequal" path="Ultra Defragmenter" value="%PKG_VERSION%" />

    <install cmd='"%PKG_SOURCE%" %PKG_INSTALL_SWITCH% /D=%PKG_DESTINATION%' />

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

    <remove cmd='"%PKG_DESTINATION%\uninstall.exe" %PKG_REMOVE_SWITCH%' />
    <remove cmd='%ComSpec% /C if exist "%PKG_DESTINATION%\uninstall.exe" del /f /q "%PKG_DESTINATION%\uninstall.exe"' />
    <remove cmd='%ComSpec% /C if exist "%PKG_DESTINATION%" rmdir /q /s "%PKG_DESTINATION%"' />
</package>


Enable boot time processing after WPKG changed something

It is not recommended to defragment a disk very often, since this will heavily reduce the lifetime of the disk.

<package id="UltraDefragEnable" name="Ultra Defragmenter Enable Boot Scan" revision="2010.02.19" reboot="false" execute="changed">
    <depends package-id="UltraDefrag"/>

    <install cmd='%ComSpec% /C "%SystemRoot%\system32\bootexctrl.exe" /r defrag_native' />
    <remove cmd='%ComSpec% /C if exist "%SystemRoot%\system32\bootexctrl.exe" "%SystemRoot%\system32\bootexctrl.exe" /u defrag_native' />
</package>


It is recommended to use a boot time script that turns off boot time processing when finished.

@echo off
;--------------------------------------------------------------------
;                UltraDefrag Boot Time Shell Script
;--------------------------------------------------------------------
; !!! NOTE: THIS FILE MUST BE SAVED IN UNICODE (UTF-16) ENCODING !!!
;--------------------------------------------------------------------

; set processing time limit to one hour
set UD_TIME_LIMIT=1h

; quick optimize the system drive
udefrag %SystemDrive% -q

; disable boot time scan
boot-off

; terminate the execution
exit