diff options
-rwxr-xr-x | Master/tlpkg/doc/w32client | 84 | ||||
-rwxr-xr-x | Master/tlpkg/doc/w32client.bat | 41 | ||||
-rw-r--r-- | Master/tlpkg/doc/w32client.bat.manifest | 15 | ||||
-rw-r--r-- | Master/tlpkg/doc/w32client.txt | 87 | ||||
-rwxr-xr-x | Master/tlpkg/doc/w32client_advanced.bat | 60 | ||||
-rw-r--r-- | Master/tlpkg/doc/w32unclient | 19 | ||||
-rw-r--r-- | Master/tlpkg/doc/w32unclient.bat.manifest | 15 |
7 files changed, 236 insertions, 85 deletions
diff --git a/Master/tlpkg/doc/w32client b/Master/tlpkg/doc/w32client index 48a2ad1ef37..cf61f8a49c5 100755 --- a/Master/tlpkg/doc/w32client +++ b/Master/tlpkg/doc/w32client @@ -7,54 +7,20 @@ # Public domain. -# We try to use high-level code, but loading tlmgr.pl also gives as access -# to lower-level code from modules in <root>/tlmgr/TeXlive -# and from modules loaded by them. +# you can use either the simple or the advanced batch wrapper, +# but it should have the same name as this file, with .bat appended. BEGIN { $^W = 1; require "tlmgr.pl"; - - # don't need to re-require modules but do need to re-import names; - # sorry for the mess - Win32::TieRegistry->import( qw( $Registry - REG_SZ REG_EXPAND_SZ KEY_READ KEY_WRITE KEY_ALL_ACCESS - KEY_ENUMERATE_SUB_KEYS ) ); - $Registry->Delimiter('/'); - $Registry->ArrayValues(0); - $Registry->FixSzNulls(1); - Win32::Shortcut->import( qw( SW_SHOWNORMAL SW_SHOWMINNOACTIVE ) ); } -# some examples of accessing tlmgr functionality - -# Print some info -#print "Version:\n" . give_version() . "\n"; -#print "Mirror:\n" . give_ctan_mirror() . "\n"; -#print "Master: " . $Master ."\n"; - # for debugging: #$::opt_verbosity = 2; # Only make user-level changes even if admin $opts{'w32mode'} = 'user'; -# register uninstaller. Failure not fatal. -my $rootkey = $Registry -> Open("CUser", - {Access => Win32::TieRegistry::KEY_ALL_ACCESS()}); -my $k; -if ($rootkey) { - $k = $rootkey->CreateKey( - "software/microsoft/windows/currentversion/uninstall/OurTeXLive/"); - if ($k) { - $k->{"/DisplayName"} = "OurTeXLive 2009"; - $k->{"/UninstallString"} = "\"$Master\\w32unclient.bat\""; - $k->{'/DisplayVersion'} = "2009"; - $k->{'/URLInfoAbout'} = "http://ourwebsite.edu/ourtexlive"; - } -} -warn "Failed to register uninstaller\n" unless $k; - # The action_... functions read their arguments from @ARGV. # Add TeX Live to path @@ -77,5 +43,51 @@ TeXLive::TLWinGoo::update_assocs(); # optional unshift @ARGV, 'install', 'script', 'xetex'; action_postaction(); +#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# optional advanced features. +# these make direct use of the modules in tlmgr/TeXlive +# and modules loaded by them. +# don't need to re-require modules but do need to re-import names + +Win32::TieRegistry->import( qw( $Registry + REG_SZ REG_EXPAND_SZ KEY_READ KEY_WRITE KEY_ALL_ACCESS + KEY_ENUMERATE_SUB_KEYS ) ); +$Registry->Delimiter('/'); +$Registry->ArrayValues(0); +$Registry->FixSzNulls(1); +Win32::Shortcut->import( qw( SW_SHOWNORMAL SW_SHOWMINNOACTIVE ) ); + +# register uninstaller. Failure not fatal. +# This really should be the first item. + +my $Master_bsl = $Master; +$Master_bsl =~ s,/,\\,g; + +my $rootkey = $Registry -> Open("CUser", + {Access => Win32::TieRegistry::KEY_ALL_ACCESS()}); +my $k; +if ($rootkey) { + $k = $rootkey->CreateKey( + "software/microsoft/windows/currentversion/uninstall/OurTeXLive/"); + if ($k) { + $k->{"/DisplayName"} = "OurTeXLive 2009"; + $k->{"/UninstallString"} = "\"$Master_bsl\\w32unclient.bat\""; + $k->{'/DisplayVersion'} = "2009"; + $k->{'/URLInfoAbout'} = "http://ourwebsite.edu/ourtexlive"; + } +} +warn "Failed to register uninstaller\n" unless $k; +# add a command-prompt shortcut with TeX Live first item on the path. +# note that for TeXworks, the wrapper already takes care of this. + +add_menu_shortcut( + $TeXLive::TLConfig::WindowsMainMenuName, + 'TeX Live Prompt', + '', + 'cmd', + "/k \"path $Master_bsl\\bin\\win32;%path%\"", + '', +); diff --git a/Master/tlpkg/doc/w32client.bat b/Master/tlpkg/doc/w32client.bat index 1900bc7d5d6..63afc5aa42b 100755 --- a/Master/tlpkg/doc/w32client.bat +++ b/Master/tlpkg/doc/w32client.bat @@ -4,21 +4,11 @@ rem both in the root of the TeX Live installation. rem Based on code from Tomasz M. Trzeciak.
rem Public domain.
-rem First, check if this is DOS based system
-rem in DOS '^' is just a normal character
-if not ^x==x goto DOS
-
-rem Abort if we are running from UNC path
-if %~d0==\\ goto UNC
-
-rem Localize environment changes
-setlocal enableextensions
+rem For more safeguards and 4DOS/4NT compatibility,
+rem see w32client_advanced.bat
set this=%~dp0
-rem Break search path into dir list and rebuild w/o tex dirs
-call :rebuildpath ";" "%path:;=" "%"
-
rem Use TL Perl
path %this%tlpkg\tlperl\bin;%this%bin\win32;%path%
set PERL5LIB=%this%tlpkg\tlperl\lib;%this%tlpkg;%this%texmf\scripts\texlive
@@ -27,30 +17,3 @@ rem Start Perl script of the same name perl "%~dpn0" %*
rem Give user opportunity to scan output messages
pause
-goto :eof
-
-rem Subroutine to build search path without tex directories
-rem any dir containing pdftex.exe is considered a tex dir
-:rebuildpath ";" dir list ...
-shift
-rem The first argument (";") serves as a marker to reset the path
-if "%~0"==";" set path=
-rem Finish if no more arguments to process
-if [%1]==[] goto :eof
-rem Continue if tex dir
-if exist "%~1\pdftex.exe" goto :rebuildpath
-rem Add dir to path
-if not defined path (path %~1) else (path %path%;%~1)
-goto :rebuildpath
-
-:UNC
-echo Cannot run from UNC path.
-echo Map network drive to a drive letter and rerun the installer.
-echo You can use pushd/popd commands for temporary mapping.
-pause
-exit /b 1
-
-:DOS
-echo DOS and Windows 9x systems are not supported. Sorry.
-echo Windows 2000 or newer is required.
-pause
diff --git a/Master/tlpkg/doc/w32client.bat.manifest b/Master/tlpkg/doc/w32client.bat.manifest new file mode 100644 index 00000000000..7155260e717 --- /dev/null +++ b/Master/tlpkg/doc/w32client.bat.manifest @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> + <assemblyIdentity + version="1.0.0.0" + processorArchitecture="*" + name="w32client" + type="win32"/> + <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"> + <security> + <requestedPrivileges> + <requestedExecutionLevel level="asInvoker"/> + </requestedPrivileges> + </security> + </trustInfo> +</assembly> diff --git a/Master/tlpkg/doc/w32client.txt b/Master/tlpkg/doc/w32client.txt new file mode 100644 index 00000000000..cc583323e39 --- /dev/null +++ b/Master/tlpkg/doc/w32client.txt @@ -0,0 +1,87 @@ +CREATING A LAN INSTALLATION OF TEX LIVE FOR WINDOWS CLIENTS + +You can copy a TeX Live installation to a read-only network drive +and tell your users to add the <root>\bin\win32 directory to their +searchpath. However, this is not how things are done on the Windows +platform. + +The w32client.bat/w32client script pair modifies the searchpath, +creates shortcuts and creates file associations. It also registers +an uninstaller script which will show up under Add/Remove Programs. + +Consider these scripts prototypes. You may want to add a GUI which +lets the user choose whether [s]he wants any of those things. + +As it stands, all changes are made for the user, not for the +workstation. This implies that in a roaming profile setup the +configuration is available from any computer on the network, and +that the user needs no particular rights on the workstation. + +REQUIREMENTS OF THE NETWORK INSTALLATION + +The prototype script assumes a standard directory layout: +<parent>---<year> + | | + | +---bin---win32 + | +---texmf + | +---texmf-dist + | +---texmf-config + | +---texmf-var + | +---tlpkg + | + +---texmf-local + +The w32client- and w32unclient scripts assume that they are in the +root of the installation, i.e. in <parent>\<year>. + +Sticking to this default directory layout minimizes configuration +hassles. Still, there may be some: + +XETEX + +For XeTeX to support system fonts, it needs some information about +those fonts. For Windows, this information normally is collected by +a utiltity fc-cache during installation of XeTeX. + +If all computers on the network have the same set of fonts, and if +the installation was created from such a computer, then XeTeX font +support might work perfectly without additional action. + +However, it is better not to count on this, and to run fc-cache from +the client script. Since users don't have write access to +TEXMFSYSVAR, or <parent>\<year>\texmf-var, we need to use TEXMFVAR, +or <user profile>\.texlive<year>\texmf-var. This can be accomplished +with a file <parent>\<year>\texmf.cnf with the lines + +FONTCONFIG_PATH=$TEXMFVAR/fonts/conf +FC_CACHEDIR=$TEXMFVAR/fonts/cache + +The file should already exist, but would still be empty apart from +some comments. Settings here override settings in the main +texmf.cnf, in <parent>\<year>\texmf\web2c. + +Users may need to rerun fc-cache if they move to another workstation +with a different set of fonts. + +SEARCH PATH + +If a workstation already has a locally installed TeX and if its +binaries are on the system path, then the locally installed TeX will +be found first. The demo script safeguards against this by +prepending the searchpath with the TeX Live binaries for individual +shortcuts. Wrapper scripts also do this, so the TeXworks shortcut +will always find our TeX Live first. + +In addition, w32client adds a command-prompt shortcut with such a +locally patched searchpath. + +VISTA + +Under some circumstances, Vista needs to be told that a program or +batchfile doesn't require admin privileges. This can be done with a +manifest file, which has the name of the program, including +extension, with `.manifest' appended. In my own tests, I had to +create a manifest file w32unclient.bat.manifest for the uninstaller. + +If you need additional manifest files, just copy this manifest file +and replace the program name in it. diff --git a/Master/tlpkg/doc/w32client_advanced.bat b/Master/tlpkg/doc/w32client_advanced.bat new file mode 100755 index 00000000000..cbbd4606b7b --- /dev/null +++ b/Master/tlpkg/doc/w32client_advanced.bat @@ -0,0 +1,60 @@ +@echo off
+rem Wrapper batchfile for Perl script of the same name
+rem both in the root of the TeX Live installation.
+rem Based on code from Tomasz M. Trzeciak.
+rem Public domain.
+
+rem This version has some additional safeguards and
+rem better compatibility with replacement command shells
+rem compared to the regular version.
+
+rem First, check if this is DOS based system
+rem in DOS '^' is just a normal character
+if not ^x==x goto DOS
+
+rem Abort if we are running from UNC path
+if %~d0==\\ goto UNC
+
+rem Localize environment changes
+setlocal enableextensions
+
+set this=%~dp0
+
+rem Break search path into dir list and rebuild w/o tex dirs
+call :rebuildpath ";" "%path:;=" "%"
+
+rem Use TL Perl
+path %this%tlpkg\tlperl\bin;%this%bin\win32;%path%
+set PERL5LIB=%this%tlpkg\tlperl\lib;%this%tlpkg;%this%texmf\scripts\texlive
+
+rem Start Perl script of the same name
+perl "%~dpn0" %*
+rem Give user opportunity to scan output messages
+pause
+goto :eof
+
+rem Subroutine to build search path without tex directories
+rem any dir containing pdftex.exe is considered a tex dir
+:rebuildpath ";" dir list ...
+shift
+rem The first argument (";") serves as a marker to reset the path
+if "%~0"==";" set path=
+rem Finish if no more arguments to process
+if [%1]==[] goto :eof
+rem Continue if tex dir
+if exist "%~1\pdftex.exe" goto :rebuildpath
+rem Add dir to path
+if not defined path (path %~1) else (path %path%;%~1)
+goto :rebuildpath
+
+:UNC
+echo Cannot run from UNC path.
+echo Map network drive to a drive letter and rerun the installer.
+echo You can use pushd/popd commands for temporary mapping.
+pause
+exit /b 1
+
+:DOS
+echo DOS and Windows 9x systems are not supported. Sorry.
+echo Windows 2000 or newer is required.
+pause
diff --git a/Master/tlpkg/doc/w32unclient b/Master/tlpkg/doc/w32unclient index d43fc3d12a8..e297a13674b 100644 --- a/Master/tlpkg/doc/w32unclient +++ b/Master/tlpkg/doc/w32unclient @@ -7,19 +7,11 @@ BEGIN { $^W = 1; require "tlmgr.pl"; - - Win32::TieRegistry->import( qw( $Registry - REG_SZ REG_EXPAND_SZ KEY_READ KEY_WRITE KEY_ALL_ACCESS - KEY_ENUMERATE_SUB_KEYS ) ); - $Registry->Delimiter('/'); - $Registry->ArrayValues(0); - $Registry->FixSzNulls(1); - Win32::Shortcut->import( qw( SW_SHOWNORMAL SW_SHOWMINNOACTIVE ) ); } -$::opt_verbosity = 2; +#$::opt_verbosity = 2; -init_local_db(); +#init_local_db(); # Only make user-level changes even if admin $opts{'w32mode'} = 'user'; @@ -42,6 +34,13 @@ action_postaction(); unshift @ARGV, 'remove'; action_path(); +Win32::TieRegistry->import( qw( $Registry + REG_SZ REG_EXPAND_SZ KEY_READ KEY_WRITE KEY_ALL_ACCESS + KEY_ENUMERATE_SUB_KEYS ) ); +$Registry->Delimiter('/'); +$Registry->ArrayValues(0); +$Registry->FixSzNulls(1); + # unregister uninstaller my $rootkey = $Registry -> Open("CUser", {Access => Win32::TieRegistry::KEY_ALL_ACCESS()}); diff --git a/Master/tlpkg/doc/w32unclient.bat.manifest b/Master/tlpkg/doc/w32unclient.bat.manifest new file mode 100644 index 00000000000..470faf02b6e --- /dev/null +++ b/Master/tlpkg/doc/w32unclient.bat.manifest @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> + <assemblyIdentity + version="1.0.0.0" + processorArchitecture="*" + name="w32unclient" + type="win32"/> + <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"> + <security> + <requestedPrivileges> + <requestedExecutionLevel level="asInvoker"/> + </requestedPrivileges> + </security> + </trustInfo> +</assembly> |