"Norström, Daniel" <[EMAIL PROTECTED]> writes:

> Hi Shad and Pat,
>  
> I would need to be able to use todo.pl outside building the
> machine. For security reasons, I'm building the machines on a
> separate network and what I would like is to have the possibility to
> install applications on top in the "real" environment.
>  
> What I've done:
>  
> I've copied the todo.pl file over from the \BIN folder to a new
> server with the applications and script I would like to install, but
> when posting jobs to the script it complains over that is hasn't got
> the connection to the Z:\ Drive.  Out of my understanding I don't
> need to have any contact to the Z:\ drive server (except for the
> todo.pl file) since I have the drive where I would like to install
> the applications from mapped from the logon script.

Which drive letter are you using?

The scripts we provide assume %Z% holds the drive letter.  If you want
to use, say, the X: drive instead, you would put this in
C:\netinst\permcreds.bat:

    set Z=X:

If you are using just your own scripts which do not refer to %Z%, then
you are right, this should not be necessary...

> the error code is 
> Unable to GetUNCName for Z:: This network connection does not exist at
> P:\scripts\files\Bin\todo.pl line 185.

...but right now, todo.pl attempts to locate the UNC path for the Z:
drive (as defined by the %Z% variable), so that it can set %Z_PATH%,
which some of our scripts also use.

In addition to causing your problem, this prevents %Z% from being a
local drive.  This in turn gets in the way of (say) using a DVD-ROM
for installation.  So I have fixed it in the next release.

Patch for todo.pl is appended.

 - Pat


--- todo.pl.~1.32.~     2004-01-16 15:02:16.000000000 -0500
+++ todo.pl     2004-03-23 14:21:11.000000000 -0500
@@ -266,9 +266,12 @@
     return $lang_table{$langid};
 }
 
-# Get the UNC path for a networked drive.
+# For input letter X, return the UNC path to which X: is connected.
+# If X is a not a networked drive, return "X:".
+use constant ERROR_NOT_CONNECTED => 2250;
 sub get_drive_path ($) {
     my ($drive) = @_;
+    my $ret;
 
     $drive =~ /^[a-z]:?$/i
         or die "Invalid drive specification $drive";
@@ -277,10 +280,18 @@
     $drive =~ /:$/
         or $drive .= ':';
 
-    my $unc_name;
-    Win32::NetResource::GetUNCName ($unc_name, $drive)
-        or die "Unable to GetUNCName for $drive: $^E";
-    return $unc_name;
+    if (Win32::NetResource::GetUNCName ($ret, $drive)) {
+        # all done
+    }
+    elsif ($^E == ERROR_NOT_CONNECTED) {
+        # Not a network drive, so just return the drive letter itself.
+        $ret = $drive;
+    }
+    else {
+        die "Unable to GetUNCName for $drive: $^E";
+    }
+
+    return $ret;
 }
 
 # Set up console for single-character input and autoflush output.


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
unattended-info mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/unattended-info

Reply via email to