diff options
author | Gerald Combs <gerald@wireshark.org> | 2018-01-24 11:49:12 -0800 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2018-01-24 20:34:43 +0000 |
commit | 66a9f27dd1790deae574c3198aa61742ba18ba5d (patch) | |
tree | 596167ce5142403b7574cd35ce0360eff76c6e56 /packaging/wix | |
parent | fe007542268e0261aceb698d5f6d64384167695e (diff) |
Qt+WiX: Check windeployqt --list output.
Windeployqt 5.9.4 can print translation files that don't exist
(QTBUG-65974).
Fix up whitespace.
Change-Id: If0a4ad6e24023707fa7e9cb1132af8a8dc425627
Reviewed-on: https://code.wireshark.org/review/25457
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'packaging/wix')
-rw-r--r-- | packaging/wix/windeployqt-to-wix.ps1 | 60 |
1 files changed, 27 insertions, 33 deletions
diff --git a/packaging/wix/windeployqt-to-wix.ps1 b/packaging/wix/windeployqt-to-wix.ps1 index 7623e5d2c4..f8d5fd42fe 100644 --- a/packaging/wix/windeployqt-to-wix.ps1 +++ b/packaging/wix/windeployqt-to-wix.ps1 @@ -9,19 +9,7 @@ # By Gerald Combs <gerald@wireshark.org> # Copyright 1998 Gerald Combs # -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# SPDX-License-Identifier: GPL-2.0+ #requires -version 2 @@ -107,30 +95,36 @@ try { <ComponentGroup Id=`"CG.QtDependencies`"> " foreach ($entry in $wdqtList) { + $entryPath = Join-Path -Path $dllPath -ChildPath $entry + if ($entry.EndsWith(".qm") -and -not (Test-Path $entryPath -PathType Leaf)) { + # Windeployqt --list can print translation files that + # don't exist (QTBUG-65974). + continue + } $dir = Split-Path -Parent $entry if ($dir) { - if ($dir -ne $currentDir) { - if ($currentDir -ne "") { # for everything but first directory found - $currentDirList += $endDirList + if ($dir -ne $currentDir) { + if ($currentDir -ne "") { # for everything but first directory found + $currentDirList += $endDirList - # Previous directory complete, add to list - $dirList += $currentDirList - } else { - } + # Previous directory complete, add to list + $dirList += $currentDirList + } else { + } - $currentDirList = $startDirList + " <Directory Id=`"dir$dir`" Name=`"$dir`"> -" + $currentDirList = $startDirList + " <Directory Id=`"dir$dir`" Name=`"$dir`"> + " - $currentDir = $dir - } + $currentDir = $dir + } - $wix_name = $entry -replace "[\\|\.]", "_" + $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`" /> + $componentGroup += " <ComponentRef Id=`"cmp$wix_name`" /> " } else { @@ -138,19 +132,19 @@ try { <File Id=`"fil$entry`" KeyPath=`"yes`" Source=`"`$(var.Staging.Dir)\$entry`" /> </Component> " - $componentGroup += " <ComponentRef Id=`"cmp$entry`" /> + $componentGroup += " <ComponentRef Id=`"cmp$entry`" /> " } } - #finish up the last directory - $currentDirList += $endDirList - $dirList += $currentDirList + #finish up the last directory + $currentDirList += $endDirList + $dirList += $currentDirList - $dllList += " </DirectoryRef> + $dllList += " </DirectoryRef> </Fragment> " - $componentGroup += " </ComponentGroup> + $componentGroup += " </ComponentGroup> </Fragment> " @@ -237,4 +231,4 @@ Set-Content $FilePath @" --> "@ -Add-Content $FilePath $wixComponents
\ No newline at end of file +Add-Content $FilePath $wixComponents |