[wpkg-users] [Bug 32] New: Server(s)/drive letter enhancement

bugzilla-daemon at wpkg.org bugzilla-daemon at wpkg.org
Thu Aug 17 21:42:54 CEST 2006


Please reply using this URL only: http://bugs.wpkg.org/show_bug.cgi?id=32

           Summary: Server(s)/drive letter enhancement
           Product: WPKG
           Version: other
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: wpkg.js
        AssignedTo: mangoo at mch.one.pl
        ReportedBy: paul.tietjens at moriarty.k12.nm.us
         QAContact: wpkg-users at lists.wpkg.org


For some time now we've been using WPKG to distribute software to our remote sites.

Because the WAN is heavily restricted in bandwidth, we use a replicated (rsync)
repository of software, and common paths.  For various reasons, we're mapping
drive letters to do this.

The attached patch adds an argument (/server:<server>) to map drive O: to.

In it's current state this is a dirty hack, but with a little cleanup, someone
out there might make use of it.

Sorry, I've never used Bugzilla before!  I'll just paste the patch here. :(

--- wpkg-0.9.10/wpkg.js 2006-07-10 12:47:14.000000000 -0600
+++ wpkg.js     2006-08-17 12:56:39.200304810 -0600
@@ -199,6 +199,33 @@
     if (isArgSet(argv, "/nonotify")) {^M
         nonotify = true;^M
     }^M
+    ^M
+    // if the user passes /server, we know to map a drive^M
+    //if (isArgSet(argv, "/server")) {^M
+    try {^M
+        strLogonServer = argv.Named("server");^M
+       //MY Hack to find logon server - Paul^M
+       msg = "Server: " + strLogonServer;^M
+       alert(msg);^M
+       var WshNetwork = WScript.CreateObject("WScript.Network");^M
+       var colDrives = WshNetwork.EnumNetworkDrives();^M
+       for (i = 0; i < colDrives.length; i += 2) {^M
+               if (colDrives(i) == "O:") {^M
+                       WshNetwork.RemoveNetworkDrive("O:", true, true);^M
+                       var strDelled = "yes";^M
+               }^M
+       }^M
+       var strNetPath = "\\\\" + strLogonServer + "\\applications";^M
+       alert(strNetPath);^M
+       WshNetwork.MapNetworkDrive("O:", strNetPath);^M
+    //}^M
+    }^M
+    catch(err)^M
+    {^M
+        msg ="Error occurred\nCode: " + hex(err.number) + "Descriptions:" +
err.description;^M
+       alert(msg);^M
+         }^M
+^M
 ^M
     // if the user passes /noreboot, we don't want to reboot^M
     if (isArgSet(argv, "/noreboot")) {^M
@@ -2475,6 +2502,25 @@
  * Ends program execution with the specified exit code.^M
  */^M
 function exit(exitCode) {^M
+/**^M
+ * This removes network drives after the script runs.^M
+ */^M
+try {^M
+        var WshNetwork = WScript.CreateObject("WScript.Network");^M
+        var colDrives = WshNetwork.EnumNetworkDrives();^M
+        for (i = 0; i < colDrives.length; i += 2) {^M
+          if (colDrives(i) == "O:") {^M
+            WshNetwork.RemoveNetworkDrive("O:", true, true);^M
+            var strDelled = "yes";^M
+          }^M
+        }^M
+}^M
+    catch(err)^M
+    {^M
+        msg ="Error occurred\nCode: " + hex(err.number) + "Descriptions:" +
err.description;^M
+       alert(msg);^M
+         }^M
+^M
     if (exportRunningState) {^M
        // reset running state ^M
        setRunningState("false");^M

-- 
Configure bugmail: http://bugs.wpkg.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.






_______________________________________________
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