Stefan, thanks for the fix. I applied the fix and tested it, it worked and so far I haven't had any problems.<br><br>One of the changes I noticed in 1.1 the prepending @COMSPEC /C on commands. Since I recently started using WPKG and posting to this group I missed the discussion on this, but I have to wonder why <br>
<br>cmd = '%COMSPEC% /s /c "' + cmd + '"';<br><br>wasn't used instead. Does this have some unintentional side effects? Obviously it would break some install scripts out there, but so did the addition of @comspec /c. Not that I'm complaining, I think this is a good move, I just hate having to keep track of those special circumstances when I need to wrap the whole command in double quotes.<br>
<br><br>I wrote a tiny little AutoIT3 wrapper around wpkg.js to throw up some GUI buttons for commonly used functions and I have found very handy when testing. And my Jr. admins like it when they want to quickly check what's installed on someone's machine. Anyway I figured that maybe I should post it on here just in case someone else finds it useful. Save it as a .au3 file and place it into the same directory as wpkg.js<br>
<br><br>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>; wpkg_tool<br>; program to help in launching wpkg interactively<br>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>
<br>#include <GUIConstantsEx.au3><br>#include <WindowsConstants.au3><br><br><br>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>; main<br>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>
<br>$wpkg_client_settings = @ScriptDir & "\settings.xml"<br>$wpkg_client_installer = "\\mydomain\soft\sys\WPKG Client v1.3.6\WPKG Client 1.3.6.msi"<br><br>$args = "/synchronize "<br><br>; create GUI menu<br>
GUICreate("WPKG Tool", 120, 460, -1, -1, -1, $WS_EX_TOOLWINDOW)<br>$custom = GUICtrlCreateButton("&Custom", 10, 10, 100)<br>GUICtrlSetState( -1, $GUI_DEFBUTTON )<br><br>$debug = GUICtrlCreateButton("&Debug Sync", 10, 60, 100)<br>
$debugf = GUICtrlCreateButton("&Debug Force Sync", 10, 90, 100)<br>$dryrun = GUICtrlCreateButton("Dry &Run Sync", 10, 120, 100)<br>$quiet = GUICtrlCreateButton("&Quiet Sync", 10, 150, 100)<br>
<br>$lall = GUICtrlCreateButton("&List All", 10, 200, 100)<br>$linst = GUICtrlCreateButton("List Installed", 10, 230, 100)<br>$luninst = GUICtrlCreateButton("List Not Installed", 10, 260, 100)<br>
$lup = GUICtrlCreateButton("List Upgradable", 10, 290, 100)<br> <br>$inst = GUICtrlCreateButton("&Install Client", 10, 340, 100)<br><br>$help = GUICtrlCreateButton("&Help", 10, 390, 100)<br>
$cancel = GUICtrlCreateButton("Ca&ncel", 10, 420, 100)<br> <br>GUISetState( @SW_SHOW )<br>While 1<br> $msg = GUIGetMsg()<br> Select<br> Case $msg == $debug<br> $args &= "/debug"<br>
ExitLoop<br> Case $msg == $debugf<br> $args &= "/debug /force"<br> ExitLoop<br> Case $msg == $dryrun<br> $args &= "/dryrun"<br> ExitLoop<br>
Case $msg == $quiet<br> Run( "wscript " & @ScriptDir & "\wpkg.js /synchronize /quiet" )<br> Exit<br> Case $msg == $lall<br> $args = "/query:a | more"<br>
ExitLoop<br> Case $msg == $linst<br> $args = "/query:i | more"<br> ExitLoop<br> Case $msg == $luninst<br> $args = "/query:x | more"<br> ExitLoop<br>
Case $msg == $lup<br> $args = "/query:u | more"<br> ExitLoop<br> Case $msg == $custom<br> $custargs = InputBox( "WPKG args", "Enter arguments for WPKG below:" )<br>
If @error == 0 Then<br> If StringStripWS( $custargs, 8) == "" Then Exit<br> $args = $custargs & " /debug"<br> ExitLoop<br> EndIf<br>
Case $msg == $help<br> $args = "/? | more"<br> ExitLoop<br> Case $msg == $inst<br> Run( 'msiexec /norestart /qb /i "' & $wpkg_client_installer & '" ALLUSERS=1 SETTINGSFILE="' & $wpkg_client_settings & '"' )<br>
Exit<br> Case $msg == $cancel<br> Exit<br> Case $msg = $GUI_EVENT_CLOSE<br> Exit<br> EndSelect<br>WEnd <br><br>$cmd = "cscript " & @ScriptDir & "\wpkg.js " & $args<br>
Run( @ComSpec & ' /c ' & $cmd & ' & pause' )<br><br><br><div class="gmail_quote">On Tue, Jun 9, 2009 at 1:24 PM, Rainer Meier <span dir="ltr"><<a href="mailto:r.meier@wpkg.org">r.meier@wpkg.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi both,<br>
<div class="im"><br>
Pendl Stefan wrote:<br>
> Chris Allen wrote:<br>
> <variable name='cygroot' value='%SYSTEMDRIVE%\cygwin' /><br>
> <check type="file" condition="exists" path="%cygroot%\Cygwin.bat" /><br>
> The problem appears only when using nested variables. These examples work fine:<br>
><br>
> <variable name='cygroot' value='C:\cygwin\cygwin' /><br>
> <check type="file" condition="exists" path="%cygroot%\Cygwin.bat" /><br>
><br>
> Or:<br>
><br>
> <check type="file" condition="exists" path="%SYSTEMDRIVE%\cygwin\Cygwin.bat" /><br>
</div>...<br>
<div class="im"><br>
> // --- insert this<br>
><br>
> var shell = new ActiveXObject("WScript.Shell");<br>
> variableValue = shell.ExpandEnvironmentStrings(variableValue);<br>
><br>
> // --- end insert<br>
><br>
</div>...<br>
<br>
The proposal actually looks good. I hope it's not having some strange<br>
side-effects. But immediately expanding variables could make sense here. So I've<br>
added this change to WPKG 1.1.1-RC2. You might get it from here:<br>
<br>
<<a href="http://wpkg.svn.sourceforge.net/viewvc/wpkg/wpkg/stable/1.1/wpkg.js?view=log" target="_blank">http://wpkg.svn.sourceforge.net/viewvc/wpkg/wpkg/stable/1.1/wpkg.js?view=log</a>><br>
<br>
Or download Revision 77 directly from here:<br>
<br>
<<a href="http://wpkg.svn.sourceforge.net/viewvc/wpkg/wpkg/stable/1.1/wpkg.js?revision=77" target="_blank">http://wpkg.svn.sourceforge.net/viewvc/wpkg/wpkg/stable/1.1/wpkg.js?revision=77</a>><br>
<br>
<br>
It contains a bunch of other fixes/enhancements too:<br>
<br>
NEW: Added a new switch: /noUpgraeBeforeRemove.<br>
This switch allows to disable the upgrade-before-remove feature.<br>
Usually WPKG upgrades a package to the latest available version before it<br>
removes the package. This allows administrators to fix bugs in the package<br>
and assure proper removal.<br>
However this feature can lead to (sometimes unexpected) re-execution of<br>
packages. For example if execution=always is used the package will run<br>
once again before it is finally removed.<br>
It's advised to leave this option on default unless you really know what<br>
you're doing.<br>
Thanks to Simon.<br>
MOD: Fixed typo in in database-inconsistency message. Thanks to Gerd Ott.<br>
MOD: Changed Wording after successful installation of a package.<br>
Thanks to Simon.<br>
MOD: Enhanced variable expansion within <variable /> nodes. If the value<br>
contains shell variables they are expanded immediately.<br>
Thanks to Chris Allen for reporting and Stefan Pendl for fix suggestion.<br>
<br>
<br>
@Simon: If you read this you probably noticed that it also contains a change for<br>
you which allows to disable the upgrade-before-remove feature. You might test it<br>
and give feedback if it serves your needs.<br>
<br>
<br>
If it works fine I will release it soon.<br>
<br>
br,<br>
<font color="#888888">Rainer<br>
</font><div><div></div><div class="h5">-------------------------------------------------------------------------<br>
wpkg-users mailing list archives >> <a href="http://lists.wpkg.org/pipermail/wpkg-users/" target="_blank">http://lists.wpkg.org/pipermail/wpkg-users/</a><br>
_______________________________________________<br>
wpkg-users mailing list<br>
<a href="mailto:wpkg-users@lists.wpkg.org">wpkg-users@lists.wpkg.org</a><br>
<a href="http://lists.wpkg.org/mailman/listinfo/wpkg-users" target="_blank">http://lists.wpkg.org/mailman/listinfo/wpkg-users</a><br>
</div></div></blockquote></div><br>