[wpkg-users] Disabling pagefile, complex registry checks troubles...

Marco Gaiarin gaio at sv.lnf.it
Fri Jan 16 11:52:42 CET 2015


I've wrote that recipe todisable pagefile:

 <package
        id="7tweaks-disable-pagefile"
        name="Seven Registry tweaks: Disable Pagefile"
        revision="20150116:1"
        reboot="postponed"
        priority="5">

        <!-- Non so come fare la check condition in hex... uso un trucchetto per cui se il pagefile è
                in automatico la chiave è REG_SZ, altrimenti è REG_MULTI_SZ... -->   
        <check type='execute' path='reg query "HKLM\System\CurrentControlSet\Control\Session Manager\Memory Management" /v "PagingFiles" /t REG_MULTI_SZ' condition='exitcodeequalto' value='0' />

        <install cmd='wmic computersystem set AutomaticManagedPagefile=False' />
        <install cmd='wmic pagefileset delete' />

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

        <remove cmd='wmic computersystem set AutomaticManagedPagefile=True' />
 </package>

and works as expected, but only because if 'AutomaticManagedPagefile'
is enabled, the value 'PagingFiles' is of type REG_SZ, not
'REG_MULTI_SZ'.

The correct check is about PagingFiles to be:

	"PagingFiles"=hex(7):00,00

(\0 is the filed separator in REG_MULTI_SZ, and that value is the
''null'' value for REG_MULTI_SZ, as you can determine simply creating
an empty REG_MULTI_SZ value)


How to implement in WPKG? Thanks.

-- 
dott. Marco Gaiarin				        GNUPG Key ID: 240A3D66
  Associazione ``La Nostra Famiglia''                    http://www.sv.lnf.it/
  Polo FVG   -   Via della Bontà, 7 - 33078   -   San Vito al Tagliamento (PN)
  marco.gaiarin(at)lanostrafamiglia.it   t +39-0434-842711   f +39-0434-842797

		Dona il 5 PER MILLE a LA NOSTRA FAMIGLIA!
    http://www.lanostrafamiglia.it/25/index.php/component/k2/item/123
	(cf 00307430132, categoria ONLUS oppure RICERCA SANITARIA)



More information about the wpkg-users mailing list