summaryrefslogtreecommitdiff
path: root/Master/tlpkg/doc/w32client
blob: cba880d609ce630204e952e1f3d36c4fbd9f94fd (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
#!/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.

# Currently, this script is just proof-of-concept.
# Public domain.

BEGIN {
  $^W = 1;
  require "tlmgr.pl";
}

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

$::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');

# create some shortcuts
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';
action_postaction();
#execute_action('postaction', 'install', 'fileassoc', 'dviout.win32');
#execute_action('postaction', 'install', 'fileassoc', 'tlpsv.win32');

# xetex font cache
unshift @ARGV, 'install', 'script', 'xetex';
action_postaction();