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

Daniel Dehennin daniel.dehennin at ac-caen.fr
Fri Jul 8 15:43:04 CEST 2011


Daniel Dehennin <daniel.dehennin at ac-caen.fr> writes:

> Hello,

Hello,


[...]

>
> * 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
>     shutdown

I forgot some settings, here is my postinstall.cmd:

#v+ postinstall.cmd
@echo off

REM Do not export variables
SETLOCAL

SET CMD_PATH=%~dp0

echo Stop WPKG service
%ComSpec% /c sc stop wpkgservice > NUL

echo Suppress winlogon notification at startup
%ComSpec% /c reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Notify\WPKGLogon" /v "Startup" /f > NUL 2> NUL

echo Manual start of WPKG
%ComSpec% /c sc config wpkgservice start= demand > NUL

echo Show script at shutdown
%ComSpec% /c reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "HideShutdownScripts" /t REG_DWORD /d "0" /f > NUL

echo Windows in verbose mode
%ComSpec% /c reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "VerboseStatus" /t REG_DWORD /d "1" /f > NUL

echo Put the policy in place
%ComSpec% /c xcopy /E /V /I /Q /H /N /Y "%CMD_PATH%\grouppolicy\*" "%windir%\system32\grouppolicy\"
%ComSpec% /c reg import "%CMD_PATH%\gpo_wpkg.reg"

REM End of local variables
ENDLOCAL

REM Local Variables:
REM mode: cmd
REM comment-start: "REM "
REM comment-end: ""
REM End:
#v-

-- 
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/20110708/7c8bdb74/attachment.pgp>


More information about the wpkg-users mailing list