Changes for page WPKG
Last modified by Sebastian Marsching on 2022/05/29 14:08
From version 1.1
edited by Sebastian Marsching
on 2022/05/29 12:23
on 2022/05/29 12:23
Change comment:
Uploaded new attachment "wpkg-extra-status.js", version {1}
To version 2.1
edited by Sebastian Marsching
on 2022/05/29 12:24
on 2022/05/29 12:24
Change comment:
Uploaded new attachment "wpkg.js-extra-status.patch", version {1}
Summary
-
Attachments (0 modified, 1 added, 0 removed)
Details
- wpkg.js-extra-status.patch
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.SebastianMarsching - Size
-
... ... @@ -1,0 +1,1 @@ 1 +2.6 KB - Content
-
... ... @@ -1,0 +1,89 @@ 1 +--- wpkg.js.orig 2011-12-08 14:03:00.000000000 +0100 2 ++++ wpkg.js 2014-01-29 21:06:57.000000000 +0100 3 +@@ -345,6 +345,8 @@ 4 + 5 + /** registry path where WPKG stores its running state */ 6 + var sRegWPKG_Running = "HKLM\\Software\\WPKG\\running"; 7 ++/** registry path where WPKG stores its status message */ 8 ++var sRegWPKG_StatusMessage = "HKLM\\Software\\WPKG\\statusMessage"; 9 + 10 + /** configuration file to hold the settings for the script */ 11 + var config_file_name = "config.xml"; 12 +@@ -672,6 +674,11 @@ 13 + // Initialize WPKG internals. 14 + initialize(); 15 + 16 ++ // Set running state in registry. 17 ++ if (!isNoRunningState()) { 18 ++ setRunningState("true"); 19 ++ } 20 ++ 21 + // Process command line arguments to determine course of action. 22 + // Get special purpose argument lists. 23 + var argv = getArgv(); 24 +@@ -5468,6 +5475,7 @@ 25 + 26 + // print event log entry 27 + info("Installing '" + packageName + "' (" + packageID + ")..."); 28 ++ setRegistryStatusMessage("Installing " + packageName); 29 + logStatus("Performing operation (" + installType + ") on '" + packageName + "' (" + packageID + ")"); 30 + 31 + // stores if the package needs a reboot after installation 32 +@@ -5658,6 +5666,9 @@ 33 + // clean downloads 34 + downloadsClean(downloadNodes); 35 + 36 ++ // reset status message in registry 37 ++ setRegistryStatusMessage(""); 38 ++ 39 + // restore old environment 40 + dinfo("Restoring previous environment."); 41 + // restore previous environment 42 +@@ -6513,6 +6524,7 @@ 43 + 44 + try { 45 + info("Removing " + packageName + " (" + packageID + ")..."); 46 ++ setRegistryStatusMessage("Removing " + packageName); 47 + 48 + // select command lines to remove 49 + var cmds = getPackageCmdRemove(packageNode, null); 50 +@@ -6655,6 +6667,9 @@ 51 + // restore old environment 52 + dinfo("Restoring previous environment."); 53 + 54 ++ // reset status message in registry 55 ++ setRegistryStatusMessage(""); 56 ++ 57 + // restore previous environment 58 + loadEnv(previousEnv); 59 + } 60 +@@ -7243,6 +7258,28 @@ 61 + } 62 + 63 + /** 64 ++ * Write information about current action so other applications can see what is 65 ++ * happening by reading from the registry. 66 ++ * 67 ++ * @param statusmessage 68 ++ * String which is written to the registry as a value of the 69 ++ * "statusMessage" key 70 ++ */ 71 ++function setRegistryStatusMessage(statusmessage) { 72 ++ if (isNoRunningState()) { 73 ++ return; 74 ++ } 75 ++ 76 ++ var WshShell = new ActiveXObject("WScript.Shell"); 77 ++ 78 ++ try { 79 ++ WshShell.RegWrite(sRegWPKG_StatusMessage, statusmessage); 80 ++ } catch (e) { 81 ++ // Ignore error 82 ++ } 83 ++} 84 ++ 85 ++/** 86 + * Sets new value for the sendStatus flag which defines if status messages are 87 + * sent to the calling program using STDOUT 88 + * 89 +