Skip to content

Commit

Permalink
Check for productcode even if extension doesn't match
Browse files Browse the repository at this point in the history
  • Loading branch information
Trenly committed Feb 11, 2022
1 parent f707aec commit 505b139
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Tools/YamlCreate.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ Function Read-InstallerEntry {
if ($_) { $_Installer['InstallerType'] = $_ | Select-Object -First 1 }
Get-UriArchitecture -URI $_Installer['InstallerUrl'] -OutVariable _ | Out-Null
if ($_) { $_Installer['Architecture'] = $_ | Select-Object -First 1 }
if ([System.Environment]::OSVersion.Platform -match 'Win' -and ($script:dest).EndsWith('.msi')) {
if ([System.Environment]::OSVersion.Platform -match 'Win' -and ($script:dest).EndsWith('.msi') -or ($_Installer.InstallerType -in @('msi';'wix'))) {
$ProductCode = ([string](Get-MSIProperty -MSIPath $script:dest -Parameter 'ProductCode') | Select-String -Pattern '{[A-Z0-9]{8}-([A-Z0-9]{4}-){3}[A-Z0-9]{12}}').Matches.Value
}
if (Test-String -Not "$ProductCode" -IsNull) { $_Installer['ProductCode'] = "$ProductCode" }
Expand Down Expand Up @@ -894,7 +894,7 @@ Function Read-QuickInstallerEntry {
# Update the product code, if a new one exists
# If a new product code doesn't exist, and the installer isn't an `.exe` file, remove the product code if it exists
$MSIProductCode = $null
if ([System.Environment]::OSVersion.Platform -match 'Win' -and ($script:dest).EndsWith('.msi')) {
if ([System.Environment]::OSVersion.Platform -match 'Win' -and ($script:dest).EndsWith('.msi') -or ($_NewInstaller.InstallerType -in @('msi';'wix'))) {
$MSIProductCode = ([string](Get-MSIProperty -MSIPath $script:dest -Parameter 'ProductCode') | Select-String -Pattern '{[A-Z0-9]{8}-([A-Z0-9]{4}-){3}[A-Z0-9]{12}}').Matches.Value
}
if (Test-String -not $MSIProductCode -IsNull) {
Expand Down Expand Up @@ -2304,7 +2304,7 @@ Switch ($script:Option) {
# Update the product code, if a new one exists
# If a new product code doesn't exist, and the installer isn't an `.exe` file, remove the product code if it exists
$MSIProductCode = $null
if ([System.Environment]::OSVersion.Platform -match 'Win' -and ($script:dest).EndsWith('.msi')) {
if ([System.Environment]::OSVersion.Platform -match 'Win' -and ($script:dest).EndsWith('.msi') -or ($_Installer.InstallerType -in @('msi';'wix'))) {
$MSIProductCode = ([string](Get-MSIProperty -MSIPath $script:dest -Parameter 'ProductCode') | Select-String -Pattern '{[A-Z0-9]{8}-([A-Z0-9]{4}-){3}[A-Z0-9]{12}}').Matches.Value
}
if (Test-String -not $MSIProductCode -IsNull) {
Expand Down

0 comments on commit 505b139

Please sign in to comment.