Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
49fd8e8
fix(WingetSourceCustom): Correctly pass value of WingetSourceCustom to
Salamek Mar 14, 2026
bb87ec5
feat(Winget-Install): Support -Source parameter that defaults to winget
Salamek Mar 21, 2026
695c3f6
Update Winget-Install.ps1 to remove deprecated info
Romanitho Mar 23, 2026
e43896f
Update .github/workflows/GA_Close-Inactive-Issues.yml
Salamek Mar 23, 2026
152d4b3
feat: Add docs to new parameters and make it optional
Salamek Mar 23, 2026
8d2c4a0
fix(Winget-Install): Replace more hardcoded 'winget' sources with
Salamek Mar 23, 2026
bbf2c8f
Merge main into develop after the creation of release v2.11.0
actions-user Mar 24, 2026
767bbb0
Correct VC++ Redistributable download URL
KnifMelti Mar 25, 2026
9bc9f4e
Merge pull request #1142 from KnifMelti/feature/correct_vc
Romanitho Mar 26, 2026
fead5a2
Update Sources/Winget-AutoUpdate/functions/Get-AppInfo.ps1
Salamek Mar 26, 2026
d6cba1f
Bump peter-evans/create-pull-request from 8.1.0 to 8.1.1
dependabot[bot] Apr 13, 2026
5d157cd
Bump actions/github-script from 8 to 9
dependabot[bot] Apr 13, 2026
2038597
Merge pull request #1135 from Salamek/main
Romanitho Apr 13, 2026
f533f94
Merge pull request #1147 from Romanitho/dependabot/github_actions/dev…
Romanitho Apr 13, 2026
338e7a3
Merge pull request #1148 from Romanitho/dependabot/github_actions/dev…
Romanitho Apr 13, 2026
7b8b57d
Merge pull request #1150 from Romanitho/main
Romanitho Apr 15, 2026
efa9564
update MCKanpolat/auto-semver-action
Romanitho Apr 23, 2026
2980184
Merge pull request #1152 from Romanitho/dependancies
Romanitho Apr 23, 2026
5beb7c6
fix source defaults and docs per PR review
Copilot May 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/GA_Close-Inactive-Issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ jobs:
permissions:
issues: write
pull-requests: write
contents: write
steps:
- uses: actions/stale@v10.2.0
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/GA_Mega-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
- name: Create Pull Request with applied fixes
id: cpr
if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix')
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
with:
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
commit-message: "[MegaLinter] Apply linters automatic fixes"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
# Step 2: If the branch pattern is invalid, add a label and comment to the PR
- name: Handle invalid branch (label + comment)
if: failure()
uses: actions/github-script@v8
uses: actions/github-script@v9
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
Expand Down Expand Up @@ -122,7 +122,7 @@ jobs:
# Step 3: If the branch pattern is corrected, remove label and comment
- name: Clean up if branch is corrected
if: success()
uses: actions/github-script@v8
uses: actions/github-script@v9
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
steps:
# Step 1: Calculate the next version number based on the selected increment type
- name: Auto Increment Semver Action
uses: MCKanpolat/auto-semver-action@5003b8d37f4b03d95f15303ea10242cbf7c13141 # 2
uses: MCKanpolat/auto-semver-action@632a84f5d1232fe655c7a85684ba3105c28b3fec # 1.0.11
id: versioning
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/GitFlow_Nightly-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ jobs:

# Step 3: Generate new semantic version number
- name: Auto Increment Semver Action
uses: MCKanpolat/auto-semver-action@5003b8d37f4b03d95f15303ea10242cbf7c13141 # 2
uses: MCKanpolat/auto-semver-action@632a84f5d1232fe655c7a85684ba3105c28b3fec # 1.0.11
if: steps.check_prs.outputs.BUILD_NEEDED == 'true'
id: versioning
with:
Expand Down
37 changes: 21 additions & 16 deletions Sources/Winget-AutoUpdate/Winget-Install.ps1
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<#
.SYNOPSIS
Install apps with Winget through Intune or SCCM.
(Can be used standalone.) - Deprecated in favor of Winget-AutoUpdate.

.DESCRIPTION
Allow to run Winget in System Context to install your apps.
(https://github.com/Romanitho/Winget-Install) - Deprecated in favor of Winget-AutoUpdate.

.PARAMETER AppIDs
Forward Winget App ID to install. For multiple apps, separate with ",". Case sensitive.
Expand All @@ -23,6 +21,9 @@ Used to specify logpath. Default is same folder as Winget-Autoupdate project
Adds the app to the Winget-AutoUpdate White List. More info: https://github.com/Romanitho/Winget-AutoUpdate
If '-Uninstall' is used, it removes the app from WAU White List.

.PARAMETER Source
Specify the WinGet source to use for package operations (for example "winget" or "msstore"). Default is "winget".

.EXAMPLE
.\winget-install.ps1 -AppIDs 7zip.7zip

Expand All @@ -40,6 +41,9 @@ If '-Uninstall' is used, it removes the app from WAU White List.

.EXAMPLE
.\winget-install.ps1 -AppIDs "Notepad++.Notepad++" -AllowUpgrade

.EXAMPLE
.\winget-install.ps1 -AppIDs 9WZDNCRFJ3PT -Source msstore
#>

[CmdletBinding()]
Expand All @@ -48,7 +52,8 @@ param(
[Parameter(Mandatory = $False)] [Switch] $Uninstall,
[Parameter(Mandatory = $False)] [String] $LogPath,
[Parameter(Mandatory = $False)] [Switch] $WAUWhiteList,
[Parameter(Mandatory = $False)] [Switch] $AllowUpgrade
[Parameter(Mandatory = $False)] [Switch] $AllowUpgrade,
[Parameter(Mandatory = $False)] [String] $Source = "winget"
)


Expand Down Expand Up @@ -76,7 +81,7 @@ else {
#Check if App exists in Winget Repository
function Confirm-Exist ($AppID) {
#Check is app exists in the winget repository
$WingetApp = & $winget show --Id $AppID -e --accept-source-agreements -s winget | Out-String
$WingetApp = & $winget show --Id $AppID -e --accept-source-agreements -s $Source | Out-String

#Return if AppID exists
if ($WingetApp -match [regex]::Escape($AppID)) {
Expand Down Expand Up @@ -139,8 +144,8 @@ function Test-ModsUninstall ($AppID) {
}

#Install function
function Install-App ($AppID, $AppArgs) {
$IsInstalled = Confirm-Installation $AppID
function Install-App ($AppID, $AppArgs, $Source = 'winget') {
$IsInstalled = Confirm-Installation $AppID -src $Source
if (!($IsInstalled) -or $AllowUpgrade ) {
#Check if mods exist (or already exist) for preinstall/override/custom/arguments/install/installed
$ModsPreInstall, $ModsOverride, $ModsCustom, $ModsArguments, $ModsInstall, $ModsInstalled = Test-ModsInstall $($AppID)
Expand All @@ -159,21 +164,21 @@ function Install-App ($AppID, $AppArgs) {
Write-ToLog "-> Installing $AppID..." "DarkYellow"
if ($ModsOverride) {
Write-ToLog "-> Arguments (overriding default): $ModsOverride" # Without -h (user overrides default)
$WingetArgs = "install --id $AppID -e --accept-package-agreements --accept-source-agreements -s winget --override $ModsOverride" -split " "
$WingetArgs = @("install", "--id", $AppID, "-e", "--accept-package-agreements", "--accept-source-agreements", "-s", $Source, "--override", $ModsOverride)
}
elseif ($ModsCustom) {
Write-ToLog "-> Arguments (customizing default): $ModsCustom" # With -h (user customizes default)
$WingetArgs = "install --id $AppID -e --accept-package-agreements --accept-source-agreements -s winget -h --custom $ModsCustom" -split " "
$WingetArgs = @("install", "--id", $AppID, "-e", "--accept-package-agreements", "--accept-source-agreements", "-s", $Source, "-h", "--custom", $ModsCustom)
}
elseif ($ModsArguments -or (-not [string]::IsNullOrWhiteSpace($AppArgs))) {
# Prioritize ModsArguments from file over AppArgs from command line
$finalArgs = if ($ModsArguments) { $ModsArguments } else { $AppArgs }
Write-ToLog "-> Arguments (winget-level): $finalArgs" # Winget parameters with -h
$argArray = ConvertTo-WingetArgumentArray $finalArgs
$WingetArgs = @("install", "--id", $AppID, "-e", "--accept-package-agreements", "--accept-source-agreements", "-s", "winget") + $argArray + @("-h")
$WingetArgs = @("install", "--id", $AppID, "-e", "--accept-package-agreements", "--accept-source-agreements", "-s", $Source) + $argArray + @("-h")
}
else {
$WingetArgs = "install --id $AppID -e --accept-package-agreements --accept-source-agreements -s winget -h" -split " "
$WingetArgs = @("install", "--id", $AppID, "-e", "--accept-package-agreements", "--accept-source-agreements", "-s", $Source, "-h")
}

Write-ToLog "-> Running: `"$Winget`" $WingetArgs"
Expand All @@ -185,7 +190,7 @@ function Install-App ($AppID, $AppArgs) {
}

#Check if install is ok
$IsInstalled = Confirm-Installation $AppID
$IsInstalled = Confirm-Installation $AppID -src $Source
if ($IsInstalled) {
Write-ToLog "-> $AppID successfully installed." "Green"

Expand All @@ -209,8 +214,8 @@ function Install-App ($AppID, $AppArgs) {
}

#Uninstall function
function Uninstall-App ($AppID, $AppArgs) {
$IsInstalled = Confirm-Installation $AppID
function Uninstall-App ($AppID, $AppArgs, $Source = 'winget') {
$IsInstalled = Confirm-Installation $AppID -src $Source
if ($IsInstalled) {
#Check if mods exist (or already exist) for preuninstall/uninstall/uninstalled
$ModsPreUninstall, $ModsUninstall, $ModsUninstalled = Test-ModsUninstall $AppID
Expand Down Expand Up @@ -244,7 +249,7 @@ function Uninstall-App ($AppID, $AppArgs) {
}

#Check if uninstall is ok
$IsInstalled = Confirm-Installation $AppID
$IsInstalled = Confirm-Installation $AppID -src $Source
if (!($IsInstalled)) {
Write-ToLog "-> $AppID successfully uninstalled." "Green"
if ($ModsUninstalled) {
Expand Down Expand Up @@ -399,14 +404,14 @@ if ($Winget) {

#Install or Uninstall command
if ($Uninstall) {
Uninstall-App $AppID $AppArgs
Uninstall-App $AppID $AppArgs $Source
}
else {
#Check if app exists on Winget Repo
$Exists = Confirm-Exist $AppID
if ($Exists) {
#Install
Install-App $AppID $AppArgs
Install-App $AppID $AppArgs $Source
}
}

Expand Down
6 changes: 3 additions & 3 deletions Sources/Winget-AutoUpdate/Winget-Upgrade.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -307,12 +307,12 @@ if (Test-Network) {
}
#if app is in "include list", update it
elseif ($toUpdate -contains $app.Id) {
Update-App $app
Update-App $app -src $Script:WingetSourceCustom
}
#if app with wildcard is in "include list", update it
elseif ($toUpdate | Where-Object { $app.Id -like $_ }) {
Write-ToLog "$($app.Name) is wildcard in the include list."
Update-App $app
Update-App $app -src $Script:WingetSourceCustom
}
#else, skip it
else {
Expand All @@ -338,7 +338,7 @@ if (Test-Network) {
}
# else, update it
else {
Update-App $app
Update-App $app -src $Script:WingetSourceCustom
}
}
}
Expand Down
14 changes: 12 additions & 2 deletions Sources/Winget-AutoUpdate/functions/Confirm-Installation.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,23 @@
.PARAMETER AppVer
Expected version prefix.

.PARAMETER src
The WinGet source to query (e.g. "winget", "msstore"). Defaults to
"winget".

.OUTPUTS
Boolean: True if installed at version.
#>
Function Confirm-Installation ($AppName, $AppVer) {
Function Confirm-Installation ($AppName, $AppVer, $src = "winget") {
if ([string]::IsNullOrWhiteSpace($src)) {
$src = "winget"
}
else {
$src = $src.Trim()
}

$JsonFile = "$env:TEMP\InstalledApps.json"
& $Winget export -s winget -o $JsonFile --include-versions | Out-Null
& $Winget export -s $src -o $JsonFile --include-versions | Out-Null

$Packages = (Get-Content $JsonFile -Raw | ConvertFrom-Json).Sources.Packages
$match = $Packages | Where-Object { $_.PackageIdentifier -eq $AppName -and $_.Version -like "$AppVer*" }
Expand Down
12 changes: 9 additions & 3 deletions Sources/Winget-AutoUpdate/functions/Get-AppInfo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,25 @@
.PARAMETER AppID
The WinGet package identifier to query.

.PARAMETER src
The WinGet source to query (e.g. "winget", "msstore").

.OUTPUTS
String containing the release notes URL, or empty if not found.

.EXAMPLE
$releaseUrl = Get-AppInfo "Microsoft.PowerShell"
$releaseUrl = Get-AppInfo "Microsoft.PowerShell" "winget"

.NOTES
Uses WinGet show command with source agreements accepted.
#>
Function Get-AppInfo ($AppID) {
Function Get-AppInfo ($AppID, $src = 'winget') {

if ([string]::IsNullOrWhiteSpace($src)) {
$src = 'winget'
}
# Query WinGet for application details
$String = & $winget show $AppID --accept-source-agreements -s winget | Out-String
$String = & $winget show $AppID --accept-source-agreements -s $src | Out-String

# Extract Release Notes URL using regex
$ReleaseNote = [regex]::match($String, "(?<=Release Notes Url: )(.*)(?=\n)").Groups[0].Value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function Install-Prerequisites {
if ($needsInstall) {
try {
Write-ToLog "Installing VC++ Redistributable ($osArch)..."
$VCRedistUrl = "https://aka.ms/vs/17/release/VC_redist.$osArch.exe"
$VCRedistUrl = "https://aka.ms/vc14/VC_redist.$osArch.exe"
$installer = "$env:TEMP\VC_redist.$osArch.exe"

Invoke-WebRequest $VCRedistUrl -OutFile $installer -UseBasicParsing
Expand Down
19 changes: 14 additions & 5 deletions Sources/Winget-AutoUpdate/functions/Update-App.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,21 @@

.PARAMETER app
PSCustomObject with Name, Id, Version, AvailableVersion properties.

.PARAMETER src
The WinGet source to use (e.g. 'winget', 'msstore'). Defaults to 'winget'.
#>
Function Update-App ($app) {
Function Update-App ($app, $src = "winget") {
if ([string]::IsNullOrWhiteSpace($src)) {
$src = "winget"
}
else {
$src = $src.Trim()
}

# Helper function to build winget command parameters
function Get-WingetParams ($Command, $ModsOverride, $ModsCustom, $ModsArguments) {
$params = @($Command, "--id", $app.Id, "-e", "--accept-package-agreements", "--accept-source-agreements", "-s", "winget")
$params = @($Command, "--id", $app.Id, "-e", "--accept-package-agreements", "--accept-source-agreements", "-s", $src)
if ($Command -eq "install") { $params += "--force" }
Comment on lines +15 to 26

if ($ModsOverride) {
Expand Down Expand Up @@ -50,7 +59,7 @@ Function Update-App ($app) {
}

# Get release notes for notification button
$ReleaseNoteURL = Get-AppInfo $app.Id
$ReleaseNoteURL = Get-AppInfo $app.Id $src
$Button1Text = if ($ReleaseNoteURL) { $NotifLocale.local.outputs.output[10].message } else { $null }

# Send "updating" notification
Expand Down Expand Up @@ -80,7 +89,7 @@ Function Update-App ($app) {
& $ModsUpgrade
}

$ConfirmInstall = Confirm-Installation $app.Id $app.AvailableVersion
$ConfirmInstall = Confirm-Installation $app.Id $app.AvailableVersion $src

# Fallback to install if upgrade failed
if (-not $ConfirmInstall) {
Expand All @@ -98,7 +107,7 @@ Function Update-App ($app) {
& $ModsInstall
}

$ConfirmInstall = Confirm-Installation $app.Id $app.AvailableVersion
$ConfirmInstall = Confirm-Installation $app.Id $app.AvailableVersion $src
}
}

Expand Down
Loading
Loading