[wpkg-users] [OT] i hate script in cmd... ;(((

Marco Gaiarin gaio at sv.lnf.it
Wed Feb 15 09:42:28 CET 2012


Mandi! k2
  In chel di` si favelave...

> Have you tried to add %ComSpec% /c in front of main command?

Yess, nothing changed.


> Could you show the package xml with cmd= ?

Of course.

 <package
        id="sudowin-settings"
        name="Sudo for Windows settings"
        revision="20120214:2"
        reboot="false"
        priority="5" >
        <depends package-id="sudowin" />

        <check type="logical" condition="and">
                <check type="logical" condition="or">
                        <check type="logical" condition="not">
                                <check type="file" condition="exists" path='%WPKGROOT%\packages\sudowin\sudoers-%COMPUTERNAME%.xml' />
                        </check>
                        <check type="file" condition="datemodifyequalto" path="%WPKGROOT%\packages\sudowin\sudoers-%COMPUTERNAME%.xml" value="@%ProgramFiles%\Sudowin\Server\sudoers.xml" />
                </check>
                <check type="file" condition="datemodifyequalto" path="%WPKGROOT%\packages\sudowin\sudoers-%DOMAIN%.xml" value="@%ProgramFiles%\Sudowin\Server\sudoers.xml" />
                <check type="logical" condition="or">
                        <check type="logical" condition="not">
                                <check type="file" condition="exists" path='%WPKGROOT%\packages\sudowin\sudoers-%COMPUTERNAME%.grp' />
                        </check>
                        <check type="logical" condition="and">
                                <check type="file" condition="datemodifyolderthan" path="%WPKGROOT%\packages\sudowin\sudoers-%COMPUTERNAME%.grp" value="@%SystemRoot%\system32\wpkg.old" />
                                <check type="execute" path='"%WPKGROOT%\tools\setlgrp.bat" check \"%WPKGROOT%\packages\sudowin\sudoers-%COMPUTERNAME%.grp\" %DOMAIN%' condition="exitcodeequalto" value="0" />
                        </check>
                </check>
                <check type="execute" path='"%WPKGROOT%\tools\setlgrp.bat" check \"%WPKGROOT%\packages\sudowin\sudoers-%DOMAIN%.grp\" %DOMAIN%' condition="exitcodeequalto" value="0" />
        </check>

        <install cmd='"%WPKGROOT%\tools\setlgrp.bat" add \"%WPKGROOT%\packages\sudowin\sudoers-%DOMAIN%.grp\" %DOMAIN%' />
        <install cmd='%COMSPEC% /c if exist "%WPKGROOT%\packages\sudowin\sudoers-%COMPUTERNAME%.grp" "%WPKGROOT%\tools\setlgrp.bat" add \"%WPKGROOT%\packages\sudowin\sudoers-%COMPUTERNAME%.grp\" %DOMAIN%' />
        <install cmd='%COMSPEC% /c copy /y "%WPKGROOT%\packages\sudowin\sudoers-%DOMAIN%.xml" "%ProgramFiles%\Sudowin\Server\sudoers.xml"' />
        <install cmd='%COMSPEC% /c if exist "%WPKGROOT%\packages\sudowin\sudoers-%COMPUTERNAME%.xml" copy /y "%WPKGROOT%\packages\sudowin\sudoers-%COMPUTERNAME%.xml" "%ProgramFiles%\Sudowin\Server\sudoers.xml"' />

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

        <remove cmd='%COMSPEC% /c if exist "%WPKGROOT%\packages\sudowin\sudoers-%COMPUTERNAME%.grp" "%WPKGROOT%\tools\setlgrp.bat" delete \"%WPKGROOT%\packages\sudowin\sudoers-%COMPUTERNAME%.grp\" %DOMAIN%' />
        <remove cmd='"%WPKGROOT%\tools\setlgrp.bat" delete \"%WPKGROOT%\packages\sudowin\sudoers-%DOMAIN%.grp\" %DOMAIN%' />
        <remove cmd='%COMSPEC% /c del /f /q "%ProgramFiles%\Sudowin\Server\sudoers.xml"' />
 </package>

Rather complex. The rationale of these stuff are that there's at least
a per-domain configuration, but can be ''enhanced'' by an per-host
configuration.


> On which system did you try your script? Is it Seven? Is UAC active?

Ops, sorry, no. win xp sp3.


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)sv.lnf.it	  tel +39-0434-842711  fax +39-0434-842797

		Dona il 5 PER MILLE a LA NOSTRA FAMIGLIA!
	   http://www.lanostrafamiglia.it/chi_siamo/5xmille.php
	(cf 00307430132, categoria ONLUS oppure RICERCA SANITARIA)



More information about the wpkg-users mailing list