From 32c4a1f99edb134abced1b34891c3d2dfe7dd7f1 Mon Sep 17 00:00:00 2001 From: JustOptimize Date: Fri, 8 Sep 2023 22:49:15 +0200 Subject: [PATCH 1/2] Error checking for WinGet --- .../3. Configuration/Start Menu/Install Open-Shell.cmd | 5 +++++ .../Process Explorer/Install and Replace Task Manager.cmd | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/playbook/Executables/AtlasDesktop/3. Configuration/Start Menu/Install Open-Shell.cmd b/src/playbook/Executables/AtlasDesktop/3. Configuration/Start Menu/Install Open-Shell.cmd index 843d7e0a8b..65ed767a36 100644 --- a/src/playbook/Executables/AtlasDesktop/3. Configuration/Start Menu/Install Open-Shell.cmd +++ b/src/playbook/Executables/AtlasDesktop/3. Configuration/Start Menu/Install Open-Shell.cmd @@ -40,6 +40,11 @@ echo] :: Download and install Open-Shell winget install -e --id Open-Shell.Open-Shell-Menu -h --accept-source-agreements --accept-package-agreements --force +if !errorlevel! NEQ 0 ( + echo Error: Open-Shell installation failed. + pause + exit /b 1 +) :: Download Fluent Metro theme for /f "delims=" %%a in ('PowerShell "(Invoke-RestMethod -Uri "https://api.github.com/repos/bonzibudd/Fluent-Metro/releases/latest").assets.browser_download_url"') do ( diff --git a/src/playbook/Executables/AtlasDesktop/6. Advanced Configuration/Utilities/Process Explorer/Install and Replace Task Manager.cmd b/src/playbook/Executables/AtlasDesktop/6. Advanced Configuration/Utilities/Process Explorer/Install and Replace Task Manager.cmd index d3ac8e9b33..531d426118 100644 --- a/src/playbook/Executables/AtlasDesktop/6. Advanced Configuration/Utilities/Process Explorer/Install and Replace Task Manager.cmd +++ b/src/playbook/Executables/AtlasDesktop/6. Advanced Configuration/Utilities/Process Explorer/Install and Replace Task Manager.cmd @@ -25,6 +25,11 @@ where winget > nul 2>&1 || ( echo Installing Process Explorer... winget install -e --id Microsoft.Sysinternals.ProcessExplorer --uninstall-previous -l "%windir%\AtlasModules\Apps\ProcessExplorer" -h --accept-source-agreements --accept-package-agreements --force --disable-interactivity > nul +if !errorlevel! NEQ 0 ( + echo Error: Process Explorer installation failed. + pause + exit /b 1 +) echo Creating the Start menu shortcut... PowerShell -NoP -C "$WshShell = New-Object -comObject WScript.Shell; $Shortcut = $WshShell.CreateShortcut("""$env:ProgramData\Microsoft\Windows\Start Menu\Programs\Process Explorer.lnk"""); $Shortcut.TargetPath = """$env:WinDir\AtlasModules\Apps\ProcessExplorer\procexp.exe"""; $Shortcut.Save()" > nul From df58592b7313788f5ffceb608601b4fbd4f8bb7b Mon Sep 17 00:00:00 2001 From: JustOptimize Date: Sat, 9 Sep 2023 00:04:59 +0200 Subject: [PATCH 2/2] Hide Winget output Hiding Winget output like in the "Install and replace Task Manager" script --- .../3. Configuration/Start Menu/Install Open-Shell.cmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/playbook/Executables/AtlasDesktop/3. Configuration/Start Menu/Install Open-Shell.cmd b/src/playbook/Executables/AtlasDesktop/3. Configuration/Start Menu/Install Open-Shell.cmd index 65ed767a36..7c1d0c14c4 100644 --- a/src/playbook/Executables/AtlasDesktop/3. Configuration/Start Menu/Install Open-Shell.cmd +++ b/src/playbook/Executables/AtlasDesktop/3. Configuration/Start Menu/Install Open-Shell.cmd @@ -39,7 +39,7 @@ call "%windir%\AtlasDesktop\3. Configuration\Start Menu\Disable Start Menu and S echo] :: Download and install Open-Shell -winget install -e --id Open-Shell.Open-Shell-Menu -h --accept-source-agreements --accept-package-agreements --force +winget install -e --id Open-Shell.Open-Shell-Menu -h --accept-source-agreements --accept-package-agreements --force > nul if !errorlevel! NEQ 0 ( echo Error: Open-Shell installation failed. pause