diff options
-rwxr-xr-x | Master/install-tl | 28 | ||||
-rw-r--r-- | Master/texmf/scripts/texlive/uninstall-win32.pl | 7 | ||||
-rw-r--r-- | Master/tlpkg/TeXLive/TLUtils.pm | 62 |
3 files changed, 71 insertions, 26 deletions
diff --git a/Master/install-tl b/Master/install-tl index b459f63a8c0..2ede35a0e3b 100755 --- a/Master/install-tl +++ b/Master/install-tl @@ -791,30 +791,10 @@ sub do_tlpdb_postactions { sub do_path_adjustments { info ("running path adjustment actions\n"); if (win32()) { - update_assocs(); - - my $path = TeXLive::TLWinGoo::get_system_env() -> {'/Path'}; - $path =~ s/[\s\x00]+$//; - log("Old system path: $path\n"); - $path = TeXLive::TLWinGoo::get_user_env() -> {'/Path'}; - if ($path) { - $path =~ s/[\s\x00]+$//; - log("Old user path: $path\n"); - } else { - log("Old user path: none\n"); - } - my $mode = $vars{'option_w32_multi_user'} ? 'system' : 'user'; - adjust_reg_path_for_texlive('add', $vars{'TEXDIR'}.'/bin/win32', $mode); - $path = TeXLive::TLWinGoo::get_system_env() -> {'/Path'}; - $path =~ s/[\s\x00]+$//; - log("New system path: $path\n"); - $path = TeXLive::TLWinGoo::get_user_env() -> {'/Path'}; - if ($path) { - $path =~ s/[\s\x00]+$//; - log("New user path: $path\n"); - } else { - log("New user path: none\n"); - } + TeXLive::TLUtils::w32_add_to_path($vars{'TEXDIR'}.'/bin/win32', + $vars{'option_w32_multi_user'}); + # + # from_dvd stuff # setenv_reg('TEXMFSYSVAR', $vars{'TEXMFSYSVAR'}) if $vars{'from_dvd'}; setenv_reg('TEXMFCNF', $vars{'TEXMFSYSVAR'}.'/web2c') if $vars{'from_dvd'}; broadcast_env(); diff --git a/Master/texmf/scripts/texlive/uninstall-win32.pl b/Master/texmf/scripts/texlive/uninstall-win32.pl index cfc3ff9bee1..6bc34ba67e3 100644 --- a/Master/texmf/scripts/texlive/uninstall-win32.pl +++ b/Master/texmf/scripts/texlive/uninstall-win32.pl @@ -64,8 +64,11 @@ sub doit { my $menupath = &TeXLive::TLWinGoo::menu_path(); $menupath =~ s!/!\\!g; `rmdir /q "$menupath\\$TeXLive::TLConfig::WindowsMainMenuName" 2>nul`; - my $mode = ($localtlpdb->option("w32_multi_user")) ? 'system' : 'user'; - adjust_reg_path_for_texlive('remove', "$Master/bin/win32", $mode); + + # remove bindir from PATH settings + TeXLive::TLUtils::w32_remove_from_path("$Master/bin/win32", + $localtlpdb->option("w32_multi_user")); + # unsetenv_reg("TEXBINDIR"); # from_dvd case: # unsetenv_reg("TEXMFSYSVAR"); diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index d41f7819cff..2d4cbe0cb90 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -64,6 +64,8 @@ C<TeXLive::TLUtils> -- utilities used in the TeX Live infrastructure TeXLive::TLUtils::announce_execute_actions($how, @executes); TeXLive::TLUtils::add_symlinks($root, $arch, $sys_bin, $sys_man, $sys_info); TeXLive::TLUtils::remove_symlinks($root, $arch, $sys_bin, $sys_man, $sys_info); + TeXLive::TLUtils::w32_add_to_path($bindir, $multiuser); + TeXLive::TLUtils::w32_remove_from_path($bindir, $multiuser); =head2 Miscellaneous @@ -128,6 +130,8 @@ BEGIN { &announce_execute_actions &add_symlinks &remove_symlinks + &w32_add_to_path + &w32_remove_from_path &tlcmp ); @EXPORT = qw(setup_programs download_file process_logging_options @@ -1809,7 +1813,65 @@ sub remove_symlinks { return (add_remove_symlinks("remove", @_)); } +=pod + +=item C<w32_add_to_path($bindir, $multiuser)> +=item C<w32_remove_from_path($bindir, $multiuser)> + +These two functions try to add/remove the binary directory $bindir +on Windows to the registry PATH variable. + +If running as admin user and $multiuser is set, the system path will +be adjusted, otherwise the user path. + +After calling these functions TeXLive::TLWinGoo::broadcast_env() should +be called to make the changes immediately visible. +=cut + +sub w32_add_to_path { + my ($bindir, $multiuser) = @_; + return if (!win32()); + + TeXLive::TLWinGoo::update_assocs(); + my $path = TeXLive::TLWinGoo::get_system_env() -> {'/Path'}; + $path =~ s/[\s\x00]+$//; + log("Old system path: $path\n"); + $path = TeXLive::TLWinGoo::get_user_env() -> {'/Path'}; + if ($path) { + $path =~ s/[\s\x00]+$//; + log("Old user path: $path\n"); + } else { + log("Old user path: none\n"); + } + my $mode = 'user'; + if (admin() && $multiuser) { + $mode = 'system'; + } + adjust_reg_path_for_texlive('add', $bindir, $mode); + $path = TeXLive::TLWinGoo::get_system_env() -> {'/Path'}; + $path =~ s/[\s\x00]+$//; + log("New system path: $path\n"); + $path = TeXLive::TLWinGoo::get_user_env() -> {'/Path'}; + if ($path) { + $path =~ s/[\s\x00]+$//; + log("New user path: $path\n"); + } else { + log("New user path: none\n"); + } +} + +sub w32_remove_from_path { + my ($bindir, $multiuser) = @_; + my $mode = 'user'; + if (admin() && $multiuser) { + $mode = 'system'; + } + adjust_reg_path_for_texlive('remove', $bindir, $mode); +} + + +=pod =item C<untar($tarfile,$targetdir, $remove_tarfile)> |