summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive/TLWinGoo.pm
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2008-01-25 08:21:08 +0000
committerNorbert Preining <preining@logic.at>2008-01-25 08:21:08 +0000
commit650b11f5acd44843d1a82b6ecaf1ecd076932dbf (patch)
treea407aa7a220bad562b3003efa8c7266a6a90e8af /Master/tlpkg/TeXLive/TLWinGoo.pm
parentaa5250b35700f243e9bdd7f8adee134c3d105838 (diff)
first work on a uninstaller ... nothing tested, use at your own risk
git-svn-id: svn://tug.org/texlive/trunk@6400 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive/TLWinGoo.pm')
-rw-r--r--Master/tlpkg/TeXLive/TLWinGoo.pm41
1 files changed, 41 insertions, 0 deletions
diff --git a/Master/tlpkg/TeXLive/TLWinGoo.pm b/Master/tlpkg/TeXLive/TLWinGoo.pm
index e72896a8bf9..06a806a502c 100644
--- a/Master/tlpkg/TeXLive/TLWinGoo.pm
+++ b/Master/tlpkg/TeXLive/TLWinGoo.pm
@@ -32,6 +32,7 @@ C<TeXLive::TLWinGoo> -- Additional utilities for Windows
TeXLive::TLWinGoo::get_user_path;
TeXLive::TLWinGoo::add_texbindir_to_path($texpath);
TeXLive::TLWinGoo::register_script_type($extension, $command);
+ TeXLive::TLWinGoo::unregister_script_type($extension);
TeXLive::TLWinGoo::broadcast_env;
All exported functions return forward slashes.
@@ -57,6 +58,7 @@ BEGIN {
&get_user_path
&add_texbindir_to_path
&register_script_type
+ &unregister_script_type
&broadcast_env
);
@@ -425,6 +427,45 @@ sub register_script_type {
=pod
+=item C<unregister_script_type>
+
+Reversal of register_script_type.
+
+=cut
+
+sub unregister_script_type {
+ my $extension = shift;
+ $extension = '.'.$extension unless $extension =~ /^\./; # ensure leading dot
+ $extension = uc($extension);
+
+ # pathext
+ my $pathext = get_user_env() -> {'/PATHEXT'};
+ $pathext = get_system_env() -> {'/PATHEXT'} if not $pathext;
+ my @newpe;
+ foreach my $e (split(/;/,$pathext)) {
+ push @newpe, $e unless (uc($e) eq $extension);
+ }
+ my $newpe = join(";",@newpe);
+ if ($is_admin) {
+ (get_system_env() -> {"/PATHEXT"}) = $newpe;
+ } else {
+ (get_user_env() -> {"/PATHEXT"}) = $newpe;
+ }
+
+ # file type
+ $extension = lc($extension);
+ my $classes_key = $Registry -> Open(
+ ($is_admin ? "LMachine/Software/Classes/" : "CUser/Software/Classes/"),
+ {Access => KEY_ALL_ACCESS()}) or die "Cannot open classpath";
+ delete $classes_key{$extension};
+ delete $classes_key{"script$extension"};
+ # $classes_key->CreateKey($extension)->SetValue("","script".$extension);
+ # $classes_key->CreateKey("script".$extension."/Shell/Open/Command/")->
+ # SetValue("", $command.' "%1" %*');
+}
+
+=pod
+
=item C<broadcast_env>
Broadcasts system message that enviroment has changed. This only has