--- wpkg.js.orig	2006-06-24 17:09:16.000000000 +0200
+++ wpkg.js	2006-06-24 17:35:40.000000000 +0200
@@ -234,8 +234,8 @@
     
     if (argn("rebootcmd") != null) {
         rebootCmd=(argn("rebootcmd"));
-        dinfo("Reboot-Cmd is " + rebootCmd +".");
     }
+    dinfo("Reboot-Cmd is " + rebootCmd +".");
     
     // want to export the state of WPKG to registry?
     if (isArgSet(argv, "/norunningstate")) {
@@ -252,14 +252,14 @@
     host = WshNetwork.ComputerName.toLowerCase();
 
     if (argn("base") != null) {
-        base = argn("base");
-        var base = fso.GetAbsolutePathName(base);
+        var base = argn("base");
+        base = fso.GetAbsolutePathName(base);
     } else {
         // use the executing location of the script as the default base path
         var path = WScript.ScriptFullName;
         base = fso.GetParentFolderName(path);
     }
-    
+    dinfo("base directory " + base + ".");
 
     // append the settingsfile names to the end of the base path
     packages_file = fso.BuildPath(base, packages_file_name);
@@ -1083,14 +1083,7 @@
         } // if checkCond == null || checkPath == null
 
         if (checkCond == "exists") {
-            // Display some debugging information
-            var WshShell = new ActiveXObject("WScript.Shell");
-            var val;
-            try {
-                val = WshShell.RegRead(checkPath);
-            } catch (e) {
-                val = null;
-            }
+            var val = getRegistryValue(checkPath);
 
             if (val != null) {
                 // Some debugging information
@@ -1102,13 +1095,7 @@
                 return false;
             }
         } else if (checkCond == "equals") {
-            var WshShell = new ActiveXObject("WScript.Shell");
-            var val;
-            try {
-                val = WshShell.RegRead(checkPath);
-            } catch (e) {
-                val = null;
-            }
+            var val = getRegistryValue(checkPath);
 
             if (val == checkValue) {
                 // Some debugging information
@@ -1405,7 +1392,6 @@
     
     // get a list of checks to perform before installation.
     var checkNodes = packageNode.selectNodes("check");
-    var installed = true;
     
     // when there are no check conditions, say "not installed"
     if (checkNodes.length == 0) {
@@ -1416,12 +1402,11 @@
     // if all are successful, we consider package as installed
     for (var i = 0; i < checkNodes.length; i++) {
         if (! checkCondition(checkNodes[i])) {
-            installed = false;
-            //break;
+            return false;
         } 
     }
 
-    return installed;
+    return true;
 }
 
 /**
@@ -1732,7 +1717,7 @@
     }
 
 
-    info("Upgrade of " + newPackageNode.getAttribute("name") + " successful.");
+    info("Upgrade of " + newPackageNode.getAttribute("name") + " to Rev. "+ newPackageNode.getAttribute("revision") + " successful.");
     
     // reboot the system if this package is suppose to
     if (newPackageNode.getAttribute("reboot") == "true") {
@@ -2529,6 +2514,10 @@
         var installedNode       = installedNodes(i);
         var instPackageId       = installedNode.getAttribute("id");
         var instPackageRevision = installedNode.getAttribute("revision");
+        var instPackageExecAttr = installedNode.getAttribute("execute");
+        if (instPackageExecAttr == "") {
+            instPackageExecAttr = "none";
+        }
         for (var j = 0; j < availableNodes.length; j++) {
             var availableNode        = availableNodes(j);
             var availPackageId       = availableNode.getAttribute("id");
@@ -2539,6 +2528,7 @@
                     message += "    ID:           " + instPackageId + "\n";
                     message += "    Old Revision: " + instPackageRevision + "\n";
                     message += "    New Revision: " + availableNode.getAttribute("revision") + "\n";
+                    message += "    ExecAttribs:  " + instPackageExecAttr + "\n";
                     message += "    Status:       updateable\n";
                     message += "\n";
                 }
@@ -2568,14 +2558,19 @@
         var packageReboot   = packageNode.getAttribute("reboot");
         var packageName     = packageNode.getAttribute("name");
         var packageId       = packageNode.getAttribute("id");
+        var packageExecAttr = packageNode.getAttribute("execute");
         if (packageReboot != "true") {
             packageReboot = "false";
         }
+        if (packageExecAttr == "") {
+            packageExecAttr = "none";
+        }
         if (packageName == pack || packageId == pack) {
             message += packageName + "\n";
             message += "    ID:         " + packageId + "\n";
             message += "    Revision:   " + packageNode.getAttribute("revision") + "\n";
             message += "    Reboot:     " + packageReboot + "\n";
+            message += "    ExecAttribs:" + packageExecAttr + "\n";
             if (searchList(settingsNodes, packageNode)) {
                 message += "    Status:     Installed\n";
             } else {
