PowerOff

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

Silent installer for PowerOff.

This package is appropriate for 32 and 64-bit Windows, that is the reason why it gets installed in %SystemRoot%\system32. I use the package poweroff_v3_task to be installed daily on midnight (see Installation instructions - advanced) and at system startup (using GPO). This is how the settings for PowerOff are renewed every day, if the user changed them. Optionally a user can create a file: %SystemDrive%\poweroff_off that prevents the daily (re)configuration of PowerOff shutdown service.

<?xml version="1.0" encoding="UTF-8"?>
<packages>
  <package id="poweroff_v3" 
    name="PowerOff v3.0" 
    revision="0" 
    reboot="false" 
    priority="100">

	<check type="file" condition="exists" path="%SystemRoot%\system32\poweroff.exe" />

	<install cmd='%COMSPEC% /c IF NOT EXIST "%SystemRoot%\system32\poweroff.exe" copy /y /v "%SOFTWARE%\PowerOff v3\poweroff.exe" "%SystemRoot%\system32"' />
	<remove cmd='"%SystemRoot%\system32\poweroff.exe" -remove_service' />
	<remove cmd='%COMSPEC% /c del /f "%SystemRoot%\system32\poweroff.exe"' />
  </package> 
 
  <package id="poweroff_v3_task" 
    name="PowerOff v3.0 - task" 
    revision="0" 
    reboot="false" 
    priority="100"
    execute="always">

	<depends package-id="poweroff_v3" /> 

	<variable name='POWEROFF_DAYS' value='m,t,w,th,f,s,su' />
	<variable name='POWEROFF_TIME' value='17:30' />
	<variable name='POWEROFF_WARNTIME' value='1800' />
	<variable name='POWEROFF_MESSAGE' value='Vaš računalnik se bo samodejno ugasnil v 30 minutah.\nČe tega ne želite pritisnite Cancel.' />

	<install cmd='%COMSPEC% /c IF EXIST "%SystemDrive%\poweroff_off" exit 1' />
        <install cmd='"%SystemRoot%\system32\poweroff.exe" -remove_service' />
	<install cmd='"%SystemRoot%\system32\poweroff.exe" -warn -warntime %POWEROFF_WARNTIME% -msg "%POWEROFF_MESSAGE%" -force -scheduled -time %POWEROFF_TIME% -days %POWEROFF_DAYS% -create_service' />

	<remove cmd='%COMSPEC% /c IF EXIST "%SystemDrive%\poweroff_off" del /f "%SystemDrive%\poweroff_off"' />
  </package>
</packages>