From cf926d445fa0c2b7a3e61b6206c1229f00cfe857 Mon Sep 17 00:00:00 2001 From: Siep Kroonenberg Date: Fri, 5 Apr 2019 15:10:11 +0000 Subject: On windows, do not update tlmgr from tlshell git-svn-id: svn://tug.org/texlive/trunk@50776 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/scripts/tlshell/tlshell.tcl | 39 ++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/Master/texmf-dist/scripts/tlshell/tlshell.tcl b/Master/texmf-dist/scripts/tlshell/tlshell.tcl index 5254aaa2626..451b2cfa52d 100755 --- a/Master/texmf-dist/scripts/tlshell/tlshell.tcl +++ b/Master/texmf-dist/scripts/tlshell/tlshell.tcl @@ -218,6 +218,9 @@ proc selective_dis_enable {} { foreach b [list .mrk_inst .mrk_upd] { $b state disabled } + if {$::tcl_platform(platform) eq "windows"} { + .upd_all state disabled + } } elseif {!$::need_update_tlmgr} { .upd_tlmgr state disabled } @@ -1514,12 +1517,16 @@ proc restore_backups_dialog {} { ##### package-related ##### -proc update_self_q {} { - set ans [tk_messageBox -type okcancel -icon info -message \ - [string cat [__ "If update fails, try on a command-line:"] \ - "\ntlmgr update --self\n" \ - [__ "Use an administrative command prompt for an admin install."]]] - return [expr {$ans eq "ok"}] +proc update_self_w32 {} { + if $::multiuser { + set mess \ + [__ "Close this shell and run in an administrative command-prompt:"] + } else { + set mess [__ "Close this shell and run in a command-prompt:"] + } + set mess [string cat $mess "\n\ntlmgr update --self"] + tk_messageBox -message $mess + return } proc update_tlmgr {} { @@ -1527,7 +1534,10 @@ proc update_tlmgr {} { tk_messageBox -message [__ "Nothing to do!"] return } - if {$::tcl_platform(platform) eq "windows" && ! [update_self_q]} return + if {$::tcl_platform(platform) eq "windows"} { + update_self_w32 + return + } run_cmd "update --self" 1 vwait ::done_waiting # tlmgr restarts itself automatically @@ -1540,6 +1550,9 @@ proc update_tlmgr {} { proc update_all {} { set updated_tlmgr 0 if $::need_update_tlmgr { + if {$::tcl_platform(platform) eq "windows"} { + return ; # just to be sure; 'update all' button should be disabled + } run_cmd "update --self" 1 vwait ::done_waiting # tlmgr restarts itself automatically @@ -2092,6 +2105,9 @@ proc populate_main {} { # right frame ppack [ttk::frame .topfr] -in .topf -side right -anchor ne + if {$::tcl_platform(platform) eq "windows"} { + pack [ttk::label .topfr.ladmin] -side top -anchor e + } pack [ttk::label .topfr.lroot] -side top -anchor e .topfr.lroot configure -text [__ "Root at %s" $::instroot] pack [ttk::label .topfr.linfra] -side top -anchor e @@ -2296,6 +2312,15 @@ proc initialize {} { } start_tlmgr + if {$::tcl_platform(platform) eq "windows"} { + run_cmd_waiting "option multiuser" + set ::multiuser 0 + foreach l $::out_log { + if [regexp {^\s*multiuser\s+([01])\s*$} $l d ::multiuser] break + } + .topfr.ladmin configure -text \ + [expr {$::multiuser ? [__ "Multi-user"] : [__ "Single-user"]}] + } get_repos_from_tlmgr .topfl.lrepos configure -text [print_repos] get_packages_info_local -- cgit v1.2.3