[wpkg-users] Handling Win7 and WinXP with run on shutdown

Daniel Dehennin daniel.dehennin at ac-caen.fr
Fri May 13 09:14:33 CEST 2011


We try to handle the run of WPKG at shutdown in the same way for win7
and winxp.

Here is a working setup:

* Use <run-on-shutdown>NO</run-on-shutdown> in settings.xml
* At install time:
  - stop the WPGK service: sc stop wpkgservice
  - configure it to start manually: sc config wpkgservice start= demand
  - add the registry setting to display script during shutdown:
    REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "HideShutdownScripts" /t REG_DWORD /d "0" /f
  - setup the GPO to run a script at shutdown[1]
  - use nomousy.exe to prevent user from closing the window displayed at

The <logon-delay> control how long the message box is diplay at the end,
by default, more than 10 minutes is useless since windows limit the
shutdown delay to 10 minutes.

The script launched at shutdown is the following:

@echo off

Echo *** WPKG : mises a jour des applications en cours ***
Echo ***               Veuillez patienter              ***

REM disable mouse
start /b /d "%windir%" nomousy /f -h

REM Start WPKG service
sc start wpkgservice > NUL

REM Start WPKG message box
start /B /wait /d "%programfiles%\wpkg" wpkgmessage.exe
Echo ***              Fin des mises a jour             ***

REM Little pause to let WPKG complete write of the log file on the
REM server
ping -n 2 localhost >NUL


[1]  Wonder how to automate this, for now copy some files under
     "%windir%\system32\grouppolicy\" and import a reg

Daniel Dehennin
RAIP de l'Orne
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.wpkg.org/pipermail/wpkg-users/attachments/20110513/ed66f9ca/attachment.sig>

More information about the wpkg-users mailing list