changeset 6939:4f25eb25a80b release

Installer: Check for default console and show advice for new Terminal * tools/makeinst-script.sh.in: Octave doesn't work correctly when the default console on Windows is set to the new Terminal app. Check if the default is set to the Windows Console Host and show advice if it is not.
author John Donoghue <john.donoghue@ieee.org>
date Fri, 27 Oct 2023 20:19:02 -0400
parents 4799220fcf78
children c9c411f5db86 8e5ec983eb09
files tools/makeinst-script.sh.in
diffstat 1 files changed, 25 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tools/makeinst-script.sh.in	Thu Oct 26 13:58:39 2023 +0200
+++ b/tools/makeinst-script.sh.in	Fri Oct 27 20:19:02 2023 -0400
@@ -164,6 +164,7 @@
 
 !insertmacro MUI_PAGE_INSTFILES
 
+!define MUI_PAGE_CUSTOMFUNCTION_SHOW CheckConsole
 !define MUI_FINISHPAGE_RUN "\$WINDIR\\explorer.exe"
 !define MUI_FINISHPAGE_RUN_PARAMETERS "\$INSTDIR\\\${MAIN_APP_EXE}"
 !define MUI_FINISHPAGE_SHOWREADME "\$INSTDIR\\README.html"
@@ -1126,6 +1127,30 @@
 
 FunctionEnd
 
+; Function to check Console Settings and show a warn
+Function CheckConsole
+  Push \$R0
+  Push \$R1
+
+  ClearErrors
+
+  ReadRegStr \$R1 HKCU "Console\\%%Startup" "DelegationConsole"
+  IfErrors ignore_console 0
+
+  StrCmp \$R1 "" ignore_console 0
+  # already set for console host
+  StrCmp \$R1 "{B23D10C0-E52E-411E-9D5B-C09FDF709C7D}" ignore_console 0
+
+  # display message
+  MessageBox MB_ICONEXCLAMATION|MB_YESNO|MB_DEFBUTTON2 "Using Octave with the Windows Terminal app could lead to issues with the command window. Please, set the default to the “Windows Console Host”.$\r$\n$\r$\nWould you like to get instructions on how to change the default console?" /SD IDNO IDNO ignore_console
+
+  ExecShell open "https://devblogs.microsoft.com/commandline/windows-terminal-as-your-default-command-line-experience/"
+
+ignore_console:
+  Pop \$R1
+  Pop \$R0
+FunctionEnd
+
 ; Function to check Java Runtime Environment
 Function CheckJRE
 ;  looks in: