From 0368dbc0b4f02ec455bf93d6295c45d91a19af54 Mon Sep 17 00:00:00 2001 From: Siep Kroonenberg Date: Tue, 23 Apr 2024 10:33:27 +0000 Subject: vbscript -> powershell because of changes in windows script support git-svn-id: svn://tug.org/texlive/trunk@71041 c570f23f-e606-0410-a88d-b1316a301751 --- Master/bin/windows/runscript.tlu | 9 +++------ Master/texmf-dist/scripts/texlive/tl-errmess.ps1 | 2 ++ Master/texmf-dist/scripts/texlive/tl-errmess.vbs | 7 ------- Master/texmf-dist/scripts/texlive/uninstall-windows.pl | 7 ++++--- Master/texmf-dist/scripts/texlive/uninstq.ps1 | 13 +++++++++++++ Master/texmf-dist/scripts/texlive/uninstq.vbs | 17 ----------------- Master/tlpkg/tlpsrc/texlive.infra.tlpsrc | 4 ++-- 7 files changed, 24 insertions(+), 35 deletions(-) create mode 100644 Master/texmf-dist/scripts/texlive/tl-errmess.ps1 delete mode 100644 Master/texmf-dist/scripts/texlive/tl-errmess.vbs create mode 100644 Master/texmf-dist/scripts/texlive/uninstq.ps1 delete mode 100644 Master/texmf-dist/scripts/texlive/uninstq.vbs diff --git a/Master/bin/windows/runscript.tlu b/Master/bin/windows/runscript.tlu index 318dbabdcfb..c3f22c3bc88 100755 --- a/Master/bin/windows/runscript.tlu +++ b/Master/bin/windows/runscript.tlu @@ -287,14 +287,11 @@ local function show_error(msg) if guimode then local err_cmd os.setenv('RUNSCRIPT_ERROR_MESSAGE', msg) - local errmess_path = TEXDIR .. '/texmf-dist/scripts/texlive/tl-errmess.vbs' - local err_cmd = {"wscript", errmess_path:gsub('/','\\')} + local errmess_path = TEXDIR .. '/texmf-dist/scripts/texlive/tl-errmess.ps1' + local err_cmd = {"powershell", "-NoLogo", "-WindowStyle", "hidden", + '-ExecutionPolicy', 'Bypass', errmess_path:gsub('/','\\')} if lfs.isfile(errmess_path) then os.spawn(err_cmd) - elseif lfs.isfile(TEXDIR..'/tlpkg/tltcl/tclkit.exe') and - lfs.isfile(TEXDIR..'/tlpkg/tltcl/gui_err.tcl') then - os.spawn{TEXDIR..'/tlpkg/tltcl/tclkit.exe', - TEXDIR..'/tlpkg/tltcl/gui_err.tcl'} end else io.stderr:write(msg, '\n') diff --git a/Master/texmf-dist/scripts/texlive/tl-errmess.ps1 b/Master/texmf-dist/scripts/texlive/tl-errmess.ps1 new file mode 100644 index 00000000000..1c086ec0248 --- /dev/null +++ b/Master/texmf-dist/scripts/texlive/tl-errmess.ps1 @@ -0,0 +1,2 @@ +Add-Type -AssemblyName PresentationFramework +[System.Windows.MessageBox]::Show($env:runscript_error_message, 'Error', 'OK', 'Warning') \ No newline at end of file diff --git a/Master/texmf-dist/scripts/texlive/tl-errmess.vbs b/Master/texmf-dist/scripts/texlive/tl-errmess.vbs deleted file mode 100644 index 6212afc4181..00000000000 --- a/Master/texmf-dist/scripts/texlive/tl-errmess.vbs +++ /dev/null @@ -1,7 +0,0 @@ -option explicit - -Dim wsh, envi - -Set wsh = wscript.CreateObject("wscript.shell") -Set envi = wsh.environment("PROCESS") -MsgBox envi("RUNSCRIPT_ERROR_MESSAGE"), vbcritical, "Error" \ No newline at end of file diff --git a/Master/texmf-dist/scripts/texlive/uninstall-windows.pl b/Master/texmf-dist/scripts/texlive/uninstall-windows.pl index c194eda4b3b..e4a081387f3 100755 --- a/Master/texmf-dist/scripts/texlive/uninstall-windows.pl +++ b/Master/texmf-dist/scripts/texlive/uninstall-windows.pl @@ -26,9 +26,10 @@ if (@ARGV) { } else { my $askfile = $0; $askfile =~ s!^(.*)([\\/])([^\\/]*)$!$1$2!; - $askfile .= "uninstq.vbs"; - $ans = system("wscript", $askfile); - # 0 means yes + $askfile .= "uninstq.ps1"; + $ans = system("powershell", '-NoLogo', '-WindowStyle', 'hidden', + '-ExecutionPolicy', 'Bypass', $askfile); + # 0 means yes or ok } if ($ans) { exit(1); diff --git a/Master/texmf-dist/scripts/texlive/uninstq.ps1 b/Master/texmf-dist/scripts/texlive/uninstq.ps1 new file mode 100644 index 00000000000..27746b01077 --- /dev/null +++ b/Master/texmf-dist/scripts/texlive/uninstq.ps1 @@ -0,0 +1,13 @@ +Add-Type -AssemblyName PresentationFramework + +$msg = @" +Really uninstall TeX Live? + +Please make sure that no TeX Live programs are still running! +"@ +$ans = [System.Windows.MessageBox]::Show($msg, 'Confirm uninstall', 'OKCancel', 'Question') +if ($ans -eq 1) { + exit 0 +} else { + exit 1 +} \ No newline at end of file diff --git a/Master/texmf-dist/scripts/texlive/uninstq.vbs b/Master/texmf-dist/scripts/texlive/uninstq.vbs deleted file mode 100644 index 382f4be3731..00000000000 --- a/Master/texmf-dist/scripts/texlive/uninstq.vbs +++ /dev/null @@ -1,17 +0,0 @@ -Dim ans -ans = MsgBox( "Really uninstall TeX Live?" & vbcrlf & vbcrlf & _ - "Please make sure that no TeX Live programs are still running!", _ - 36, "TeX Live uninstaller" ) -If ans <> vbYes Then - wscript.quit( 1 ) -Else - wscript.quit( 0 ) -End If - -' invocation from cmd.exe: -' start /wait uninstq.vbs -' test errorlevel - -' invocation from perl: -' my $ans = system( "wscript", "uninstq.vbs" ); -' 0 means yes \ No newline at end of file diff --git a/Master/tlpkg/tlpsrc/texlive.infra.tlpsrc b/Master/tlpkg/tlpsrc/texlive.infra.tlpsrc index bdc8655ad08..b9cfa855c35 100644 --- a/Master/tlpkg/tlpsrc/texlive.infra.tlpsrc +++ b/Master/tlpkg/tlpsrc/texlive.infra.tlpsrc @@ -31,8 +31,8 @@ runpattern f texmf-dist/scripts/texlive/mktexlsr runpattern f texmf-dist/scripts/texlive/tlmgr.pl runpattern f texmf-dist/scripts/texlive/tlmgrgui.pl runpattern f texmf-dist/scripts/texlive/uninstall-windows.pl -runpattern f texmf-dist/scripts/texlive/uninstq.vbs -runpattern f texmf-dist/scripts/texlive/tl-errmess.vbs +runpattern f texmf-dist/scripts/texlive/uninstq.ps1 +runpattern f texmf-dist/scripts/texlive/tl-errmess.ps1 # runpattern f tlpkg/installer/config.guess runpattern f tlpkg/installer/curl/curl-ca-bundle.crt -- cgit v1.2.3