Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for productcode even if extension doesn't match #151

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
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
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