[wpkg-users] Registry Status Message

Michael J. Kidd wpkg at linuxkidd.com
Tue Jan 23 20:37:49 CET 2007


I have 2 requests for the WPKG Project ( ok.. there's more than that,
but here's the most pressing! :) )

My desire is for the WPKG Installer to delay logon as long as the
WPKG.js process is still running.. Not just X configurable minutes (
maybe an option to do either is in order ).  And, I would love it if the
User message that's displayed has feedback on what WPKG.js is currently
doing ( along with how long it's been doing it ).

My solution:
The delay dilemma  can be addressed by watching the
HKLM\Software\WPKG\running Registry Key ( already supplied by WPKG.js ).
The feedback could be address by adding a new key to the WPKG.js
proccess.. ( I propose HKLM\Software\WPKG\current ).

The timer could be easily managed by adding a time since last change
variable in the WPKG Installer code, and output that every second to the
status screen it displays.  Suggesting a 'previous_message' comparison
to 'current_message' and then resetting the timer when those two don't
match, as well as updating the status message when they change to
reflect the new task.

I've done the easy part... I added the registry key code to wpkg.js.
But, I've gotta admit.. my Win32 C++ skills are a lil rusty..  Would
greatly appreciate the WPKG-Installer maintainer adapting the code to
accommodate this request before I dig out some C++ reference material
and hack it up.. :)

Thanks!
Michael J. Kidd

Patch against 0.9.10 version of wpkg.js follows:

--- wpkg-orig.js        2007-01-23 14:17:29.000000000 -0500
+++ wpkg.js     2007-01-23 14:22:52.000000000 -0500
@@ -147,6 +147,7 @@
var sRegPath = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
// here we indicate our running state
var sRegWPKG_Running = "HKLM\\Software\\WPKG\\running";
+var sRegWPKG_Current = "HKLM\\Software\\WPKG\\current";


/*******************************************************************************
@@ -973,6 +974,18 @@
     return val;
}

+function setCurrentState(statename) {
+    var WshShell = new ActiveXObject("WScript.Shell");
+    var val;
+
+    try {
+        val = WshShell.RegWrite(sRegWPKG_Current, statename);
+    } catch (e) {
+        val = null;
+    }
+
+    return val;
+}

/**
  * Scans uninstall list for given name.
@@ -2291,6 +2304,7 @@
  * Logs or presents an info message depending on interactivity.
  */
function info(message) {
+    setCurrentState(message);
     if (quiet) {
         log(4, message);
     } else {







_______________________________________________
wpkg-users mailing list
wpkg-users at lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/wpkg-users



More information about the wpkg-users mailing list