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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
|
#!/usr/bin/env perl
# $Id$
# copy this file and install-w32client.bat to the same directory
# as texmf, texmf-dist etc.
# sample mini-installer to give Windows systems access to an
# existing TeXLive installation
# it assumes a standard directory layout, which avoids hard-coded paths.
# if this is not the case, adjustments may be necessary.
$^W = 1;
use TeXLive::TLUtils qw(mkdirhier);
use TeXLive::TLWinGoo qw(non_admin add_texbindir_to_path setenv_reg
init_unshortbat add_desktop_shortcut add_menu_shortcut
register_extension register_file_type
update_assocs broadcast_env
create_uninstaller);
use strict;
# the code below assumes that this script is in $texdir,
# the directory above texmf, texmf-dist etc.
my $texdir=$0;
$texdir=~s!\\!/!g;
$texdir=~s!(.*)/.*$!$1!;
# private runtime-generated files
$::texlive_release = '2008';
my $texdirw = $ENV{'USERPROFILE'}.'/.texlive'.$::texlive_release;
$texdirw=~s!\\!/!g;
my $private_var = $texdirw.'/texmf-var';
my $private_var_bsl = $private_var;
$private_var_bsl =~ s!/!\\!g;
# make only per-user modifications
non_admin();
# general
add_texbindir_to_path($texdir.'/bin/win32');
broadcast_env();
my $mainmenu = "TeX Live 2008";
my $texbindir_bsl = $texdir.'/bin/win32';
$texbindir_bsl =~ s!/!\\!g;
mkdirhier("$texdirw/tlpkg/installer");
create_uninstaller($texdir, $texdirw, $private_var, $texdirw.'/texmf-config');
init_unshortbat($texdirw);
# if the path can't be fixed globally add command prompt
# with texbindir prepended to path
if (uc(TeXLive::TLWinGoo::win_which_dir('tex.exe')) ne
uc($texdir.'/bin/win32') or
uc(TeXLive::TLWinGoo::win_which_dir('pdftex.exe')) ne
uc($texdir.'/bin/win32') or
uc(TeXLive::TLWinGoo::win_which_dir('luatex.exe')) ne
uc($texdir.'/bin/win32')) {
add_menu_shortcut(
$mainmenu,
'TeX Live Prompt',
'',
$ENV{'COMSPEC'},
"/k \"path $texbindir_bsl;%path%\"",
'',
);
}
# texlive manual
add_menu_shortcut(
$mainmenu,
'TeX Live Manual (en)',
'', # default pdf icon
$texdir.'/texmf-doc/doc/english/texlive-en/texlive-en.pdf',
'',
'',
);
# texdoctk documentation browser
if (-e $texdir.'/bin/win32/texdoctk.bat') {
add_menu_shortcut(
$mainmenu,
'TeXdoc GUI',
'', # icon
$texdir.'/bin/win32/texdoctk.bat',
'', # arguments
'batgui', # any non-null value to hide command-prompt
)
}
# psview
add_desktop_shortcut(
$texdirw,
'PS_View',
$texdir.'/tlpkg/tlpsv/psv.exe', # icon, not prog!
$texdir.'/bin/win32/psv.bat',
'', # no args
'batgui', # any non-null value to hide command-prompt
);
add_menu_shortcut(
$mainmenu,
'PS_View',
$texdir.'/tlpkg/tlpsv/psv.exe', # icon, not prog!
$texdir.'/bin/win32/psv.bat',
'', # no args
'batgui', # any non-null value to hide command-prompt
);
# comment out if you prefer gsview
register_extension(".ps", "PostScript");
register_extension(".eps", "PostScript");
register_file_type("PostScript",
'"'.$texdir.'/tlpkg/tlpsv/gswxlua.exe" -g '.
'"'.$texdir.'/tlpkg/tlgs/bin/gsdll32.dll" -l '.
'"'.$texdir.'/tlpkg/tlpsv/psv.wx.lua" -p '.
'"'.$texdir.'/tlpkg/tlpsv/psv_view.ps" -sINPUT="%1"');
update_assocs();
# dviout
add_menu_shortcut(
$mainmenu,
'DVIOUT',
$texdir.'/tlpkg/dviout/dviout.exe',
'wscript',
$texdir."/bin/win32/dviout.vbs",
'',
);
# xetex
if (-e $texdir.'/bin/win32/xetex.exe') {
my $xetexmfcnf = $private_var.'/web2c';
my $texmfcnf = $xetexmfcnf.';'.$texdir.'/texmf/web2c';
setenv_reg('TEXMFCNF', $texmfcnf);
broadcast_env();
mkdirhier($private_var."/fonts");
system("xcopy", "/e", "/i", "/q", "/y", "\"$texbindir_bsl\\conf\"",
"\"$private_var_bsl\\fonts\\conf\"");
system("xcopy", "/e", "/i", "/q", "/y", "\"$texbindir_bsl\\cache\"",
"\"$private_var_bsl\\fonts\\cache\"");
if (open(FONTSCONF, "<$texdir/bin/win32/conf/fonts.conf")) {
my @lines = <FONTSCONF>;
close(FONTSCONF);
if (open(FONTSCONF, ">$private_var/fonts/conf/fonts.conf")) {
my $winfontdir;
$winfontdir = $ENV{'SystemRoot'}.'/fonts';
$winfontdir =~ s!\\!/!g;
foreach (@lines) {
$_ =~ s!c:/Program Files/texlive/2008!$texdir!;
$_ =~ s!c:/windows/fonts!$winfontdir!;
print FONTSCONF;
}
close(FONTSCONF);
} else {
warn("Cannot open $private_var/fonts/conf/fonts.conf for writing\n");
}
} else {
warn ("Cannot open $texdir/bin/win32/conf/fonts.conf\n");
}
mkdirhier($xetexmfcnf);
if (open(TMF, ">$xetexmfcnf/texmf.cnf")) {
print TMF "FONTCONFIG_PATH=\$TEXMFVAR/fonts/conf\n";
print TMF "FC_CACHEDIR=\$TEXMFVAR/fonts/cache\n";
close TMF;
} else {
warn("Cannot open $xetexmfcnf/texmf.cnf for writing\n");
}
$ENV{'TEXMFCNF'} = $texmfcnf;
$ENV{'PATH'} = $texbindir_bsl.';'.$ENV{'PATH'};
system("\"$texbindir_bsl\\fc-cache.exe\"", "-v", "-r");
}
|