summaryrefslogtreecommitdiff
path: root/Master/tlpkg/doc/w32client
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/doc/w32client')
-rwxr-xr-xMaster/tlpkg/doc/w32client84
1 files changed, 48 insertions, 36 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%\"",
+ '',
+);