[PATCH 1 of 2] packaging: use Vista style theming on Windows (fixes #5807)

2 views
Skip to first unread message

Matt Harbison

unread,
Jul 5, 2022, 2:31:32 PM7/5/22
to thg...@googlegroups.com
# HG changeset patch
# User Matt Harbison <matt_h...@yahoo.com>
# Date 1657044527 14400
# Tue Jul 05 14:08:47 2022 -0400
# Branch stable
# Node ID 7fc32edc4146d8e4a25d478711dc27212180bbbc
# Parent 04fa0699e5dc0b050963a26923c5975eda90af86
packaging: use Vista style theming on Windows (fixes #5807)

Apparently, this DLL was factored out since Qt 5.9 (use by py2 builds). The net
effect is the py3 build now looks like the py2 build. Thanks to vitidev for
figuring this out.

diff --git a/contrib/packaging/thgpackaging/py2exe.py b/contrib/packaging/thgpackaging/py2exe.py
--- a/contrib/packaging/thgpackaging/py2exe.py
+++ b/contrib/packaging/thgpackaging/py2exe.py
@@ -61,6 +61,7 @@
('{thg_dir}/dist/lib/library.zip', 'lib/'),
('{thg_dir}/dist/platforms/*.dll', './platforms/'),
('{thg_dir}/dist/python*.dll', './'),
+ ('{thg_dir}/dist/styles/*.dll', './styles/'),
('{thg_dir}/icons/*.ico', 'icons/'),
('{thg_dir}/icons/README.txt', 'icons/'),
('{thg_dir}/locale/**/*', 'locale/'),
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -598,12 +598,14 @@
from tortoisehg.hgqt.qtcore import QT_API
if QT_API == 'PyQt6':
_data_files.append(qt6_plugins('platforms', 'qwindows.dll'))
+ _data_files.append(qt6_plugins('styles', 'qwindowsvistastyle.dll'))
_data_files.append(qt6_plugins('imageformats',
'qico.dll', 'qsvg.dll', 'qjpeg.dll',
'qgif.dll', 'qicns.dll', 'qtga.dll',
'qtiff.dll', 'qwbmp.dll', 'qwebp.dll'))
else:
_data_files.append(qt5_plugins('platforms', 'qwindows.dll'))
+ _data_files.append(qt5_plugins('styles', 'qwindowsvistastyle.dll'))
_data_files.append(qt5_plugins('imageformats',
'qico.dll', 'qsvg.dll', 'qjpeg.dll',
'qgif.dll', 'qicns.dll', 'qtga.dll',
diff --git a/win32/wix/dist-py3.wxs b/win32/wix/dist-py3.wxs
--- a/win32/wix/dist-py3.wxs
+++ b/win32/wix/dist-py3.wxs
@@ -169,4 +169,14 @@
</DirectoryRef>
</Fragment>

+ <Fragment>
+ <DirectoryRef Id="INSTALLDIR">
+ <Directory Id="stylesDir" Name="styles" FileSource="$(var.SourceDir)/styles">
+ <Component Id="styles" Guid="$(var.styles.guid)" Win64='$(var.IsX64)'>
+ <File Name="qwindowsvistastyle.dll" KeyPath="yes" />
+ </Component>
+ </Directory>
+ </DirectoryRef>
+ </Fragment>
+
</Wix>
diff --git a/win32/wix/guids.wxi b/win32/wix/guids.wxi
--- a/win32/wix/guids.wxi
+++ b/win32/wix/guids.wxi
@@ -37,6 +37,7 @@
<?define imageformats.guid = {12885995-61ed-468f-a964-3654d091138e} ?>
<?define platforms.guid = {4b2c42d4-fbb3-4449-b1df-31bf789e009e} ?>
<?define KDiff3EXE.guid = {075ECC11-1B44-48DB-B7FD-D3207BB801A4} ?>
+ <?define styles.guid = {7a2b1268-0b57-47c2-afaa-f9988c3debf6} ?>

<!-- icons.wxs -->
<?define Icons.guid = {34369923-9610-461C-9FB3-26CA3A139836} ?>
diff --git a/win32/wix/tortoisehg-py3.wxs b/win32/wix/tortoisehg-py3.wxs
--- a/win32/wix/tortoisehg-py3.wxs
+++ b/win32/wix/tortoisehg-py3.wxs
@@ -235,6 +235,7 @@
<ComponentRef Id='TortoisePlinkEXE' />
<ComponentRef Id='imageFormats' />
<ComponentRef Id='platforms' />
+ <ComponentRef Id='styles' />
<ComponentGroupRef Id='templatesFolder' />
<ComponentRef Id='Icons' />
</Feature>

Matt Harbison

unread,
Jul 5, 2022, 2:31:33 PM7/5/22
to thg...@googlegroups.com
# HG changeset patch
# User Matt Harbison <matt_h...@yahoo.com>
# Date 1657048827 14400
# Tue Jul 05 15:20:27 2022 -0400
# Branch stable
# Node ID 5d7a527d83219ffd5e2e7d7715bd3f9d0651db48
# Parent 7fc32edc4146d8e4a25d478711dc27212180bbbc
wix: force a global install scope on Windows (fixes #5800)

This restores the behavior of the py2 package, because apparently the CRT merge
module (not used with py3) set this scope automatically.

https://stackoverflow.com/questions/5411585/setting-allusers-in-wix-for-per-user-or-per-machine-installation-context

diff --git a/win32/wix/tortoisehg-py3.wxs b/win32/wix/tortoisehg-py3.wxs
--- a/win32/wix/tortoisehg-py3.wxs
+++ b/win32/wix/tortoisehg-py3.wxs
@@ -29,6 +29,7 @@
Manufacturer='Steve Borho and others'>

<Package Id='*' Keywords='Installer'
+ InstallScope='perMachine'
Description="Windows shell extension for Mercurial DVCS (version $(var.Version))"
Manufacturer='Steve Borho and others'
InstallerVersion='301' Languages='1033' Compressed='yes'

Yuya Nishihara

unread,
Jul 6, 2022, 8:12:45 AM7/6/22
to Matt Harbison, thg...@googlegroups.com
On Tue, 05 Jul 2022 14:31:29 -0400, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_h...@yahoo.com>
> # Date 1657044527 14400
> # Tue Jul 05 14:08:47 2022 -0400
> # Branch stable
> # Node ID 7fc32edc4146d8e4a25d478711dc27212180bbbc
> # Parent 04fa0699e5dc0b050963a26923c5975eda90af86
> packaging: use Vista style theming on Windows (fixes #5807)

Queued for stable, thanks.
Reply all
Reply to author
Forward
0 new messages