summaryrefslogtreecommitdiff
path: root/Master/tlpkg/doc/w32client
blob: cf61f8a49c5b115b3808e04f983a1a611fdc7642 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/usr/bin/env perl

# Tlmgr.pl can be loaded either by itself, as a program, or as a library,
# at least under Windows.
# An application of this is configuring a client Windows workstation
# for a pre-installed TeX Live installation on a local network.

# Public domain.

# 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";
}

# for debugging:
#$::opt_verbosity = 2;

# Only make user-level changes even if admin
$opts{'w32mode'} = 'user';

# 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';
action_postaction();

# File associations. 1: only new; 2: always, overriding existing settings
$opts{'fileassocmode'} = 1;
unshift @ARGV, 'install', 'fileassoc',
  'dviout.win32', 'tlpsv.win32', 'texworks.win32';
action_postaction();
TeXLive::TLWinGoo::update_assocs(); # optional

# xetex font cache
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%\"",
 '',
);