# HG changeset patch # User John Donoghue # Date 1698452342 14400 # Node ID 4f25eb25a80b1952279b5c92bee27f2cb74d57a9 # Parent 4799220fcf7883b1f7e21a3b0e8aab7ae6e31863 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. diff -r 4799220fcf78 -r 4f25eb25a80b tools/makeinst-script.sh.in --- 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: