From 54e18f51b2bbd664edad80188b86812798a164a5 Mon Sep 17 00:00:00 2001 From: Julien Cochuyt Date: Thu, 6 May 2021 08:00:16 +0200 Subject: [PATCH] No startup sound for launcher --minimal (PR #12322) Fixes #12289 Co-authored-by: Reef Turner --- launcher/nvdaLauncher.nsi | 21 +++++++++++++++++---- user_docs/en/changes.t2t | 1 + 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/launcher/nvdaLauncher.nsi b/launcher/nvdaLauncher.nsi index cef8e853cf1..2711ae7e5b8 100644 --- a/launcher/nvdaLauncher.nsi +++ b/launcher/nvdaLauncher.nsi @@ -1,4 +1,5 @@ !include "fileFunc.nsh" +!include "LogicLib.nsh" !include "mui2.nsh" !define launcher_appExe "nvdaLauncher.exe" @@ -72,10 +73,17 @@ Banner::show /nounload BringToFront setOutPath "$PLUGINSDIR" -;Play NVDA logo sound -File "..\miscDeps\launcher\nvda_logo.wav" -Push "$PLUGINSDIR\nvda_logo.wav" -Call PlaySound +; Get the full param string and puts it in register $0. +; So $0 may then contain eg. "--minimal --install" +; Reference: https://nsis.sourceforge.io/Docs/AppendixE.html#getparameters +${GetParameters} $0 +; From the params string, looks for option "--minimal", tries to get it's (unused) value and stores in $1. +; Sets the error flag if the option is missing. +; Reference: https://nsis.sourceforge.io/Docs/AppendixE.html#getoptions +${GetOptions} $0 "--minimal" $1 +${If} ${Errors} + Call PlayLogoSound +${EndIf} CreateDirectory "$PLUGINSDIR\app" setOutPath "$PLUGINSDIR\app" file /R "${NVDADistDir}\" @@ -87,6 +95,11 @@ execWait "$PLUGINSDIR\app\nvda_noUIAccess.exe $0 -r --launcher" $1 intcmp $1 3 exec +1 SectionEnd +Function PlayLogoSound +File "..\miscDeps\launcher\nvda_logo.wav" +Push "$PLUGINSDIR\nvda_logo.wav" +Call PlaySound +FunctionEnd Function PlaySound ; Retrieve the file to play diff --git a/user_docs/en/changes.t2t b/user_docs/en/changes.t2t index b5f9bc5a55f..0c9fe36fbce 100644 --- a/user_docs/en/changes.t2t +++ b/user_docs/en/changes.t2t @@ -51,6 +51,7 @@ What's New in NVDA - Fixed copying config during installation from a portable copy when default destination config directory is empty. (#12071, #12205) - Fixed incorrect announcement of some letters with accents or diacritic when 'Say cap before capitals' option is checked. (#11948) - Fixed the pitch change failure in Sapi4 speech synthesizer. (#12311) +- The NVDA installer now also honors the ``--minimal`` command line parameter and does not play the start-up sound, following the same documented behavior as an installed or portable copy NVDA executable. (#12289) == Changes for Developers ==