From bf76a06abc23e025484cfc17c214a3f46efba677 Mon Sep 17 00:00:00 2001 From: romanitho <96626929+Romanitho@users.noreply.github.com> Date: Fri, 28 Oct 2022 01:20:21 +0200 Subject: [PATCH] simplified install/uninstall batch files --- install.bat | 14 ++++++++++++-- uninstall.bat | 12 +++++++++++- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/install.bat b/install.bat index 24a52b8..611ed89 100644 --- a/install.bat +++ b/install.bat @@ -1,5 +1,15 @@ @echo off -SET arguments=-UpdatesAtLogon -UpdatesInterval Weekly -StartMenuShortcut -InstallUserContext +:::::::::::::::::::::::::::: +:: Put WAU Arguments here :: +:::::::::::::::::::::::::::: -powershell -Command "Get-ChildItem -Path '%~dp0' -Recurse | Unblock-File; Start-Process powershell.exe -Argument '-noprofile -executionpolicy bypass -file """%~dp0Winget-AutoUpdate-Install.ps1"" %arguments%'" -Verb RunAs +SET arguments=-UpdatesAtLogon -UpdatesInterval Weekly -InstallUserContext -StartMenuShortcut -DesktopShortcut + + +:::::::::::::::::::::::::::: +:: Run Powershell Script :: +:::::::::::::::::::::::::::: + +SET PowershellCmd=Start-Process powershell.exe -Argument '-noprofile -executionpolicy bypass -file "%~dp0Winget-AutoUpdate-Install.ps1" %arguments% +powershell -Command "& {Get-ChildItem -Path '%~dp0' -Recurse | Unblock-File; %PowershellCmd%'}" -Verb RunAs diff --git a/uninstall.bat b/uninstall.bat index 3ae3f08..25a214a 100644 --- a/uninstall.bat +++ b/uninstall.bat @@ -1,5 +1,15 @@ @echo off +:::::::::::::::::::::::::::: +:: Put WAU Arguments here :: +:::::::::::::::::::::::::::: + SET arguments=-Uninstall -powershell -Command "Get-ChildItem -Path '%~dp0' -Recurse | Unblock-File; Start-Process powershell.exe -Argument '-noprofile -executionpolicy bypass -file """%~dp0Winget-AutoUpdate-Install.ps1"" %arguments%'" -Verb RunAs + +:::::::::::::::::::::::::::: +:: Run Powershell Script :: +:::::::::::::::::::::::::::: + +SET PowershellCmd=Start-Process powershell.exe -Argument '-noprofile -executionpolicy bypass -file "%~dp0Winget-AutoUpdate-Install.ps1" %arguments% +powershell -Command "& {Get-ChildItem -Path '%~dp0' -Recurse | Unblock-File; %PowershellCmd%'}" -Verb RunAs