diff options
Diffstat (limited to 'Master/tlpkg/doc/w32client')
-rwxr-xr-x | Master/tlpkg/doc/w32client | 74 |
1 files changed, 49 insertions, 25 deletions
diff --git a/Master/tlpkg/doc/w32client b/Master/tlpkg/doc/w32client index cba880d609c..48a2ad1ef37 100755 --- a/Master/tlpkg/doc/w32client +++ b/Master/tlpkg/doc/w32client @@ -5,53 +5,77 @@ # An application of this is configuring a client Windows workstation # for a pre-installed TeX Live installation on a local network. -# Currently, this script is just proof-of-concept. # 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. + 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"; +#print "Version:\n" . give_version() . "\n"; +#print "Mirror:\n" . give_ctan_mirror() . "\n"; +#print "Master: " . $Master ."\n"; -$::opt_verbosity = 2; +# for debugging: +#$::opt_verbosity = 2; -init_local_db(); # Only make user-level changes even if admin -#non_admin(); $opts{'w32mode'} = 'user'; -TeXLive::TLUtils::w32_add_to_path( - $Master."\\bin\\win32", ($opts{'w32mode'} eq 'admin') ? 1 : 0 -); -TeXLive::TLWinGoo::broadcast_env(); -# Add TeX Live to path (not pretty...) -#unshift @ARGV, 'add'; -#action_path(); -#execute_action('path', 'add'); +# 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 +unshift @ARGV, 'add'; +action_path(); # create some shortcuts -unshift @ARGV, 'install', 'shortcut', 'dviout.win32', 'texworks', - 'texlive-en', 'tlpsv.win32'; +unshift @ARGV, 'install', 'shortcut', + 'dviout.win32', 'texworks', 'texlive-en', 'tlpsv.win32'; action_postaction(); -#execute_action('postaction', 'install', 'shortcut', 'dviout.win32'); -#execute_action('postaction', 'install', 'shortcut', 'texworks'); -#execute_action('postaction', 'install', 'shortcut', 'texlive-en'); -#execute_action('postaction', 'install', 'shortcut', 'tlpsv.win32'); # File associations. 1: only new; 2: always, overriding existing settings -$opts{'fileassocmode'} = 2; -unshift @ARGV, 'install', 'fileassoc', 'dviout.win32', 'tlpsv.win32'; +$opts{'fileassocmode'} = 1; +unshift @ARGV, 'install', 'fileassoc', + 'dviout.win32', 'tlpsv.win32', 'texworks.win32'; action_postaction(); -#execute_action('postaction', 'install', 'fileassoc', 'dviout.win32'); -#execute_action('postaction', 'install', 'fileassoc', 'tlpsv.win32'); +TeXLive::TLWinGoo::update_assocs(); # optional # xetex font cache unshift @ARGV, 'install', 'script', 'xetex'; action_postaction(); + + + |