Skip to content

Commit

Permalink
WiX: Fix our generated Qt component IDs
Browse files Browse the repository at this point in the history
Fixup all of our component IDs. Replace invalid characters using an
allowlist instead of a blocklist.
  • Loading branch information
geraldcombs committed Oct 25, 2024
1 parent 01ab846 commit 262f977
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packaging/wix/windeployqt-to-wix.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ try {
"
foreach ($entry in $wdqtList) {
$dir = Split-Path -Parent $entry
$wix_name = $entry -ireplace "[^a-z0-9]", "_"

if ($dir) {
if ($dir -ne $currentDir) {
if ($currentDir -ne "") { # for everything but first directory found
Expand All @@ -108,20 +110,18 @@ try {
$currentDir = $dir
}

$wix_name = $entry -replace "[\\|\.]", "_"
$currentDirList += " <Component Id=`"cmp$wix_name`" Guid=`"*`">
<File Id=`"fil$wix_name`" KeyPath=`"yes`" Source=`"`$(var.Staging.Dir)\$entry`" />
</Component>
"
$componentGroup += " <ComponentRef Id=`"cmp$wix_name`" />
"
} else {

$dllList += " <Component Id=`"cmp$entry`" Guid=`"*`">
<File Id=`"fil$entry`" KeyPath=`"yes`" Source=`"`$(var.Staging.Dir)\$entry`" />
$dllList += " <Component Id=`"cmp$wix_name`" Guid=`"*`">
<File Id=`"fil$wix_name`" KeyPath=`"yes`" Source=`"`$(var.Staging.Dir)\$entry`" />
</Component>
"
$componentGroup += " <ComponentRef Id=`"cmp$entry`" />
$componentGroup += " <ComponentRef Id=`"cmp$wix_name`" />
"
}
}
Expand Down

0 comments on commit 262f977

Please sign in to comment.