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: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]
         QAContact: wpkg-users@lists.sourceforge.net


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.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
wpkg-users mailing list
wpkg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wpkg-users

Reply via email to