summaryrefslogtreecommitdiff
path: root/Master/tlpkg
diff options
context:
space:
mode:
authorSiep Kroonenberg <siepo@cybercomm.nl>2009-08-13 21:27:39 +0000
committerSiep Kroonenberg <siepo@cybercomm.nl>2009-08-13 21:27:39 +0000
commitce3bf31aff96e7bfafa8eef9e747523661e68543 (patch)
tree54c360856aa57bf52d8bd7c44f29aff6d3564954 /Master/tlpkg
parent3961588d4c3528bec9859b8800bea77552bb6011 (diff)
Updated client script; uninstaller added
git-svn-id: svn://tug.org/texlive/trunk@14653 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg')
-rwxr-xr-xMaster/tlpkg/doc/w32client74
-rw-r--r--Master/tlpkg/doc/w32unclient53
l---------Master/tlpkg/doc/w32unclient.bat1
3 files changed, 103 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();
+
+
+
diff --git a/Master/tlpkg/doc/w32unclient b/Master/tlpkg/doc/w32unclient
new file mode 100644
index 00000000000..d43fc3d12a8
--- /dev/null
+++ b/Master/tlpkg/doc/w32unclient
@@ -0,0 +1,53 @@
+#!/usr/bin/env perl
+
+# see comments in w32client
+
+# Public domain.
+
+BEGIN {
+ $^W = 1;
+ require "tlmgr.pl";
+
+ 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 ) );
+}
+
+$::opt_verbosity = 2;
+
+init_local_db();
+
+# Only make user-level changes even if admin
+$opts{'w32mode'} = 'user';
+
+# remove shortcuts
+unshift @ARGV, 'remove', 'shortcut', 'dviout.win32', 'texworks',
+ 'texlive-en', 'tlpsv.win32';
+action_postaction();
+
+# File associations
+unshift @ARGV, 'remove', 'fileassoc', 'dviout.win32', 'tlpsv.win32';
+action_postaction();
+TeXLive::TLWinGoo::update_assocs(); # optional
+
+# xetex font cache
+unshift @ARGV, 'remove', 'script', 'xetex';
+action_postaction();
+
+# Remove TeX Live from path
+unshift @ARGV, 'remove';
+action_path();
+
+# unregister uninstaller
+my $rootkey = $Registry -> Open("CUser",
+ {Access => Win32::TieRegistry::KEY_ALL_ACCESS()});
+die "Failed to open rootkey\n" unless $rootkey;
+if ($rootkey) { # otherwise fail silently
+ my $k = $rootkey->Open(
+ "software/microsoft/windows/currentversion/uninstall/");
+ TeXLive::TLWinGoo::reg_delete_recurse($k, 'OurTexLive/') if $k;
+}
diff --git a/Master/tlpkg/doc/w32unclient.bat b/Master/tlpkg/doc/w32unclient.bat
new file mode 120000
index 00000000000..1c08f6b7c16
--- /dev/null
+++ b/Master/tlpkg/doc/w32unclient.bat
@@ -0,0 +1 @@
+w32client.bat \ No newline at end of file