This is Bavaria, Germany!
Howto create a tree with a perl/win32 installation without installing it on the computer where the script shall run in the future will be shown here. You need this for running perl-scripts as logon-scripts or in an installing environment to run perl-scripts from a CD.
We are trying to install our autarkic into d:\\myperl. When ready we are able to move this directory to any path we like.
a. Copy your locally installed e:\\program files\\perl to d:\\myperl\\perl
b. Copy %windir%\\system32\\PerlCRT.dll to d:\\myperl\\perl\\bin
We try to leave this directory mostly untouched.
Create Directories:
d:\\myperl\\mymodules (your *.pm will be here)
d:\\myperl\\myscripts (your scripts will be here)
Create a test-perl-script d:\\myperl\\myscripts\\test.pl:
|
# free space on drives use Win32::AdminMisc; |
Create a sample-pm d:\\myperl\\mymodules\\testmodule.pm we only use for ourself. It\'s not standard, only for our special purposes:
|
package testmodule; sub printout { |
Create "perl-startup-script" d:\\myperl\\myscripts\\perl.bat . Perl must be started somehow. In our case this will be a batch-file. This script first checks wether perl is in PATH. If it\'s not the path-variable will be extended:
|
rem @echo off rem perl.bat for running a perl-script rem without installing perl rem is perl in the PATH? perl.exe -v >NUL: 2>NUL: if errorlevel 0 goto path_ok @echo adding perl-path to PATH set path=..\\perl\\bin;%path% :path_ok @echo starting perl-script path perl.exe %1 %2 %3 %4 |
Test it:
d:> cd \\myperl\\myscripts
d:\\myperl\\myscripts\\> perl.bat test.pl
This must run.
Only if you need perl called in a login-script in your domain, have a script like this:
|
rem @echo off rem File: %logonserver%\\netlogon\\perllogin.bat rem call this script in usrmgr for every user with: perllogin.bat rem test this script in a dos-shell with: \\\\sv-whoknows\\netlogon\\perllogin.bat rem the usual stuff net use z: \\\\myserver\\whoknows /persistent:no net time %logonserver% /set /yes rem rem is perl in the PATH? perl.exe -v >NUL: 2>NUL: if errorlevel 0 goto path_ok @echo adding perl-path to PATH set path=%LOGONSERVER%\\netlogon\\myperl\\perl\\bin;%path% :path_ok @echo starting perl-script rem path perl.exe %logonserver%\\netlogon\\myperl\\myscripts\\test.pl rem pause |
push (@INC,"$ENV{\'LOGONSERVER\'}\\\\netlogon\\\\myperl\\\\mymodules");
| back to my main perl-page |
Last revised at December 29th, 2001 by Richard Lippmann |