From c048ffc58ffd265f98f9cc1a91d7236e13c2017d Mon Sep 17 00:00:00 2001 From: romanitho <96626929+Romanitho@users.noreply.github.com> Date: Tue, 12 Dec 2023 21:31:40 +0100 Subject: [PATCH] New organisation and creation of packages --- .../workflows/WAU-AutoCreatePreVersion.yml | 42 +- .github/workflows/WAU-CreateNewVersion.yml | 42 +- {Policies => Sources/Policies}/ADMX/WAU.admx | 0 .../Policies}/ADMX/en-US/WAU.adml | 0 {Policies => Sources/Policies}/README.md | 0 .../WAU Configurator.lnk | Bin 2642 -> 2668 bytes Gui.ps1 => Sources/WAU/Gui.ps1 | 0 .../WAU/Winget-AutoUpdate-Install.ps1 | 1038 ++++++++--------- .../WAU/Winget-AutoUpdate}/Invisible.vbs | 0 .../WAU/Winget-AutoUpdate}/User-Run.ps1 | 0 .../WAU/Winget-AutoUpdate}/Version.txt | 0 .../WAU/Winget-AutoUpdate}/WAU-Policies.ps1 | 0 .../WAU/Winget-AutoUpdate}/WAU-Uninstall.ps1 | 0 .../WAU/Winget-AutoUpdate}/Winget-Install.ps1 | 0 .../WAU/Winget-AutoUpdate}/Winget-Notify.ps1 | 0 .../WAU/Winget-AutoUpdate}/Winget-Upgrade.ps1 | 0 .../functions/Add-ScopeMachine.ps1 | 0 .../functions/Add-Shortcut.ps1 | 0 .../functions/Confirm-Installation.ps1 | 0 .../functions/Get-AZCopy.ps1 | 0 .../functions/Get-AppInfo.ps1 | 0 .../functions/Get-ExcludedApps.ps1 | 0 .../functions/Get-IncludedApps.ps1 | 0 .../functions/Get-NotifLocale.ps1 | 0 .../functions/Get-WAUAvailableVersion.ps1 | 0 .../functions/Get-WAUConfig.ps1 | 0 .../functions/Get-WingetCmd.ps1 | 0 .../functions/Get-WingetOutdatedApps.ps1 | 0 .../functions/Get-WingetSystemApps.ps1 | 0 .../functions/Install-Prerequisites.ps1 | 0 .../functions/Invoke-DirProtect.ps1 | 0 .../functions/Invoke-LogRotation.ps1 | 0 .../functions/Invoke-PostUpdateActions.ps1 | 0 .../functions/Start-NotifTask.ps1 | 0 .../functions/Test-ListPath.ps1 | 0 .../functions/Test-Mods.ps1 | 0 .../functions/Test-ModsPath.ps1 | 0 .../functions/Test-Network.ps1 | 0 .../functions/Test-PendingReboot.ps1 | 0 .../functions/Update-App.ps1 | 0 .../functions/Update-StoreApps.ps1 | 0 .../functions/Update-WAU.ps1 | 0 .../functions/Update-WinGet.ps1 | 0 .../functions/Write-ToLog.ps1 | 0 .../WAU/Winget-AutoUpdate}/icons/error.png | Bin .../WAU/Winget-AutoUpdate}/icons/info.png | Bin .../WAU/Winget-AutoUpdate}/icons/success.png | Bin .../WAU/Winget-AutoUpdate}/icons/warning.png | Bin .../WAU/Winget-AutoUpdate}/locale/cz.xml | 122 +- .../WAU/Winget-AutoUpdate}/locale/de.xml | 0 .../WAU/Winget-AutoUpdate}/locale/en.xml | 0 .../WAU/Winget-AutoUpdate}/locale/es.xml | 0 .../WAU/Winget-AutoUpdate}/locale/fi.xml | 0 .../WAU/Winget-AutoUpdate}/locale/fr.xml | 0 .../WAU/Winget-AutoUpdate}/locale/hu.xml | 0 .../WAU/Winget-AutoUpdate}/locale/it.xml | 0 .../WAU/Winget-AutoUpdate}/locale/nb.xml | 0 .../WAU/Winget-AutoUpdate}/locale/nl.xml | 0 .../WAU/Winget-AutoUpdate}/locale/pl.xml | 0 .../WAU/Winget-AutoUpdate}/locale/pt.xml | 0 .../WAU/Winget-AutoUpdate}/locale/ru.xml | 0 .../WAU/Winget-AutoUpdate}/locale/sv.xml | 0 .../WAU/Winget-AutoUpdate}/locale/uk.xml | 0 .../WAU/Winget-AutoUpdate}/locale/zh-CHS.xml | 0 .../WAU/Winget-AutoUpdate}/locale/zh-CHT.xml | 0 .../WAU/Winget-AutoUpdate}/mods/README.md | 0 .../mods/_AppID-template.ps1 | 0 .../mods/_Mods-Functions.ps1 | 0 .../mods/_WAU-mods-template.ps1 | 0 .../mods/_WAU-notinstalled-template.ps1 | 0 .../Winget-AutoUpdate}/mods/bins/README.md | 0 .../WAU/excluded_apps.txt | 24 +- 72 files changed, 646 insertions(+), 622 deletions(-) rename {Policies => Sources/Policies}/ADMX/WAU.admx (100%) rename {Policies => Sources/Policies}/ADMX/en-US/WAU.adml (100%) rename {Policies => Sources/Policies}/README.md (100%) rename WAU Configurator.lnk => Sources/WAU Configurator.lnk (55%) rename Gui.ps1 => Sources/WAU/Gui.ps1 (100%) rename Winget-AutoUpdate-Install.ps1 => Sources/WAU/Winget-AutoUpdate-Install.ps1 (98%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/Invisible.vbs (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/User-Run.ps1 (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/Version.txt (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/WAU-Policies.ps1 (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/WAU-Uninstall.ps1 (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/Winget-Install.ps1 (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/Winget-Notify.ps1 (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/Winget-Upgrade.ps1 (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/functions/Add-ScopeMachine.ps1 (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/functions/Add-Shortcut.ps1 (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/functions/Confirm-Installation.ps1 (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/functions/Get-AZCopy.ps1 (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/functions/Get-AppInfo.ps1 (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/functions/Get-ExcludedApps.ps1 (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/functions/Get-IncludedApps.ps1 (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/functions/Get-NotifLocale.ps1 (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/functions/Get-WAUAvailableVersion.ps1 (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/functions/Get-WAUConfig.ps1 (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/functions/Get-WingetCmd.ps1 (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/functions/Get-WingetOutdatedApps.ps1 (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/functions/Get-WingetSystemApps.ps1 (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/functions/Install-Prerequisites.ps1 (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/functions/Invoke-DirProtect.ps1 (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/functions/Invoke-LogRotation.ps1 (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/functions/Invoke-PostUpdateActions.ps1 (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/functions/Start-NotifTask.ps1 (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/functions/Test-ListPath.ps1 (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/functions/Test-Mods.ps1 (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/functions/Test-ModsPath.ps1 (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/functions/Test-Network.ps1 (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/functions/Test-PendingReboot.ps1 (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/functions/Update-App.ps1 (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/functions/Update-StoreApps.ps1 (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/functions/Update-WAU.ps1 (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/functions/Update-WinGet.ps1 (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/functions/Write-ToLog.ps1 (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/icons/error.png (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/icons/info.png (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/icons/success.png (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/icons/warning.png (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/locale/cz.xml (96%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/locale/de.xml (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/locale/en.xml (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/locale/es.xml (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/locale/fi.xml (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/locale/fr.xml (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/locale/hu.xml (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/locale/it.xml (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/locale/nb.xml (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/locale/nl.xml (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/locale/pl.xml (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/locale/pt.xml (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/locale/ru.xml (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/locale/sv.xml (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/locale/uk.xml (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/locale/zh-CHS.xml (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/locale/zh-CHT.xml (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/mods/README.md (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/mods/_AppID-template.ps1 (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/mods/_Mods-Functions.ps1 (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/mods/_WAU-mods-template.ps1 (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/mods/_WAU-notinstalled-template.ps1 (100%) rename {Winget-AutoUpdate => Sources/WAU/Winget-AutoUpdate}/mods/bins/README.md (100%) rename excluded_apps.txt => Sources/WAU/excluded_apps.txt (95%) diff --git a/.github/workflows/WAU-AutoCreatePreVersion.yml b/.github/workflows/WAU-AutoCreatePreVersion.yml index c4429c9..4c2dabd 100644 --- a/.github/workflows/WAU-AutoCreatePreVersion.yml +++ b/.github/workflows/WAU-AutoCreatePreVersion.yml @@ -68,7 +68,7 @@ jobs: - name: Overwrite Version.txt file uses: DamianReeves/write-file-action@0a7fcbe1960c53fc08fe789fa4850d24885f4d84 # v1.2 with: - path: Winget-AutoUpdate/Version.txt + path: Sources/WAU/Winget-AutoUpdate/Version.txt write-mode: overwrite contents: ${{ steps.versioning.outputs.version }} @@ -82,23 +82,35 @@ jobs: - name: Build project run: | - # Get MDT from Microsoft + echo "### Get MDT from Microsoft ###" wget https://download.microsoft.com/download/3/3/9/339BE62D-B4B8-4956-B58D-73C4685FC492/MicrosoftDeploymentToolkit_x64.msi - # Extract MSI + + echo "### Extract MSI ###" 7z x MicrosoftDeploymentToolkit_x64.msi - # Copy ServiceUI.exe to Winget-AutoUpdate folder - mv Modena_File206 Winget-AutoUpdate/ServiceUI.exe - # Zip WAU - zip -r WAU.zip Winget-AutoUpdate - zip WAU.zip Winget-AutoUpdate-Install.ps1 - zip WAU.zip excluded_apps.txt - zip WAU.zip Gui.ps1 - zip WAU.zip "WAU Configurator.lnk" - # Zip ADMX - cd Policies - zip -r ../WAU_ADMX.zip * + + echo "### Copy ServiceUI.exe to 'Sources/WAU/Winget-AutoUpdate' folder ###" + mv Modena_File206 Sources/WAU/Winget-AutoUpdate/ServiceUI.exe -v + + echo "### Go to Sources ###" + cd Sources + + echo "### Zip WAU ###" + cd WAU + zip -r ../../WAU.zip Winget-AutoUpdate + zip ../../WAU.zip Winget-AutoUpdate-Install.ps1 + zip ../../WAU.zip excluded_apps.txt cd .. - # Add install counter + + echo "### Zip WAU-Configurator ###" + zip -r ../WAU-Configurator.zip WAU + zip ../WAU-Configurator.zip "WAU Configurator.lnk" + + echo "### Zip ADMX ###" + cd Policies + zip -r ../../WAU_ADMX.zip * + cd ../.. + + echo "### Create install counter file ###" echo "Install counter file." > WAU_InstallCounter - name: Create release diff --git a/.github/workflows/WAU-CreateNewVersion.yml b/.github/workflows/WAU-CreateNewVersion.yml index ec60dad..cd5fce7 100644 --- a/.github/workflows/WAU-CreateNewVersion.yml +++ b/.github/workflows/WAU-CreateNewVersion.yml @@ -41,7 +41,7 @@ jobs: - name: Overwrite Version.txt file uses: DamianReeves/write-file-action@0a7fcbe1960c53fc08fe789fa4850d24885f4d84 # v1.2 with: - path: Winget-AutoUpdate/Version.txt + path: Sources/WAU/Winget-AutoUpdate/Version.txt write-mode: overwrite contents: "${{ steps.versioning.outputs.version }}" @@ -55,23 +55,35 @@ jobs: - name: Build project run: | - # Get MDT from Microsoft + echo "### Get MDT from Microsoft ###" wget https://download.microsoft.com/download/3/3/9/339BE62D-B4B8-4956-B58D-73C4685FC492/MicrosoftDeploymentToolkit_x64.msi - # Extract MSI + + echo "### Extract MSI ###" 7z x MicrosoftDeploymentToolkit_x64.msi - # Copy ServiceUI.exe to Winget-AutoUpdate folder - mv Modena_File206 Winget-AutoUpdate/ServiceUI.exe - # Zip WAU - zip -r WAU.zip Winget-AutoUpdate - zip WAU.zip Winget-AutoUpdate-Install.ps1 - zip WAU.zip excluded_apps.txt - zip WAU.zip Gui.ps1 - zip WAU.zip "WAU Configurator.lnk" - # Zip ADMX - cd Policies - zip -r ../WAU_ADMX.zip * + + echo "### Copy ServiceUI.exe to 'Sources/WAU/Winget-AutoUpdate' folder ###" + mv Modena_File206 Sources/WAU/Winget-AutoUpdate/ServiceUI.exe -v + + echo "### Go to Sources ###" + cd Sources + + echo "### Zip WAU ###" + cd WAU + zip -r ../../WAU.zip Winget-AutoUpdate + zip ../../WAU.zip Winget-AutoUpdate-Install.ps1 + zip ../../WAU.zip excluded_apps.txt cd .. - # Add install counter + + echo "### Zip WAU-Configurator ###" + zip -r ../WAU-Configurator.zip WAU + zip ../WAU-Configurator.zip "WAU Configurator.lnk" + + echo "### Zip ADMX ###" + cd Policies + zip -r ../../WAU_ADMX.zip * + cd ../.. + + echo "### Create install counter file ###" echo "Install counter file." > WAU_InstallCounter - name: Create release diff --git a/Policies/ADMX/WAU.admx b/Sources/Policies/ADMX/WAU.admx similarity index 100% rename from Policies/ADMX/WAU.admx rename to Sources/Policies/ADMX/WAU.admx diff --git a/Policies/ADMX/en-US/WAU.adml b/Sources/Policies/ADMX/en-US/WAU.adml similarity index 100% rename from Policies/ADMX/en-US/WAU.adml rename to Sources/Policies/ADMX/en-US/WAU.adml diff --git a/Policies/README.md b/Sources/Policies/README.md similarity index 100% rename from Policies/README.md rename to Sources/Policies/README.md diff --git a/WAU Configurator.lnk b/Sources/WAU Configurator.lnk similarity index 55% rename from WAU Configurator.lnk rename to Sources/WAU Configurator.lnk index b9e20e7f84d4dec142ba78a2549bf2297f17b26c..4c53da3376d072ae72e36cd487a0eab2cb0ea53d 100644 GIT binary patch delta 48 scmca4@ - -[CmdletBinding()] -param( - [Parameter(Mandatory = $False)] [Alias('S')] [Switch] $Silent = $false, - [Parameter(Mandatory = $False)] [Alias('Path', 'WingetUpdatePath')] [String] $WAUinstallPath = "$env:ProgramData\Winget-AutoUpdate", - [Parameter(Mandatory = $False)] [Alias('List')] [String] $ListPath, - [Parameter(Mandatory = $False)] [Alias('Mods')] [String] $ModsPath, - [Parameter(Mandatory = $False)] [Alias('AzureBlobURL')] [String] $AzureBlobSASURL, - [Parameter(Mandatory = $False)] [Switch] $DoNotUpdate = $false, - [Parameter(Mandatory = $False)] [Switch] $DisableWAUAutoUpdate = $false, - [Parameter(Mandatory = $False)] [Switch] $RunOnMetered = $false, - [Parameter(Mandatory = $False)] [Switch] $Uninstall = $false, - [Parameter(Mandatory = $False)] [Switch] $NoClean = $false, - [Parameter(Mandatory = $False)] [Switch] $DesktopShortcut = $false, - [Parameter(Mandatory = $False)] [Switch] $StartMenuShortcut = $false, - [Parameter(Mandatory = $False)] [Switch] $UseWhiteList = $false, - [Parameter(Mandatory = $False)] [ValidateSet("Full", "SuccessOnly", "None")] [String] $NotificationLevel = "Full", - [Parameter(Mandatory = $False)] [Switch] $UpdatesAtLogon = $false, - [Parameter(Mandatory = $False)] [ValidateSet("Daily", "BiDaily", "Weekly", "BiWeekly", "Monthly", "Never")] [String] $UpdatesInterval = "Daily", - [Parameter(Mandatory = $False)] [DateTime] $UpdatesAtTime = ("06am"), - [Parameter(Mandatory = $False)] [Switch] $BypassListForUsers = $false, - [Parameter(Mandatory = $False)] [Switch] $InstallUserContext = $false, - [Parameter(Mandatory = $False)] [ValidateRange(0, 99)] [int32] $MaxLogFiles = 3, - [Parameter(Mandatory = $False)] [int64] $MaxLogSize = 1048576 # in bytes, default is 1048576 = 1 MB -) - - -<# FUNCTIONS #> - -#Include external Functions -. "$PSScriptRoot\Winget-AutoUpdate\functions\Install-Prerequisites.ps1" -. "$PSScriptRoot\Winget-AutoUpdate\functions\Invoke-DirProtect.ps1" -. "$PSScriptRoot\Winget-AutoUpdate\functions\Update-WinGet.ps1" -. "$PSScriptRoot\Winget-AutoUpdate\functions\Update-StoreApps.ps1" -. "$PSScriptRoot\Winget-AutoUpdate\functions\Add-Shortcut.ps1" -. "$PSScriptRoot\Winget-AutoUpdate\functions\Write-ToLog.ps1" - - -function Install-WingetAutoUpdate { - - Write-ToLog "Installing WAU..." "Yellow" - - try { - #Copy files to location - if (!(Test-Path "$WAUinstallPath\Winget-Upgrade.ps1")) { - Copy-Item -Path "$PSScriptRoot\Winget-AutoUpdate\*" -Destination $WAUinstallPath -Recurse -Force -ErrorAction SilentlyContinue - Write-ToLog "-> Running fresh installation..." - } - elseif ($NoClean) { - #Keep critical files - Get-ChildItem -Path $WAUinstallPath -Exclude *.txt, mods, logs, icons | Remove-Item -Recurse -Force - Copy-Item -Path "$PSScriptRoot\Winget-AutoUpdate\*" -Destination $WAUinstallPath -Exclude icons -Recurse -Force -ErrorAction SilentlyContinue #Exclude icons if personalized - Write-ToLog "-> Updating previous installation. Keeping critical existing files..." - } - else { - #Keep logs only - Get-ChildItem -Path $WAUinstallPath -Exclude logs | Remove-Item -Recurse -Force - Copy-Item -Path "$PSScriptRoot\Winget-AutoUpdate\*" -Destination $WAUinstallPath -Recurse -Force -ErrorAction SilentlyContinue - Write-ToLog "-> Updating previous installation..." - } - - #White List or Black List apps - if ($UseWhiteList) { - #If fresh install and "included_apps.txt" exists, copy the list to WAU - if ((!$NoClean) -and (Test-Path "$PSScriptRoot\included_apps.txt")) { - Copy-Item -Path "$PSScriptRoot\included_apps.txt" -Destination $WAUinstallPath -Recurse -Force -ErrorAction SilentlyContinue - Write-ToLog "-> Copied a brand new Whitelist." - } - #Else, only copy the "included_apps.txt" list if not existing in WAU - elseif (!(Test-Path "$WAUinstallPath\included_apps.txt")) { - Copy-Item -Path "$PSScriptRoot\included_apps.txt" -Destination $WAUinstallPath -Recurse -Force -ErrorAction SilentlyContinue - Write-ToLog "-> No Whitelist was existing. Copied from install sources." - } - } - else { - if (!$NoClean) { - Copy-Item -Path "$PSScriptRoot\excluded_apps.txt" -Destination $WAUinstallPath -Recurse -Force -ErrorAction SilentlyContinue - Write-ToLog "-> Copied brand new Blacklist." - } - elseif (!(Test-Path "$WAUinstallPath\excluded_apps.txt")) { - Copy-Item -Path "$PSScriptRoot\excluded_apps.txt" -Destination $WAUinstallPath -Recurse -Force -ErrorAction SilentlyContinue - Write-ToLog "-> No Blacklist was existing. Copied from install sources." - } - } - - # Set dummy regkeys for notification name and icon - & reg add "HKCR\AppUserModelId\Windows.SystemToast.Winget.Notification" /v DisplayName /t REG_EXPAND_SZ /d "Application Update" /f | Out-Null - & reg add "HKCR\AppUserModelId\Windows.SystemToast.Winget.Notification" /v IconUri /t REG_EXPAND_SZ /d %SystemRoot%\system32\@WindowsUpdateToastIcon.png /f | Out-Null - - # Clean potential old install - Get-ScheduledTask -TaskName "Winget-AutoUpdate" -ErrorAction SilentlyContinue | Unregister-ScheduledTask -Confirm:$False - Get-ScheduledTask -TaskName "Winget-AutoUpdate-Notify" -ErrorAction SilentlyContinue | Unregister-ScheduledTask -Confirm:$False - Get-ScheduledTask -TaskName "Winget-AutoUpdate-UserContext" -ErrorAction SilentlyContinue | Unregister-ScheduledTask -Confirm:$False - - # Settings for the scheduled task for Updates (System) - Write-ToLog "-> Installing WAU scheduled tasks" - $taskAction = New-ScheduledTaskAction -Execute "powershell.exe" -Argument "-NoProfile -ExecutionPolicy Bypass -File `"$($WAUinstallPath)\winget-upgrade.ps1`"" - $taskTriggers = @() - if ($UpdatesAtLogon) { - $tasktriggers += New-ScheduledTaskTrigger -AtLogOn - } - if ($UpdatesInterval -eq "Daily") { - $tasktriggers += New-ScheduledTaskTrigger -Daily -At $UpdatesAtTime - } - elseif ($UpdatesInterval -eq "BiDaily") { - $tasktriggers += New-ScheduledTaskTrigger -Daily -At $UpdatesAtTime -DaysInterval 2 - } - elseif ($UpdatesInterval -eq "Weekly") { - $tasktriggers += New-ScheduledTaskTrigger -Weekly -At $UpdatesAtTime -DaysOfWeek 2 - } - elseif ($UpdatesInterval -eq "BiWeekly") { - $tasktriggers += New-ScheduledTaskTrigger -Weekly -At $UpdatesAtTime -DaysOfWeek 2 -WeeksInterval 2 - } - elseif ($UpdatesInterval -eq "Monthly") { - $tasktriggers += New-ScheduledTaskTrigger -Weekly -At $UpdatesAtTime -DaysOfWeek 2 -WeeksInterval 4 - } - $taskUserPrincipal = New-ScheduledTaskPrincipal -UserId S-1-5-18 -RunLevel Highest - $taskSettings = New-ScheduledTaskSettingsSet -Compatibility Win8 -StartWhenAvailable -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -ExecutionTimeLimit 03:00:00 - # Set up the task, and register it - if ($taskTriggers) { - $task = New-ScheduledTask -Action $taskAction -Principal $taskUserPrincipal -Settings $taskSettings -Trigger $taskTriggers - } - else { - $task = New-ScheduledTask -Action $taskAction -Principal $taskUserPrincipal -Settings $taskSettings - } - Register-ScheduledTask -TaskName 'Winget-AutoUpdate' -TaskPath 'WAU' -InputObject $task -Force | Out-Null - - # Settings for the scheduled task in User context - $taskAction = New-ScheduledTaskAction -Execute "wscript.exe" -Argument "`"$($WAUinstallPath)\Invisible.vbs`" `"powershell.exe -NoProfile -ExecutionPolicy Bypass -File `"`"`"$($WAUinstallPath)\winget-upgrade.ps1`"`"" - $taskUserPrincipal = New-ScheduledTaskPrincipal -GroupId S-1-5-11 - $taskSettings = New-ScheduledTaskSettingsSet -Compatibility Win8 -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -ExecutionTimeLimit 03:00:00 - # Set up the task for user apps - $task = New-ScheduledTask -Action $taskAction -Principal $taskUserPrincipal -Settings $taskSettings - Register-ScheduledTask -TaskName 'Winget-AutoUpdate-UserContext' -TaskPath 'WAU' -InputObject $task -Force | Out-Null - - # Settings for the scheduled task for Notifications - $taskAction = New-ScheduledTaskAction -Execute "wscript.exe" -Argument "`"$($WAUinstallPath)\Invisible.vbs`" `"powershell.exe -NoProfile -ExecutionPolicy Bypass -File `"`"`"$($WAUinstallPath)\winget-notify.ps1`"`"" - $taskUserPrincipal = New-ScheduledTaskPrincipal -GroupId S-1-5-11 - $taskSettings = New-ScheduledTaskSettingsSet -Compatibility Win8 -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -ExecutionTimeLimit 00:05:00 - # Set up the task, and register it - $task = New-ScheduledTask -Action $taskAction -Principal $taskUserPrincipal -Settings $taskSettings - Register-ScheduledTask -TaskName 'Winget-AutoUpdate-Notify' -TaskPath 'WAU' -InputObject $task -Force | Out-Null - - # Settings for the GPO scheduled task - $taskAction = New-ScheduledTaskAction -Execute "powershell.exe" -Argument "-NoProfile -ExecutionPolicy Bypass -File `"$($WAUinstallPath)\WAU-Policies.ps1`"" - $tasktrigger = New-ScheduledTaskTrigger -Daily -At 6am - $taskUserPrincipal = New-ScheduledTaskPrincipal -UserId S-1-5-18 -RunLevel Highest - $taskSettings = New-ScheduledTaskSettingsSet -Compatibility Win8 -StartWhenAvailable -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -ExecutionTimeLimit 00:05:00 - # Set up the task, and register it - $task = New-ScheduledTask -Action $taskAction -Principal $taskUserPrincipal -Settings $taskSettings -Trigger $taskTrigger - Register-ScheduledTask -TaskName 'Winget-AutoUpdate-Policies' -TaskPath 'WAU' -InputObject $task -Force | Out-Null - - #Set task readable/runnable for all users - $scheduler = New-Object -ComObject "Schedule.Service" - $scheduler.Connect() - $task = $scheduler.GetFolder("WAU").GetTask("Winget-AutoUpdate") - $sec = $task.GetSecurityDescriptor(0xF) - $sec = $sec + '(A;;GRGX;;;AU)' - $task.SetSecurityDescriptor($sec, 0) - - # Configure Reg Key - Write-ToLog "-> Setting Registry config" - New-Item $regPath -Force | Out-Null - New-ItemProperty $regPath -Name DisplayName -Value "Winget-AutoUpdate (WAU)" -Force | Out-Null - New-ItemProperty $regPath -Name DisplayIcon -Value "C:\Windows\System32\shell32.dll,-16739" -Force | Out-Null - New-ItemProperty $regPath -Name DisplayVersion -Value $WAUVersion -Force | Out-Null - New-ItemProperty $regPath -Name InstallLocation -Value $WAUinstallPath -Force | Out-Null - New-ItemProperty $regPath -Name UninstallString -Value "powershell.exe -noprofile -executionpolicy bypass -file `"$WAUinstallPath\WAU-Uninstall.ps1`"" -Force | Out-Null - New-ItemProperty $regPath -Name QuietUninstallString -Value "powershell.exe -noprofile -executionpolicy bypass -file `"$WAUinstallPath\WAU-Uninstall.ps1`"" -Force | Out-Null - New-ItemProperty $regPath -Name NoModify -Value 1 -Force | Out-Null - New-ItemProperty $regPath -Name NoRepair -Value 1 -Force | Out-Null - New-ItemProperty $regPath -Name Publisher -Value "Romanitho" -Force | Out-Null - New-ItemProperty $regPath -Name URLInfoAbout -Value "https://github.com/Romanitho/Winget-AutoUpdate" -Force | Out-Null - New-ItemProperty $regPath -Name WAU_NotificationLevel -Value $NotificationLevel -Force | Out-Null - if ($WAUVersion -match "-") { - New-ItemProperty $regPath -Name WAU_UpdatePrerelease -Value 1 -PropertyType DWord -Force | Out-Null - } - else { - New-ItemProperty $regPath -Name WAU_UpdatePrerelease -Value 0 -PropertyType DWord -Force | Out-Null - } - New-ItemProperty $regPath -Name WAU_PostUpdateActions -Value 0 -PropertyType DWord -Force | Out-Null - New-ItemProperty $regPath -Name WAU_MaxLogFiles -Value $MaxLogFiles -PropertyType DWord -Force | Out-Null - New-ItemProperty $regPath -Name WAU_MaxLogSize -Value $MaxLogSize -PropertyType DWord -Force | Out-Null - New-ItemProperty $regPath -Name WAU_UpdatesAtTime -Value $UpdatesAtTime -Force | Out-Null - New-ItemProperty $regPath -Name WAU_UpdatesInterval -Value $UpdatesInterval -Force | Out-Null - if ($UpdatesAtLogon) { - New-ItemProperty $regPath -Name WAU_UpdatesAtLogon -Value 1 -PropertyType DWord -Force | Out-Null - } - if ($DisableWAUAutoUpdate) { - New-ItemProperty $regPath -Name WAU_DisableAutoUpdate -Value 1 -Force | Out-Null - } - if ($UseWhiteList) { - New-ItemProperty $regPath -Name WAU_UseWhiteList -Value 1 -PropertyType DWord -Force | Out-Null - } - if (!$RunOnMetered) { - New-ItemProperty $regPath -Name WAU_DoNotRunOnMetered -Value 1 -PropertyType DWord -Force | Out-Null - } - if ($ListPath) { - New-ItemProperty $regPath -Name WAU_ListPath -Value $ListPath -Force | Out-Null - } - if ($ModsPath) { - New-ItemProperty $regPath -Name WAU_ModsPath -Value $ModsPath -Force | Out-Null - } - if ($AzureBlobSASURL) { - New-ItemProperty $regPath -Name WAU_AzureBlobSASURL -Value $AzureBlobSASURL -Force | Out-Null - } - if ($BypassListForUsers) { - New-ItemProperty $regPath -Name WAU_BypassListForUsers -Value 1 -PropertyType DWord -Force | Out-Null - } - if ($InstallUserContext) { - New-ItemProperty $regPath -Name WAU_UserContext -Value 1 -PropertyType DWord -Force | Out-Null - } - if ($DesktopShortcut) { - New-ItemProperty $regPath -Name WAU_DesktopShortcut -Value 1 -PropertyType DWord -Force | Out-Null - } - if ($StartMenuShortcut) { - New-ItemProperty $regPath -Name WAU_StartMenuShortcut -Value 1 -PropertyType DWord -Force | Out-Null - } - - #Security check - Write-ToLog "-> Checking Mods Directory:" - $Protected = Invoke-DirProtect "$WAUinstallPath\mods" - if ($Protected -eq $True) { - Write-ToLog " The mods directory is secured!" "Cyan" - } - else { - Write-ToLog " Error: The mods directory couldn't be verified as secured!" "Red" - } - Write-ToLog "-> Checking Functions Directory:" - $Protected = Invoke-DirProtect "$WAUinstallPath\Functions" - if ($Protected -eq $True) { - Write-ToLog " The Functions directory is secured!" "Cyan" - } - else { - Write-ToLog " Error: The Functions directory couldn't be verified as secured!" "Red" - } - - #Create Shortcuts - if ($StartMenuShortcut) { - if (!(Test-Path "${env:ProgramData}\Microsoft\Windows\Start Menu\Programs\Winget-AutoUpdate (WAU)")) { - New-Item -ItemType Directory -Force -Path "${env:ProgramData}\Microsoft\Windows\Start Menu\Programs\Winget-AutoUpdate (WAU)" | Out-Null - } - Add-Shortcut "wscript.exe" "${env:ProgramData}\Microsoft\Windows\Start Menu\Programs\Winget-AutoUpdate (WAU)\WAU - Check for updated Apps.lnk" "`"$($WAUinstallPath)\Invisible.vbs`" `"powershell.exe -NoProfile -ExecutionPolicy Bypass -File `"`"`"$($WAUinstallPath)\user-run.ps1`"`"" "${env:SystemRoot}\System32\shell32.dll,-16739" "Manual start of Winget-AutoUpdate (WAU)..." - Add-Shortcut "wscript.exe" "${env:ProgramData}\Microsoft\Windows\Start Menu\Programs\Winget-AutoUpdate (WAU)\WAU - Open logs.lnk" "`"$($WAUinstallPath)\Invisible.vbs`" `"powershell.exe -NoProfile -ExecutionPolicy Bypass -File `"`"`"$($WAUinstallPath)\user-run.ps1`" -Logs`"" "${env:SystemRoot}\System32\shell32.dll,-16763" "Open existing WAU logs..." - Add-Shortcut "wscript.exe" "${env:ProgramData}\Microsoft\Windows\Start Menu\Programs\Winget-AutoUpdate (WAU)\WAU - Web Help.lnk" "`"$($WAUinstallPath)\Invisible.vbs`" `"powershell.exe -NoProfile -ExecutionPolicy Bypass -File `"`"`"$($WAUinstallPath)\user-run.ps1`" -Help`"" "${env:SystemRoot}\System32\shell32.dll,-24" "Help for WAU..." - } - - if ($DesktopShortcut) { - Add-Shortcut "wscript.exe" "${env:Public}\Desktop\WAU - Check for updated Apps.lnk" "`"$($WAUinstallPath)\Invisible.vbs`" `"powershell.exe -NoProfile -ExecutionPolicy Bypass -File `"`"`"$($WAUinstallPath)\user-run.ps1`"`"" "${env:SystemRoot}\System32\shell32.dll,-16739" "Manual start of Winget-AutoUpdate (WAU)..." - } - - #Add 1 to counter file - try { - Invoke-RestMethod -Uri "https://github.com/Romanitho/Winget-AutoUpdate/releases/download/v$($WAUVersion)/WAU_InstallCounter" | Out-Null - } - catch { - Write-ToLog "-> Not able to report installation." "Yellow" - } - - Write-ToLog "-> WAU Installation succeeded!`n" "Green" - Start-sleep 1 - - #Run Winget ? - Start-WingetAutoUpdate - } - catch { - Write-ToLog "-> WAU Installation failed! Error $_ - Try running me with admin rights.`n" "Red" - Start-sleep 1 - return $False - } -} - -function Uninstall-WingetAutoUpdate { - - Write-ToLog "Uninstalling WAU started!" "Yellow" - - #Get registry install location - $InstallLocation = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate\" -Name InstallLocation -ErrorAction SilentlyContinue - - #Check if installed location exists and delete - if ($InstallLocation) { - - try { - if (!$NoClean) { - Write-ToLog "-> Removing files and config." - Get-ChildItem -Path $InstallLocation -Exclude logs | Remove-Item -Force -Recurse - if (Test-Path "${env:ProgramData}\Microsoft\IntuneManagementExtension\Logs\WAU-updates.log") { - Remove-Item -Path "${env:ProgramData}\Microsoft\IntuneManagementExtension\Logs\WAU-updates.log" -Force -ErrorAction SilentlyContinue | Out-Null - } - if (Test-Path "${env:ProgramData}\Microsoft\IntuneManagementExtension\Logs\WAU-install.log") { - Remove-Item -Path "${env:ProgramData}\Microsoft\IntuneManagementExtension\Logs\WAU-install.log" -Force -ErrorAction SilentlyContinue | Out-Null - } - } - else { - #Keep critical files - Write-ToLog "-> Removing files. Keeping config." - Get-ChildItem -Path $InstallLocation -Exclude *.txt, mods, logs | Remove-Item -Recurse -Force - } - & reg delete "HKCR\AppUserModelId\Windows.SystemToast.Winget.Notification" /f | Out-Null - & reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate" /f | Out-Null - - if ((Test-Path "${env:ProgramData}\Microsoft\Windows\Start Menu\Programs\Winget-AutoUpdate (WAU)")) { - Remove-Item -Path "${env:ProgramData}\Microsoft\Windows\Start Menu\Programs\Winget-AutoUpdate (WAU)" -Recurse -Force | Out-Null - } - - if ((Test-Path "${env:Public}\Desktop\WAU - Check for updated Apps.lnk")) { - Remove-Item -Path "${env:Public}\Desktop\WAU - Check for updated Apps.lnk" -Force | Out-Null - } - - Write-ToLog "-> Removing scheduled tasks." - Get-ScheduledTask -TaskName "Winget-AutoUpdate" -ErrorAction SilentlyContinue | Unregister-ScheduledTask -Confirm:$False - Get-ScheduledTask -TaskName "Winget-AutoUpdate-Notify" -ErrorAction SilentlyContinue | Unregister-ScheduledTask -Confirm:$False - Get-ScheduledTask -TaskName "Winget-AutoUpdate-UserContext" -ErrorAction SilentlyContinue | Unregister-ScheduledTask -Confirm:$False - Get-ScheduledTask -TaskName "Winget-AutoUpdate-Policies" -ErrorAction SilentlyContinue | Unregister-ScheduledTask -Confirm:$False - - Write-ToLog "Uninstallation succeeded!`n" "Green" - Start-sleep 1 - } - catch { - Write-ToLog "Uninstallation failed! Run as admin ?`n" "Red" - Start-sleep 1 - } - } - else { - Write-ToLog "WAU is not installed!`n" "Red" - Start-sleep 1 - } -} - -function Start-WingetAutoUpdate { - #If -DoNotUpdate is true, skip. - if (!($DoNotUpdate)) { - #If -Silent, run Winget-AutoUpdate now - if ($Silent) { - $RunWinget = $True - } - #Ask for WingetAutoUpdate - else { - $MsgBoxTitle = "Winget-AutoUpdate" - $MsgBoxContent = "Would you like to run Winget-AutoUpdate now?" - $MsgBoxTimeOut = 60 - $MsgBoxReturn = (New-Object -ComObject "Wscript.Shell").Popup($MsgBoxContent, $MsgBoxTimeOut, $MsgBoxTitle, 4 + 32) - if ($MsgBoxReturn -ne 7) { - $RunWinget = $True - } - } - if ($RunWinget) { - try { - Write-ToLog "Running Winget-AutoUpdate..." "Yellow" - Get-ScheduledTask -TaskName "Winget-AutoUpdate" -ErrorAction SilentlyContinue | Start-ScheduledTask -ErrorAction SilentlyContinue - while ((Get-ScheduledTask -TaskName "Winget-AutoUpdate").State -ne 'Ready') { - Start-Sleep 1 - } - } - catch { - Write-ToLog "Failed to run Winget-AutoUpdate..." "Red" - } - } - } - else { - Write-ToLog "Skip running Winget-AutoUpdate" - } -} - - -<# APP INFO #> - -$WAUVersion = Get-Content "$PSScriptRoot\Winget-AutoUpdate\Version.txt" -ErrorAction SilentlyContinue - - -<# MAIN #> - -#If running as a 32-bit process on an x64 system, re-launch as a 64-bit process -if ("$env:PROCESSOR_ARCHITEW6432" -ne "ARM64") { - if (Test-Path "$($env:WINDIR)\SysNative\WindowsPowerShell\v1.0\powershell.exe") { - Start-Process "$($env:WINDIR)\SysNative\WindowsPowerShell\v1.0\powershell.exe" -Wait -NoNewWindow -ArgumentList "-NoProfile -ExecutionPolicy Bypass -Command $($MyInvocation.line)" - Exit $lastexitcode - } -} - -#Config console output encoding -$null = cmd /c '' #Tip for ISE -[Console]::OutputEncoding = [System.Text.Encoding]::UTF8 - -# Workaround for ARM64 (Access Denied / Win32 internal Server error) -$Script:ProgressPreference = 'SilentlyContinue' - -#Set install log file -$Script:LogFile = "$WAUinstallPath\logs\WAU-Installer.log" - -Write-Host "`n " -Write-Host "`t 888 888 d8888 888 888" -ForegroundColor Magenta -Write-Host "`t 888 o 888 d88888 888 888" -ForegroundColor Magenta -Write-Host "`t 888 d8b 888 d88P888 888 888" -ForegroundColor Magenta -Write-Host "`t 888 d888b 888 d88P 888 888 888" -ForegroundColor Magenta -Write-Host "`t 888d88888b888 d88P 888 888 888" -ForegroundColor Magenta -Write-Host "`t 88888P Y88888 d88P 888 888 888" -ForegroundColor Cyan -Write-Host "`t 8888P Y8888 d88P 888 888 888" -ForegroundColor Magenta -Write-Host "`t 888P Y888 d88P 888 Y8888888P`n" -ForegroundColor Magenta -Write-Host "`t Winget-AutoUpdate $WAUVersion`n" -ForegroundColor Cyan -Write-Host "`t https://github.com/Romanitho/Winget-AutoUpdate`n" -ForegroundColor Magenta -Write-Host "`t________________________________________________________`n" - -#Define WAU registry key -$Script:regPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate" - -if (!$Uninstall) { - Write-ToLog " INSTALLING WAU" -LogColor "Cyan" -IsHeader - Install-Prerequisites - $UpdateWinget = Update-Winget - if ($UpdateWinget -ne "fail") { - Install-WingetAutoUpdate - } - else { - Write-ToLog "Winget is mandatory to execute WAU." "Red" - } -} -else { - Write-ToLog " UNINSTALLING WAU" -LogColor "Cyan" -IsHeader - Uninstall-WingetAutoUpdate -} - -if (Test-Path "$WAUinstallPath\Version.txt") { - Remove-Item "$WAUinstallPath\Version.txt" -Force -} - -Write-ToLog "End of process." "Cyan" -Start-Sleep 3 +<# +.SYNOPSIS +Configure Winget to daily update installed apps. + +.DESCRIPTION +Install powershell scripts and scheduled task to daily run Winget upgrade and notify connected users. +Posibility to exclude apps from auto-update +https://github.com/Romanitho/Winget-AutoUpdate + +.PARAMETER Silent +Install Winget-AutoUpdate and prerequisites silently + +.PARAMETER MaxLogFiles +Specify number of allowed log files (Default is 3 of 0-99: Setting MaxLogFiles to 0 don't delete any old archived log files, 1 keeps the original one and just let it grow) + +.PARAMETER MaxLogSize +Specify the size of the log file in bytes before rotating. (Default is 1048576 = 1 MB) + +.PARAMETER WAUinstallPath +Specify Winget-AutoUpdate installation localtion. Default: C:\ProgramData\Winget-AutoUpdate\ + +.PARAMETER DoNotUpdate +Do not run Winget-AutoUpdate after installation. By default, Winget-AutoUpdate is run just after installation. + +.PARAMETER DisableWAUAutoUpdate +Disable Winget-AutoUpdate update checking. By default, WAU auto update if new version is available on Github. + +.PARAMETER UseWhiteList +Use White List instead of Black List. This setting will not create the "exclude_apps.txt" but "include_apps.txt" + +.PARAMETER ListPath +Get Black/White List from Path (URL/UNC/GPO/Local) + +.PARAMETER ModsPath +Get mods from Path (URL/UNC/Local/AzureBlob) + +.PARAMETER AzureBlobURL +Set the Azure Storage Blob URL including the SAS token. The token requires at a minimum 'Read' and 'List' permissions. It is recommended to set this at the container level + +.PARAMETER Uninstall +Remove scheduled tasks and scripts. + +.PARAMETER NoClean +Keep critical files when installing/uninstalling + +.PARAMETER DesktopShortcut +Create a shortcut for user interaction on the Desktop to run task "Winget-AutoUpdate" + +.PARAMETER StartMenuShortcut +Create shortcuts for user interaction in the Start Menu to run task "Winget-AutoUpdate", open Logs and Web Help + +.PARAMETER NotificationLevel +Specify the Notification level: Full (Default, displays all notification), SuccessOnly (Only displays notification for success) or None (Does not show any popup). + +.PARAMETER UpdatesAtLogon +Set WAU to run at user logon. + +.PARAMETER UpdatesInterval +Specify the update frequency: Daily (Default), BiDaily, Weekly, BiWeekly, Monthly or Never + +.PARAMETER UpdatesAtTime +Specify the time of the update interval execution time. Default 6AM + +.PARAMETER RunOnMetered +Run WAU on metered connection. Default No. + +.PARAMETER InstallUserContext +Install WAU with system and user context executions + +.PARAMETER BypassListForUsers +Configure WAU to bypass the Black/White list when run in user context. Applications installed in system context will be ignored under user context. + +.EXAMPLE +.\Winget-AutoUpdate-Install.ps1 -Silent -DoNotUpdate -MaxLogFiles 4 -MaxLogSize 2097152 + +.EXAMPLE +.\Winget-AutoUpdate-Install.ps1 -Silent -UseWhiteList + +.EXAMPLE +.\Winget-AutoUpdate-Install.ps1 -Silent -ListPath https://www.domain.com/WAULists -StartMenuShortcut -UpdatesInterval BiDaily + +.EXAMPLE +.\Winget-AutoUpdate-Install.ps1 -Silent -ModsPath https://www.domain.com/WAUMods -DesktopShortcut -UpdatesInterval Weekly + +.EXAMPLE +.\Winget-AutoUpdate-Install.ps1 -Silent -UpdatesAtLogon -UpdatesInterval Weekly + +.EXAMPLE +.\Winget-AutoUpdate-Install.ps1 -Silent -Uninstall -NoClean + +#> + +[CmdletBinding()] +param( + [Parameter(Mandatory = $False)] [Alias('S')] [Switch] $Silent = $false, + [Parameter(Mandatory = $False)] [Alias('Path', 'WingetUpdatePath')] [String] $WAUinstallPath = "$env:ProgramData\Winget-AutoUpdate", + [Parameter(Mandatory = $False)] [Alias('List')] [String] $ListPath, + [Parameter(Mandatory = $False)] [Alias('Mods')] [String] $ModsPath, + [Parameter(Mandatory = $False)] [Alias('AzureBlobURL')] [String] $AzureBlobSASURL, + [Parameter(Mandatory = $False)] [Switch] $DoNotUpdate = $false, + [Parameter(Mandatory = $False)] [Switch] $DisableWAUAutoUpdate = $false, + [Parameter(Mandatory = $False)] [Switch] $RunOnMetered = $false, + [Parameter(Mandatory = $False)] [Switch] $Uninstall = $false, + [Parameter(Mandatory = $False)] [Switch] $NoClean = $false, + [Parameter(Mandatory = $False)] [Switch] $DesktopShortcut = $false, + [Parameter(Mandatory = $False)] [Switch] $StartMenuShortcut = $false, + [Parameter(Mandatory = $False)] [Switch] $UseWhiteList = $false, + [Parameter(Mandatory = $False)] [ValidateSet("Full", "SuccessOnly", "None")] [String] $NotificationLevel = "Full", + [Parameter(Mandatory = $False)] [Switch] $UpdatesAtLogon = $false, + [Parameter(Mandatory = $False)] [ValidateSet("Daily", "BiDaily", "Weekly", "BiWeekly", "Monthly", "Never")] [String] $UpdatesInterval = "Daily", + [Parameter(Mandatory = $False)] [DateTime] $UpdatesAtTime = ("06am"), + [Parameter(Mandatory = $False)] [Switch] $BypassListForUsers = $false, + [Parameter(Mandatory = $False)] [Switch] $InstallUserContext = $false, + [Parameter(Mandatory = $False)] [ValidateRange(0, 99)] [int32] $MaxLogFiles = 3, + [Parameter(Mandatory = $False)] [int64] $MaxLogSize = 1048576 # in bytes, default is 1048576 = 1 MB +) + + +<# FUNCTIONS #> + +#Include external Functions +. "$PSScriptRoot\Winget-AutoUpdate\functions\Install-Prerequisites.ps1" +. "$PSScriptRoot\Winget-AutoUpdate\functions\Invoke-DirProtect.ps1" +. "$PSScriptRoot\Winget-AutoUpdate\functions\Update-WinGet.ps1" +. "$PSScriptRoot\Winget-AutoUpdate\functions\Update-StoreApps.ps1" +. "$PSScriptRoot\Winget-AutoUpdate\functions\Add-Shortcut.ps1" +. "$PSScriptRoot\Winget-AutoUpdate\functions\Write-ToLog.ps1" + + +function Install-WingetAutoUpdate { + + Write-ToLog "Installing WAU..." "Yellow" + + try { + #Copy files to location + if (!(Test-Path "$WAUinstallPath\Winget-Upgrade.ps1")) { + Copy-Item -Path "$PSScriptRoot\Winget-AutoUpdate\*" -Destination $WAUinstallPath -Recurse -Force -ErrorAction SilentlyContinue + Write-ToLog "-> Running fresh installation..." + } + elseif ($NoClean) { + #Keep critical files + Get-ChildItem -Path $WAUinstallPath -Exclude *.txt, mods, logs, icons | Remove-Item -Recurse -Force + Copy-Item -Path "$PSScriptRoot\Winget-AutoUpdate\*" -Destination $WAUinstallPath -Exclude icons -Recurse -Force -ErrorAction SilentlyContinue #Exclude icons if personalized + Write-ToLog "-> Updating previous installation. Keeping critical existing files..." + } + else { + #Keep logs only + Get-ChildItem -Path $WAUinstallPath -Exclude logs | Remove-Item -Recurse -Force + Copy-Item -Path "$PSScriptRoot\Winget-AutoUpdate\*" -Destination $WAUinstallPath -Recurse -Force -ErrorAction SilentlyContinue + Write-ToLog "-> Updating previous installation..." + } + + #White List or Black List apps + if ($UseWhiteList) { + #If fresh install and "included_apps.txt" exists, copy the list to WAU + if ((!$NoClean) -and (Test-Path "$PSScriptRoot\included_apps.txt")) { + Copy-Item -Path "$PSScriptRoot\included_apps.txt" -Destination $WAUinstallPath -Recurse -Force -ErrorAction SilentlyContinue + Write-ToLog "-> Copied a brand new Whitelist." + } + #Else, only copy the "included_apps.txt" list if not existing in WAU + elseif (!(Test-Path "$WAUinstallPath\included_apps.txt")) { + Copy-Item -Path "$PSScriptRoot\included_apps.txt" -Destination $WAUinstallPath -Recurse -Force -ErrorAction SilentlyContinue + Write-ToLog "-> No Whitelist was existing. Copied from install sources." + } + } + else { + if (!$NoClean) { + Copy-Item -Path "$PSScriptRoot\excluded_apps.txt" -Destination $WAUinstallPath -Recurse -Force -ErrorAction SilentlyContinue + Write-ToLog "-> Copied brand new Blacklist." + } + elseif (!(Test-Path "$WAUinstallPath\excluded_apps.txt")) { + Copy-Item -Path "$PSScriptRoot\excluded_apps.txt" -Destination $WAUinstallPath -Recurse -Force -ErrorAction SilentlyContinue + Write-ToLog "-> No Blacklist was existing. Copied from install sources." + } + } + + # Set dummy regkeys for notification name and icon + & reg add "HKCR\AppUserModelId\Windows.SystemToast.Winget.Notification" /v DisplayName /t REG_EXPAND_SZ /d "Application Update" /f | Out-Null + & reg add "HKCR\AppUserModelId\Windows.SystemToast.Winget.Notification" /v IconUri /t REG_EXPAND_SZ /d %SystemRoot%\system32\@WindowsUpdateToastIcon.png /f | Out-Null + + # Clean potential old install + Get-ScheduledTask -TaskName "Winget-AutoUpdate" -ErrorAction SilentlyContinue | Unregister-ScheduledTask -Confirm:$False + Get-ScheduledTask -TaskName "Winget-AutoUpdate-Notify" -ErrorAction SilentlyContinue | Unregister-ScheduledTask -Confirm:$False + Get-ScheduledTask -TaskName "Winget-AutoUpdate-UserContext" -ErrorAction SilentlyContinue | Unregister-ScheduledTask -Confirm:$False + + # Settings for the scheduled task for Updates (System) + Write-ToLog "-> Installing WAU scheduled tasks" + $taskAction = New-ScheduledTaskAction -Execute "powershell.exe" -Argument "-NoProfile -ExecutionPolicy Bypass -File `"$($WAUinstallPath)\winget-upgrade.ps1`"" + $taskTriggers = @() + if ($UpdatesAtLogon) { + $tasktriggers += New-ScheduledTaskTrigger -AtLogOn + } + if ($UpdatesInterval -eq "Daily") { + $tasktriggers += New-ScheduledTaskTrigger -Daily -At $UpdatesAtTime + } + elseif ($UpdatesInterval -eq "BiDaily") { + $tasktriggers += New-ScheduledTaskTrigger -Daily -At $UpdatesAtTime -DaysInterval 2 + } + elseif ($UpdatesInterval -eq "Weekly") { + $tasktriggers += New-ScheduledTaskTrigger -Weekly -At $UpdatesAtTime -DaysOfWeek 2 + } + elseif ($UpdatesInterval -eq "BiWeekly") { + $tasktriggers += New-ScheduledTaskTrigger -Weekly -At $UpdatesAtTime -DaysOfWeek 2 -WeeksInterval 2 + } + elseif ($UpdatesInterval -eq "Monthly") { + $tasktriggers += New-ScheduledTaskTrigger -Weekly -At $UpdatesAtTime -DaysOfWeek 2 -WeeksInterval 4 + } + $taskUserPrincipal = New-ScheduledTaskPrincipal -UserId S-1-5-18 -RunLevel Highest + $taskSettings = New-ScheduledTaskSettingsSet -Compatibility Win8 -StartWhenAvailable -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -ExecutionTimeLimit 03:00:00 + # Set up the task, and register it + if ($taskTriggers) { + $task = New-ScheduledTask -Action $taskAction -Principal $taskUserPrincipal -Settings $taskSettings -Trigger $taskTriggers + } + else { + $task = New-ScheduledTask -Action $taskAction -Principal $taskUserPrincipal -Settings $taskSettings + } + Register-ScheduledTask -TaskName 'Winget-AutoUpdate' -TaskPath 'WAU' -InputObject $task -Force | Out-Null + + # Settings for the scheduled task in User context + $taskAction = New-ScheduledTaskAction -Execute "wscript.exe" -Argument "`"$($WAUinstallPath)\Invisible.vbs`" `"powershell.exe -NoProfile -ExecutionPolicy Bypass -File `"`"`"$($WAUinstallPath)\winget-upgrade.ps1`"`"" + $taskUserPrincipal = New-ScheduledTaskPrincipal -GroupId S-1-5-11 + $taskSettings = New-ScheduledTaskSettingsSet -Compatibility Win8 -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -ExecutionTimeLimit 03:00:00 + # Set up the task for user apps + $task = New-ScheduledTask -Action $taskAction -Principal $taskUserPrincipal -Settings $taskSettings + Register-ScheduledTask -TaskName 'Winget-AutoUpdate-UserContext' -TaskPath 'WAU' -InputObject $task -Force | Out-Null + + # Settings for the scheduled task for Notifications + $taskAction = New-ScheduledTaskAction -Execute "wscript.exe" -Argument "`"$($WAUinstallPath)\Invisible.vbs`" `"powershell.exe -NoProfile -ExecutionPolicy Bypass -File `"`"`"$($WAUinstallPath)\winget-notify.ps1`"`"" + $taskUserPrincipal = New-ScheduledTaskPrincipal -GroupId S-1-5-11 + $taskSettings = New-ScheduledTaskSettingsSet -Compatibility Win8 -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -ExecutionTimeLimit 00:05:00 + # Set up the task, and register it + $task = New-ScheduledTask -Action $taskAction -Principal $taskUserPrincipal -Settings $taskSettings + Register-ScheduledTask -TaskName 'Winget-AutoUpdate-Notify' -TaskPath 'WAU' -InputObject $task -Force | Out-Null + + # Settings for the GPO scheduled task + $taskAction = New-ScheduledTaskAction -Execute "powershell.exe" -Argument "-NoProfile -ExecutionPolicy Bypass -File `"$($WAUinstallPath)\WAU-Policies.ps1`"" + $tasktrigger = New-ScheduledTaskTrigger -Daily -At 6am + $taskUserPrincipal = New-ScheduledTaskPrincipal -UserId S-1-5-18 -RunLevel Highest + $taskSettings = New-ScheduledTaskSettingsSet -Compatibility Win8 -StartWhenAvailable -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -ExecutionTimeLimit 00:05:00 + # Set up the task, and register it + $task = New-ScheduledTask -Action $taskAction -Principal $taskUserPrincipal -Settings $taskSettings -Trigger $taskTrigger + Register-ScheduledTask -TaskName 'Winget-AutoUpdate-Policies' -TaskPath 'WAU' -InputObject $task -Force | Out-Null + + #Set task readable/runnable for all users + $scheduler = New-Object -ComObject "Schedule.Service" + $scheduler.Connect() + $task = $scheduler.GetFolder("WAU").GetTask("Winget-AutoUpdate") + $sec = $task.GetSecurityDescriptor(0xF) + $sec = $sec + '(A;;GRGX;;;AU)' + $task.SetSecurityDescriptor($sec, 0) + + # Configure Reg Key + Write-ToLog "-> Setting Registry config" + New-Item $regPath -Force | Out-Null + New-ItemProperty $regPath -Name DisplayName -Value "Winget-AutoUpdate (WAU)" -Force | Out-Null + New-ItemProperty $regPath -Name DisplayIcon -Value "C:\Windows\System32\shell32.dll,-16739" -Force | Out-Null + New-ItemProperty $regPath -Name DisplayVersion -Value $WAUVersion -Force | Out-Null + New-ItemProperty $regPath -Name InstallLocation -Value $WAUinstallPath -Force | Out-Null + New-ItemProperty $regPath -Name UninstallString -Value "powershell.exe -noprofile -executionpolicy bypass -file `"$WAUinstallPath\WAU-Uninstall.ps1`"" -Force | Out-Null + New-ItemProperty $regPath -Name QuietUninstallString -Value "powershell.exe -noprofile -executionpolicy bypass -file `"$WAUinstallPath\WAU-Uninstall.ps1`"" -Force | Out-Null + New-ItemProperty $regPath -Name NoModify -Value 1 -Force | Out-Null + New-ItemProperty $regPath -Name NoRepair -Value 1 -Force | Out-Null + New-ItemProperty $regPath -Name Publisher -Value "Romanitho" -Force | Out-Null + New-ItemProperty $regPath -Name URLInfoAbout -Value "https://github.com/Romanitho/Winget-AutoUpdate" -Force | Out-Null + New-ItemProperty $regPath -Name WAU_NotificationLevel -Value $NotificationLevel -Force | Out-Null + if ($WAUVersion -match "-") { + New-ItemProperty $regPath -Name WAU_UpdatePrerelease -Value 1 -PropertyType DWord -Force | Out-Null + } + else { + New-ItemProperty $regPath -Name WAU_UpdatePrerelease -Value 0 -PropertyType DWord -Force | Out-Null + } + New-ItemProperty $regPath -Name WAU_PostUpdateActions -Value 0 -PropertyType DWord -Force | Out-Null + New-ItemProperty $regPath -Name WAU_MaxLogFiles -Value $MaxLogFiles -PropertyType DWord -Force | Out-Null + New-ItemProperty $regPath -Name WAU_MaxLogSize -Value $MaxLogSize -PropertyType DWord -Force | Out-Null + New-ItemProperty $regPath -Name WAU_UpdatesAtTime -Value $UpdatesAtTime -Force | Out-Null + New-ItemProperty $regPath -Name WAU_UpdatesInterval -Value $UpdatesInterval -Force | Out-Null + if ($UpdatesAtLogon) { + New-ItemProperty $regPath -Name WAU_UpdatesAtLogon -Value 1 -PropertyType DWord -Force | Out-Null + } + if ($DisableWAUAutoUpdate) { + New-ItemProperty $regPath -Name WAU_DisableAutoUpdate -Value 1 -Force | Out-Null + } + if ($UseWhiteList) { + New-ItemProperty $regPath -Name WAU_UseWhiteList -Value 1 -PropertyType DWord -Force | Out-Null + } + if (!$RunOnMetered) { + New-ItemProperty $regPath -Name WAU_DoNotRunOnMetered -Value 1 -PropertyType DWord -Force | Out-Null + } + if ($ListPath) { + New-ItemProperty $regPath -Name WAU_ListPath -Value $ListPath -Force | Out-Null + } + if ($ModsPath) { + New-ItemProperty $regPath -Name WAU_ModsPath -Value $ModsPath -Force | Out-Null + } + if ($AzureBlobSASURL) { + New-ItemProperty $regPath -Name WAU_AzureBlobSASURL -Value $AzureBlobSASURL -Force | Out-Null + } + if ($BypassListForUsers) { + New-ItemProperty $regPath -Name WAU_BypassListForUsers -Value 1 -PropertyType DWord -Force | Out-Null + } + if ($InstallUserContext) { + New-ItemProperty $regPath -Name WAU_UserContext -Value 1 -PropertyType DWord -Force | Out-Null + } + if ($DesktopShortcut) { + New-ItemProperty $regPath -Name WAU_DesktopShortcut -Value 1 -PropertyType DWord -Force | Out-Null + } + if ($StartMenuShortcut) { + New-ItemProperty $regPath -Name WAU_StartMenuShortcut -Value 1 -PropertyType DWord -Force | Out-Null + } + + #Security check + Write-ToLog "-> Checking Mods Directory:" + $Protected = Invoke-DirProtect "$WAUinstallPath\mods" + if ($Protected -eq $True) { + Write-ToLog " The mods directory is secured!" "Cyan" + } + else { + Write-ToLog " Error: The mods directory couldn't be verified as secured!" "Red" + } + Write-ToLog "-> Checking Functions Directory:" + $Protected = Invoke-DirProtect "$WAUinstallPath\Functions" + if ($Protected -eq $True) { + Write-ToLog " The Functions directory is secured!" "Cyan" + } + else { + Write-ToLog " Error: The Functions directory couldn't be verified as secured!" "Red" + } + + #Create Shortcuts + if ($StartMenuShortcut) { + if (!(Test-Path "${env:ProgramData}\Microsoft\Windows\Start Menu\Programs\Winget-AutoUpdate (WAU)")) { + New-Item -ItemType Directory -Force -Path "${env:ProgramData}\Microsoft\Windows\Start Menu\Programs\Winget-AutoUpdate (WAU)" | Out-Null + } + Add-Shortcut "wscript.exe" "${env:ProgramData}\Microsoft\Windows\Start Menu\Programs\Winget-AutoUpdate (WAU)\WAU - Check for updated Apps.lnk" "`"$($WAUinstallPath)\Invisible.vbs`" `"powershell.exe -NoProfile -ExecutionPolicy Bypass -File `"`"`"$($WAUinstallPath)\user-run.ps1`"`"" "${env:SystemRoot}\System32\shell32.dll,-16739" "Manual start of Winget-AutoUpdate (WAU)..." + Add-Shortcut "wscript.exe" "${env:ProgramData}\Microsoft\Windows\Start Menu\Programs\Winget-AutoUpdate (WAU)\WAU - Open logs.lnk" "`"$($WAUinstallPath)\Invisible.vbs`" `"powershell.exe -NoProfile -ExecutionPolicy Bypass -File `"`"`"$($WAUinstallPath)\user-run.ps1`" -Logs`"" "${env:SystemRoot}\System32\shell32.dll,-16763" "Open existing WAU logs..." + Add-Shortcut "wscript.exe" "${env:ProgramData}\Microsoft\Windows\Start Menu\Programs\Winget-AutoUpdate (WAU)\WAU - Web Help.lnk" "`"$($WAUinstallPath)\Invisible.vbs`" `"powershell.exe -NoProfile -ExecutionPolicy Bypass -File `"`"`"$($WAUinstallPath)\user-run.ps1`" -Help`"" "${env:SystemRoot}\System32\shell32.dll,-24" "Help for WAU..." + } + + if ($DesktopShortcut) { + Add-Shortcut "wscript.exe" "${env:Public}\Desktop\WAU - Check for updated Apps.lnk" "`"$($WAUinstallPath)\Invisible.vbs`" `"powershell.exe -NoProfile -ExecutionPolicy Bypass -File `"`"`"$($WAUinstallPath)\user-run.ps1`"`"" "${env:SystemRoot}\System32\shell32.dll,-16739" "Manual start of Winget-AutoUpdate (WAU)..." + } + + #Add 1 to counter file + try { + Invoke-RestMethod -Uri "https://github.com/Romanitho/Winget-AutoUpdate/releases/download/v$($WAUVersion)/WAU_InstallCounter" | Out-Null + } + catch { + Write-ToLog "-> Not able to report installation." "Yellow" + } + + Write-ToLog "-> WAU Installation succeeded!`n" "Green" + Start-sleep 1 + + #Run Winget ? + Start-WingetAutoUpdate + } + catch { + Write-ToLog "-> WAU Installation failed! Error $_ - Try running me with admin rights.`n" "Red" + Start-sleep 1 + return $False + } +} + +function Uninstall-WingetAutoUpdate { + + Write-ToLog "Uninstalling WAU started!" "Yellow" + + #Get registry install location + $InstallLocation = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate\" -Name InstallLocation -ErrorAction SilentlyContinue + + #Check if installed location exists and delete + if ($InstallLocation) { + + try { + if (!$NoClean) { + Write-ToLog "-> Removing files and config." + Get-ChildItem -Path $InstallLocation -Exclude logs | Remove-Item -Force -Recurse + if (Test-Path "${env:ProgramData}\Microsoft\IntuneManagementExtension\Logs\WAU-updates.log") { + Remove-Item -Path "${env:ProgramData}\Microsoft\IntuneManagementExtension\Logs\WAU-updates.log" -Force -ErrorAction SilentlyContinue | Out-Null + } + if (Test-Path "${env:ProgramData}\Microsoft\IntuneManagementExtension\Logs\WAU-install.log") { + Remove-Item -Path "${env:ProgramData}\Microsoft\IntuneManagementExtension\Logs\WAU-install.log" -Force -ErrorAction SilentlyContinue | Out-Null + } + } + else { + #Keep critical files + Write-ToLog "-> Removing files. Keeping config." + Get-ChildItem -Path $InstallLocation -Exclude *.txt, mods, logs | Remove-Item -Recurse -Force + } + & reg delete "HKCR\AppUserModelId\Windows.SystemToast.Winget.Notification" /f | Out-Null + & reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate" /f | Out-Null + + if ((Test-Path "${env:ProgramData}\Microsoft\Windows\Start Menu\Programs\Winget-AutoUpdate (WAU)")) { + Remove-Item -Path "${env:ProgramData}\Microsoft\Windows\Start Menu\Programs\Winget-AutoUpdate (WAU)" -Recurse -Force | Out-Null + } + + if ((Test-Path "${env:Public}\Desktop\WAU - Check for updated Apps.lnk")) { + Remove-Item -Path "${env:Public}\Desktop\WAU - Check for updated Apps.lnk" -Force | Out-Null + } + + Write-ToLog "-> Removing scheduled tasks." + Get-ScheduledTask -TaskName "Winget-AutoUpdate" -ErrorAction SilentlyContinue | Unregister-ScheduledTask -Confirm:$False + Get-ScheduledTask -TaskName "Winget-AutoUpdate-Notify" -ErrorAction SilentlyContinue | Unregister-ScheduledTask -Confirm:$False + Get-ScheduledTask -TaskName "Winget-AutoUpdate-UserContext" -ErrorAction SilentlyContinue | Unregister-ScheduledTask -Confirm:$False + Get-ScheduledTask -TaskName "Winget-AutoUpdate-Policies" -ErrorAction SilentlyContinue | Unregister-ScheduledTask -Confirm:$False + + Write-ToLog "Uninstallation succeeded!`n" "Green" + Start-sleep 1 + } + catch { + Write-ToLog "Uninstallation failed! Run as admin ?`n" "Red" + Start-sleep 1 + } + } + else { + Write-ToLog "WAU is not installed!`n" "Red" + Start-sleep 1 + } +} + +function Start-WingetAutoUpdate { + #If -DoNotUpdate is true, skip. + if (!($DoNotUpdate)) { + #If -Silent, run Winget-AutoUpdate now + if ($Silent) { + $RunWinget = $True + } + #Ask for WingetAutoUpdate + else { + $MsgBoxTitle = "Winget-AutoUpdate" + $MsgBoxContent = "Would you like to run Winget-AutoUpdate now?" + $MsgBoxTimeOut = 60 + $MsgBoxReturn = (New-Object -ComObject "Wscript.Shell").Popup($MsgBoxContent, $MsgBoxTimeOut, $MsgBoxTitle, 4 + 32) + if ($MsgBoxReturn -ne 7) { + $RunWinget = $True + } + } + if ($RunWinget) { + try { + Write-ToLog "Running Winget-AutoUpdate..." "Yellow" + Get-ScheduledTask -TaskName "Winget-AutoUpdate" -ErrorAction SilentlyContinue | Start-ScheduledTask -ErrorAction SilentlyContinue + while ((Get-ScheduledTask -TaskName "Winget-AutoUpdate").State -ne 'Ready') { + Start-Sleep 1 + } + } + catch { + Write-ToLog "Failed to run Winget-AutoUpdate..." "Red" + } + } + } + else { + Write-ToLog "Skip running Winget-AutoUpdate" + } +} + + +<# APP INFO #> + +$WAUVersion = Get-Content "$PSScriptRoot\Winget-AutoUpdate\Version.txt" -ErrorAction SilentlyContinue + + +<# MAIN #> + +#If running as a 32-bit process on an x64 system, re-launch as a 64-bit process +if ("$env:PROCESSOR_ARCHITEW6432" -ne "ARM64") { + if (Test-Path "$($env:WINDIR)\SysNative\WindowsPowerShell\v1.0\powershell.exe") { + Start-Process "$($env:WINDIR)\SysNative\WindowsPowerShell\v1.0\powershell.exe" -Wait -NoNewWindow -ArgumentList "-NoProfile -ExecutionPolicy Bypass -Command $($MyInvocation.line)" + Exit $lastexitcode + } +} + +#Config console output encoding +$null = cmd /c '' #Tip for ISE +[Console]::OutputEncoding = [System.Text.Encoding]::UTF8 + +# Workaround for ARM64 (Access Denied / Win32 internal Server error) +$Script:ProgressPreference = 'SilentlyContinue' + +#Set install log file +$Script:LogFile = "$WAUinstallPath\logs\WAU-Installer.log" + +Write-Host "`n " +Write-Host "`t 888 888 d8888 888 888" -ForegroundColor Magenta +Write-Host "`t 888 o 888 d88888 888 888" -ForegroundColor Magenta +Write-Host "`t 888 d8b 888 d88P888 888 888" -ForegroundColor Magenta +Write-Host "`t 888 d888b 888 d88P 888 888 888" -ForegroundColor Magenta +Write-Host "`t 888d88888b888 d88P 888 888 888" -ForegroundColor Magenta +Write-Host "`t 88888P Y88888 d88P 888 888 888" -ForegroundColor Cyan +Write-Host "`t 8888P Y8888 d88P 888 888 888" -ForegroundColor Magenta +Write-Host "`t 888P Y888 d88P 888 Y8888888P`n" -ForegroundColor Magenta +Write-Host "`t Winget-AutoUpdate $WAUVersion`n" -ForegroundColor Cyan +Write-Host "`t https://github.com/Romanitho/Winget-AutoUpdate`n" -ForegroundColor Magenta +Write-Host "`t________________________________________________________`n" + +#Define WAU registry key +$Script:regPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate" + +if (!$Uninstall) { + Write-ToLog " INSTALLING WAU" -LogColor "Cyan" -IsHeader + Install-Prerequisites + $UpdateWinget = Update-Winget + if ($UpdateWinget -ne "fail") { + Install-WingetAutoUpdate + } + else { + Write-ToLog "Winget is mandatory to execute WAU." "Red" + } +} +else { + Write-ToLog " UNINSTALLING WAU" -LogColor "Cyan" -IsHeader + Uninstall-WingetAutoUpdate +} + +if (Test-Path "$WAUinstallPath\Version.txt") { + Remove-Item "$WAUinstallPath\Version.txt" -Force +} + +Write-ToLog "End of process." "Cyan" +Start-Sleep 3 diff --git a/Winget-AutoUpdate/Invisible.vbs b/Sources/WAU/Winget-AutoUpdate/Invisible.vbs similarity index 100% rename from Winget-AutoUpdate/Invisible.vbs rename to Sources/WAU/Winget-AutoUpdate/Invisible.vbs diff --git a/Winget-AutoUpdate/User-Run.ps1 b/Sources/WAU/Winget-AutoUpdate/User-Run.ps1 similarity index 100% rename from Winget-AutoUpdate/User-Run.ps1 rename to Sources/WAU/Winget-AutoUpdate/User-Run.ps1 diff --git a/Winget-AutoUpdate/Version.txt b/Sources/WAU/Winget-AutoUpdate/Version.txt similarity index 100% rename from Winget-AutoUpdate/Version.txt rename to Sources/WAU/Winget-AutoUpdate/Version.txt diff --git a/Winget-AutoUpdate/WAU-Policies.ps1 b/Sources/WAU/Winget-AutoUpdate/WAU-Policies.ps1 similarity index 100% rename from Winget-AutoUpdate/WAU-Policies.ps1 rename to Sources/WAU/Winget-AutoUpdate/WAU-Policies.ps1 diff --git a/Winget-AutoUpdate/WAU-Uninstall.ps1 b/Sources/WAU/Winget-AutoUpdate/WAU-Uninstall.ps1 similarity index 100% rename from Winget-AutoUpdate/WAU-Uninstall.ps1 rename to Sources/WAU/Winget-AutoUpdate/WAU-Uninstall.ps1 diff --git a/Winget-AutoUpdate/Winget-Install.ps1 b/Sources/WAU/Winget-AutoUpdate/Winget-Install.ps1 similarity index 100% rename from Winget-AutoUpdate/Winget-Install.ps1 rename to Sources/WAU/Winget-AutoUpdate/Winget-Install.ps1 diff --git a/Winget-AutoUpdate/Winget-Notify.ps1 b/Sources/WAU/Winget-AutoUpdate/Winget-Notify.ps1 similarity index 100% rename from Winget-AutoUpdate/Winget-Notify.ps1 rename to Sources/WAU/Winget-AutoUpdate/Winget-Notify.ps1 diff --git a/Winget-AutoUpdate/Winget-Upgrade.ps1 b/Sources/WAU/Winget-AutoUpdate/Winget-Upgrade.ps1 similarity index 100% rename from Winget-AutoUpdate/Winget-Upgrade.ps1 rename to Sources/WAU/Winget-AutoUpdate/Winget-Upgrade.ps1 diff --git a/Winget-AutoUpdate/functions/Add-ScopeMachine.ps1 b/Sources/WAU/Winget-AutoUpdate/functions/Add-ScopeMachine.ps1 similarity index 100% rename from Winget-AutoUpdate/functions/Add-ScopeMachine.ps1 rename to Sources/WAU/Winget-AutoUpdate/functions/Add-ScopeMachine.ps1 diff --git a/Winget-AutoUpdate/functions/Add-Shortcut.ps1 b/Sources/WAU/Winget-AutoUpdate/functions/Add-Shortcut.ps1 similarity index 100% rename from Winget-AutoUpdate/functions/Add-Shortcut.ps1 rename to Sources/WAU/Winget-AutoUpdate/functions/Add-Shortcut.ps1 diff --git a/Winget-AutoUpdate/functions/Confirm-Installation.ps1 b/Sources/WAU/Winget-AutoUpdate/functions/Confirm-Installation.ps1 similarity index 100% rename from Winget-AutoUpdate/functions/Confirm-Installation.ps1 rename to Sources/WAU/Winget-AutoUpdate/functions/Confirm-Installation.ps1 diff --git a/Winget-AutoUpdate/functions/Get-AZCopy.ps1 b/Sources/WAU/Winget-AutoUpdate/functions/Get-AZCopy.ps1 similarity index 100% rename from Winget-AutoUpdate/functions/Get-AZCopy.ps1 rename to Sources/WAU/Winget-AutoUpdate/functions/Get-AZCopy.ps1 diff --git a/Winget-AutoUpdate/functions/Get-AppInfo.ps1 b/Sources/WAU/Winget-AutoUpdate/functions/Get-AppInfo.ps1 similarity index 100% rename from Winget-AutoUpdate/functions/Get-AppInfo.ps1 rename to Sources/WAU/Winget-AutoUpdate/functions/Get-AppInfo.ps1 diff --git a/Winget-AutoUpdate/functions/Get-ExcludedApps.ps1 b/Sources/WAU/Winget-AutoUpdate/functions/Get-ExcludedApps.ps1 similarity index 100% rename from Winget-AutoUpdate/functions/Get-ExcludedApps.ps1 rename to Sources/WAU/Winget-AutoUpdate/functions/Get-ExcludedApps.ps1 diff --git a/Winget-AutoUpdate/functions/Get-IncludedApps.ps1 b/Sources/WAU/Winget-AutoUpdate/functions/Get-IncludedApps.ps1 similarity index 100% rename from Winget-AutoUpdate/functions/Get-IncludedApps.ps1 rename to Sources/WAU/Winget-AutoUpdate/functions/Get-IncludedApps.ps1 diff --git a/Winget-AutoUpdate/functions/Get-NotifLocale.ps1 b/Sources/WAU/Winget-AutoUpdate/functions/Get-NotifLocale.ps1 similarity index 100% rename from Winget-AutoUpdate/functions/Get-NotifLocale.ps1 rename to Sources/WAU/Winget-AutoUpdate/functions/Get-NotifLocale.ps1 diff --git a/Winget-AutoUpdate/functions/Get-WAUAvailableVersion.ps1 b/Sources/WAU/Winget-AutoUpdate/functions/Get-WAUAvailableVersion.ps1 similarity index 100% rename from Winget-AutoUpdate/functions/Get-WAUAvailableVersion.ps1 rename to Sources/WAU/Winget-AutoUpdate/functions/Get-WAUAvailableVersion.ps1 diff --git a/Winget-AutoUpdate/functions/Get-WAUConfig.ps1 b/Sources/WAU/Winget-AutoUpdate/functions/Get-WAUConfig.ps1 similarity index 100% rename from Winget-AutoUpdate/functions/Get-WAUConfig.ps1 rename to Sources/WAU/Winget-AutoUpdate/functions/Get-WAUConfig.ps1 diff --git a/Winget-AutoUpdate/functions/Get-WingetCmd.ps1 b/Sources/WAU/Winget-AutoUpdate/functions/Get-WingetCmd.ps1 similarity index 100% rename from Winget-AutoUpdate/functions/Get-WingetCmd.ps1 rename to Sources/WAU/Winget-AutoUpdate/functions/Get-WingetCmd.ps1 diff --git a/Winget-AutoUpdate/functions/Get-WingetOutdatedApps.ps1 b/Sources/WAU/Winget-AutoUpdate/functions/Get-WingetOutdatedApps.ps1 similarity index 100% rename from Winget-AutoUpdate/functions/Get-WingetOutdatedApps.ps1 rename to Sources/WAU/Winget-AutoUpdate/functions/Get-WingetOutdatedApps.ps1 diff --git a/Winget-AutoUpdate/functions/Get-WingetSystemApps.ps1 b/Sources/WAU/Winget-AutoUpdate/functions/Get-WingetSystemApps.ps1 similarity index 100% rename from Winget-AutoUpdate/functions/Get-WingetSystemApps.ps1 rename to Sources/WAU/Winget-AutoUpdate/functions/Get-WingetSystemApps.ps1 diff --git a/Winget-AutoUpdate/functions/Install-Prerequisites.ps1 b/Sources/WAU/Winget-AutoUpdate/functions/Install-Prerequisites.ps1 similarity index 100% rename from Winget-AutoUpdate/functions/Install-Prerequisites.ps1 rename to Sources/WAU/Winget-AutoUpdate/functions/Install-Prerequisites.ps1 diff --git a/Winget-AutoUpdate/functions/Invoke-DirProtect.ps1 b/Sources/WAU/Winget-AutoUpdate/functions/Invoke-DirProtect.ps1 similarity index 100% rename from Winget-AutoUpdate/functions/Invoke-DirProtect.ps1 rename to Sources/WAU/Winget-AutoUpdate/functions/Invoke-DirProtect.ps1 diff --git a/Winget-AutoUpdate/functions/Invoke-LogRotation.ps1 b/Sources/WAU/Winget-AutoUpdate/functions/Invoke-LogRotation.ps1 similarity index 100% rename from Winget-AutoUpdate/functions/Invoke-LogRotation.ps1 rename to Sources/WAU/Winget-AutoUpdate/functions/Invoke-LogRotation.ps1 diff --git a/Winget-AutoUpdate/functions/Invoke-PostUpdateActions.ps1 b/Sources/WAU/Winget-AutoUpdate/functions/Invoke-PostUpdateActions.ps1 similarity index 100% rename from Winget-AutoUpdate/functions/Invoke-PostUpdateActions.ps1 rename to Sources/WAU/Winget-AutoUpdate/functions/Invoke-PostUpdateActions.ps1 diff --git a/Winget-AutoUpdate/functions/Start-NotifTask.ps1 b/Sources/WAU/Winget-AutoUpdate/functions/Start-NotifTask.ps1 similarity index 100% rename from Winget-AutoUpdate/functions/Start-NotifTask.ps1 rename to Sources/WAU/Winget-AutoUpdate/functions/Start-NotifTask.ps1 diff --git a/Winget-AutoUpdate/functions/Test-ListPath.ps1 b/Sources/WAU/Winget-AutoUpdate/functions/Test-ListPath.ps1 similarity index 100% rename from Winget-AutoUpdate/functions/Test-ListPath.ps1 rename to Sources/WAU/Winget-AutoUpdate/functions/Test-ListPath.ps1 diff --git a/Winget-AutoUpdate/functions/Test-Mods.ps1 b/Sources/WAU/Winget-AutoUpdate/functions/Test-Mods.ps1 similarity index 100% rename from Winget-AutoUpdate/functions/Test-Mods.ps1 rename to Sources/WAU/Winget-AutoUpdate/functions/Test-Mods.ps1 diff --git a/Winget-AutoUpdate/functions/Test-ModsPath.ps1 b/Sources/WAU/Winget-AutoUpdate/functions/Test-ModsPath.ps1 similarity index 100% rename from Winget-AutoUpdate/functions/Test-ModsPath.ps1 rename to Sources/WAU/Winget-AutoUpdate/functions/Test-ModsPath.ps1 diff --git a/Winget-AutoUpdate/functions/Test-Network.ps1 b/Sources/WAU/Winget-AutoUpdate/functions/Test-Network.ps1 similarity index 100% rename from Winget-AutoUpdate/functions/Test-Network.ps1 rename to Sources/WAU/Winget-AutoUpdate/functions/Test-Network.ps1 diff --git a/Winget-AutoUpdate/functions/Test-PendingReboot.ps1 b/Sources/WAU/Winget-AutoUpdate/functions/Test-PendingReboot.ps1 similarity index 100% rename from Winget-AutoUpdate/functions/Test-PendingReboot.ps1 rename to Sources/WAU/Winget-AutoUpdate/functions/Test-PendingReboot.ps1 diff --git a/Winget-AutoUpdate/functions/Update-App.ps1 b/Sources/WAU/Winget-AutoUpdate/functions/Update-App.ps1 similarity index 100% rename from Winget-AutoUpdate/functions/Update-App.ps1 rename to Sources/WAU/Winget-AutoUpdate/functions/Update-App.ps1 diff --git a/Winget-AutoUpdate/functions/Update-StoreApps.ps1 b/Sources/WAU/Winget-AutoUpdate/functions/Update-StoreApps.ps1 similarity index 100% rename from Winget-AutoUpdate/functions/Update-StoreApps.ps1 rename to Sources/WAU/Winget-AutoUpdate/functions/Update-StoreApps.ps1 diff --git a/Winget-AutoUpdate/functions/Update-WAU.ps1 b/Sources/WAU/Winget-AutoUpdate/functions/Update-WAU.ps1 similarity index 100% rename from Winget-AutoUpdate/functions/Update-WAU.ps1 rename to Sources/WAU/Winget-AutoUpdate/functions/Update-WAU.ps1 diff --git a/Winget-AutoUpdate/functions/Update-WinGet.ps1 b/Sources/WAU/Winget-AutoUpdate/functions/Update-WinGet.ps1 similarity index 100% rename from Winget-AutoUpdate/functions/Update-WinGet.ps1 rename to Sources/WAU/Winget-AutoUpdate/functions/Update-WinGet.ps1 diff --git a/Winget-AutoUpdate/functions/Write-ToLog.ps1 b/Sources/WAU/Winget-AutoUpdate/functions/Write-ToLog.ps1 similarity index 100% rename from Winget-AutoUpdate/functions/Write-ToLog.ps1 rename to Sources/WAU/Winget-AutoUpdate/functions/Write-ToLog.ps1 diff --git a/Winget-AutoUpdate/icons/error.png b/Sources/WAU/Winget-AutoUpdate/icons/error.png similarity index 100% rename from Winget-AutoUpdate/icons/error.png rename to Sources/WAU/Winget-AutoUpdate/icons/error.png diff --git a/Winget-AutoUpdate/icons/info.png b/Sources/WAU/Winget-AutoUpdate/icons/info.png similarity index 100% rename from Winget-AutoUpdate/icons/info.png rename to Sources/WAU/Winget-AutoUpdate/icons/info.png diff --git a/Winget-AutoUpdate/icons/success.png b/Sources/WAU/Winget-AutoUpdate/icons/success.png similarity index 100% rename from Winget-AutoUpdate/icons/success.png rename to Sources/WAU/Winget-AutoUpdate/icons/success.png diff --git a/Winget-AutoUpdate/icons/warning.png b/Sources/WAU/Winget-AutoUpdate/icons/warning.png similarity index 100% rename from Winget-AutoUpdate/icons/warning.png rename to Sources/WAU/Winget-AutoUpdate/icons/warning.png diff --git a/Winget-AutoUpdate/locale/cz.xml b/Sources/WAU/Winget-AutoUpdate/locale/cz.xml similarity index 96% rename from Winget-AutoUpdate/locale/cz.xml rename to Sources/WAU/Winget-AutoUpdate/locale/cz.xml index 04b062d..184e1a9 100644 --- a/Winget-AutoUpdate/locale/cz.xml +++ b/Sources/WAU/Winget-AutoUpdate/locale/cz.xml @@ -1,62 +1,62 @@ - - - - - Zkontrolujte připojení k internetu. - - Není možné nyní zkontrolovat aktualizace aplikací! - - - - Připojení k internetu není dostupné. - - Není možné zkontrolovat aktualizace. - - - - Aplikace {0} bude aktualizována! - - {0} na {1} - - - - Aplikace {0} byla úspěšně aktualizována. - - Nainstalovaná verze: {0} - - - - Aplikace {0} nemůže být aktualizována! - - Kontaktujte prosím podporu. - - - - Logy ještě nejsou dostupné! - - - - Spouštění manuální kontroly aktualizací... - - - - Nelze spustit manuální kontrolu aktualizací! - - - - Kontrola aktualizací už probíhá... - - - - Manuální kontrola aktualizací je dokončena. - - - - Podívat se na změny ve WAU - - - - Otevřít soubor s logy - - + + + + + Zkontrolujte připojení k internetu. + + Není možné nyní zkontrolovat aktualizace aplikací! + + + + Připojení k internetu není dostupné. + + Není možné zkontrolovat aktualizace. + + + + Aplikace {0} bude aktualizována! + + {0} na {1} + + + + Aplikace {0} byla úspěšně aktualizována. + + Nainstalovaná verze: {0} + + + + Aplikace {0} nemůže být aktualizována! + + Kontaktujte prosím podporu. + + + + Logy ještě nejsou dostupné! + + + + Spouštění manuální kontroly aktualizací... + + + + Nelze spustit manuální kontrolu aktualizací! + + + + Kontrola aktualizací už probíhá... + + + + Manuální kontrola aktualizací je dokončena. + + + + Podívat se na změny ve WAU + + + + Otevřít soubor s logy + + \ No newline at end of file diff --git a/Winget-AutoUpdate/locale/de.xml b/Sources/WAU/Winget-AutoUpdate/locale/de.xml similarity index 100% rename from Winget-AutoUpdate/locale/de.xml rename to Sources/WAU/Winget-AutoUpdate/locale/de.xml diff --git a/Winget-AutoUpdate/locale/en.xml b/Sources/WAU/Winget-AutoUpdate/locale/en.xml similarity index 100% rename from Winget-AutoUpdate/locale/en.xml rename to Sources/WAU/Winget-AutoUpdate/locale/en.xml diff --git a/Winget-AutoUpdate/locale/es.xml b/Sources/WAU/Winget-AutoUpdate/locale/es.xml similarity index 100% rename from Winget-AutoUpdate/locale/es.xml rename to Sources/WAU/Winget-AutoUpdate/locale/es.xml diff --git a/Winget-AutoUpdate/locale/fi.xml b/Sources/WAU/Winget-AutoUpdate/locale/fi.xml similarity index 100% rename from Winget-AutoUpdate/locale/fi.xml rename to Sources/WAU/Winget-AutoUpdate/locale/fi.xml diff --git a/Winget-AutoUpdate/locale/fr.xml b/Sources/WAU/Winget-AutoUpdate/locale/fr.xml similarity index 100% rename from Winget-AutoUpdate/locale/fr.xml rename to Sources/WAU/Winget-AutoUpdate/locale/fr.xml diff --git a/Winget-AutoUpdate/locale/hu.xml b/Sources/WAU/Winget-AutoUpdate/locale/hu.xml similarity index 100% rename from Winget-AutoUpdate/locale/hu.xml rename to Sources/WAU/Winget-AutoUpdate/locale/hu.xml diff --git a/Winget-AutoUpdate/locale/it.xml b/Sources/WAU/Winget-AutoUpdate/locale/it.xml similarity index 100% rename from Winget-AutoUpdate/locale/it.xml rename to Sources/WAU/Winget-AutoUpdate/locale/it.xml diff --git a/Winget-AutoUpdate/locale/nb.xml b/Sources/WAU/Winget-AutoUpdate/locale/nb.xml similarity index 100% rename from Winget-AutoUpdate/locale/nb.xml rename to Sources/WAU/Winget-AutoUpdate/locale/nb.xml diff --git a/Winget-AutoUpdate/locale/nl.xml b/Sources/WAU/Winget-AutoUpdate/locale/nl.xml similarity index 100% rename from Winget-AutoUpdate/locale/nl.xml rename to Sources/WAU/Winget-AutoUpdate/locale/nl.xml diff --git a/Winget-AutoUpdate/locale/pl.xml b/Sources/WAU/Winget-AutoUpdate/locale/pl.xml similarity index 100% rename from Winget-AutoUpdate/locale/pl.xml rename to Sources/WAU/Winget-AutoUpdate/locale/pl.xml diff --git a/Winget-AutoUpdate/locale/pt.xml b/Sources/WAU/Winget-AutoUpdate/locale/pt.xml similarity index 100% rename from Winget-AutoUpdate/locale/pt.xml rename to Sources/WAU/Winget-AutoUpdate/locale/pt.xml diff --git a/Winget-AutoUpdate/locale/ru.xml b/Sources/WAU/Winget-AutoUpdate/locale/ru.xml similarity index 100% rename from Winget-AutoUpdate/locale/ru.xml rename to Sources/WAU/Winget-AutoUpdate/locale/ru.xml diff --git a/Winget-AutoUpdate/locale/sv.xml b/Sources/WAU/Winget-AutoUpdate/locale/sv.xml similarity index 100% rename from Winget-AutoUpdate/locale/sv.xml rename to Sources/WAU/Winget-AutoUpdate/locale/sv.xml diff --git a/Winget-AutoUpdate/locale/uk.xml b/Sources/WAU/Winget-AutoUpdate/locale/uk.xml similarity index 100% rename from Winget-AutoUpdate/locale/uk.xml rename to Sources/WAU/Winget-AutoUpdate/locale/uk.xml diff --git a/Winget-AutoUpdate/locale/zh-CHS.xml b/Sources/WAU/Winget-AutoUpdate/locale/zh-CHS.xml similarity index 100% rename from Winget-AutoUpdate/locale/zh-CHS.xml rename to Sources/WAU/Winget-AutoUpdate/locale/zh-CHS.xml diff --git a/Winget-AutoUpdate/locale/zh-CHT.xml b/Sources/WAU/Winget-AutoUpdate/locale/zh-CHT.xml similarity index 100% rename from Winget-AutoUpdate/locale/zh-CHT.xml rename to Sources/WAU/Winget-AutoUpdate/locale/zh-CHT.xml diff --git a/Winget-AutoUpdate/mods/README.md b/Sources/WAU/Winget-AutoUpdate/mods/README.md similarity index 100% rename from Winget-AutoUpdate/mods/README.md rename to Sources/WAU/Winget-AutoUpdate/mods/README.md diff --git a/Winget-AutoUpdate/mods/_AppID-template.ps1 b/Sources/WAU/Winget-AutoUpdate/mods/_AppID-template.ps1 similarity index 100% rename from Winget-AutoUpdate/mods/_AppID-template.ps1 rename to Sources/WAU/Winget-AutoUpdate/mods/_AppID-template.ps1 diff --git a/Winget-AutoUpdate/mods/_Mods-Functions.ps1 b/Sources/WAU/Winget-AutoUpdate/mods/_Mods-Functions.ps1 similarity index 100% rename from Winget-AutoUpdate/mods/_Mods-Functions.ps1 rename to Sources/WAU/Winget-AutoUpdate/mods/_Mods-Functions.ps1 diff --git a/Winget-AutoUpdate/mods/_WAU-mods-template.ps1 b/Sources/WAU/Winget-AutoUpdate/mods/_WAU-mods-template.ps1 similarity index 100% rename from Winget-AutoUpdate/mods/_WAU-mods-template.ps1 rename to Sources/WAU/Winget-AutoUpdate/mods/_WAU-mods-template.ps1 diff --git a/Winget-AutoUpdate/mods/_WAU-notinstalled-template.ps1 b/Sources/WAU/Winget-AutoUpdate/mods/_WAU-notinstalled-template.ps1 similarity index 100% rename from Winget-AutoUpdate/mods/_WAU-notinstalled-template.ps1 rename to Sources/WAU/Winget-AutoUpdate/mods/_WAU-notinstalled-template.ps1 diff --git a/Winget-AutoUpdate/mods/bins/README.md b/Sources/WAU/Winget-AutoUpdate/mods/bins/README.md similarity index 100% rename from Winget-AutoUpdate/mods/bins/README.md rename to Sources/WAU/Winget-AutoUpdate/mods/bins/README.md diff --git a/excluded_apps.txt b/Sources/WAU/excluded_apps.txt similarity index 95% rename from excluded_apps.txt rename to Sources/WAU/excluded_apps.txt index f1cae6d..f40e6eb 100644 --- a/excluded_apps.txt +++ b/Sources/WAU/excluded_apps.txt @@ -1,12 +1,12 @@ -Google.Chrome -Microsoft.Edge -Microsoft.EdgeWebView2Runtime -Microsoft.Office -Microsoft.OneDrive -Microsoft.Teams -Microsoft.Teams.Classic -Mozilla.Firefox -Mozilla.Firefox.DeveloperEdition -Mozilla.Firefox.ESR -TeamViewer.TeamViewer -TeamViewer.TeamViewer.Host +Google.Chrome +Microsoft.Edge +Microsoft.EdgeWebView2Runtime +Microsoft.Office +Microsoft.OneDrive +Microsoft.Teams +Microsoft.Teams.Classic +Mozilla.Firefox +Mozilla.Firefox.DeveloperEdition +Mozilla.Firefox.ESR +TeamViewer.TeamViewer +TeamViewer.TeamViewer.Host