mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-06-08 11:22:10 +03:00
WiX: Autogeneration of EDMarketConnector.wxs fully working
* Changed config version to 5.3.0-beta2 to be sure during testing. * Fixed the case on ChangeLog.md in setup.py py2exe config. * Replaced all TABs with <4 spaces> in wix/template.wxs. * Now generating the correct Feature tree in the output file. NB: The 'RegistryEntries' isn't part of the file Components but still needs to be referenced inside <Feature>.
This commit is contained in:
parent
0af2af344d
commit
a196bfe172
@ -33,7 +33,7 @@ appcmdname = 'EDMC'
|
|||||||
# <https://semver.org/#semantic-versioning-specification-semver>
|
# <https://semver.org/#semantic-versioning-specification-semver>
|
||||||
# Major.Minor.Patch(-prerelease)(+buildmetadata)
|
# Major.Minor.Patch(-prerelease)(+buildmetadata)
|
||||||
# NB: Do *not* import this, use the functions appversion() and appversion_nobuild()
|
# NB: Do *not* import this, use the functions appversion() and appversion_nobuild()
|
||||||
_static_appversion = '5.3.0-beta1'
|
_static_appversion = '5.3.0-beta2'
|
||||||
_cached_version: Optional[semantic_version.Version] = None
|
_cached_version: Optional[semantic_version.Version] = None
|
||||||
copyright = '© 2015-2019 Jonathan Harris, 2020-2021 EDCD'
|
copyright = '© 2015-2019 Jonathan Harris, 2020-2021 EDCD'
|
||||||
|
|
||||||
|
26
setup.py
26
setup.py
@ -212,7 +212,7 @@ elif sys.platform == 'win32':
|
|||||||
'WinSparkle.dll',
|
'WinSparkle.dll',
|
||||||
'WinSparkle.pdb', # For debugging - don't include in package
|
'WinSparkle.pdb', # For debugging - don't include in package
|
||||||
'EUROCAPS.TTF',
|
'EUROCAPS.TTF',
|
||||||
'Changelog.md',
|
'ChangeLog.md',
|
||||||
'commodity.csv',
|
'commodity.csv',
|
||||||
'rare_commodity.csv',
|
'rare_commodity.csv',
|
||||||
'snd_good.wav',
|
'snd_good.wav',
|
||||||
@ -351,6 +351,30 @@ elif sys.platform == 'win32':
|
|||||||
|
|
||||||
program_files_folder.insert(0, directory_win32)
|
program_files_folder.insert(0, directory_win32)
|
||||||
# Append the Feature/ComponentRef listing to match
|
# Append the Feature/ComponentRef listing to match
|
||||||
|
feature = template_tree.find('.//{*}Feature[@Id="Complete"][@Level="1"]')
|
||||||
|
if feature is None:
|
||||||
|
raise ValueError(f'{template_file}: Expected Feature element with Id="Complete" Level="1"')
|
||||||
|
|
||||||
|
# This isn't part of the components
|
||||||
|
feature.append(
|
||||||
|
etree.Element(
|
||||||
|
'ComponentRef',
|
||||||
|
attrib={
|
||||||
|
'Id': 'RegistryEntries'
|
||||||
|
},
|
||||||
|
nsmap=directory_win32.nsmap
|
||||||
|
)
|
||||||
|
)
|
||||||
|
for c in directory_win32.findall('.//{*}Component'):
|
||||||
|
feature.append(
|
||||||
|
etree.Element(
|
||||||
|
'ComponentRef',
|
||||||
|
attrib={
|
||||||
|
'Id': c.get('Id')
|
||||||
|
},
|
||||||
|
nsmap=directory_win32.nsmap
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
# Insert what we now have into the template and write it out
|
# Insert what we now have into the template and write it out
|
||||||
template_tree.write(
|
template_tree.write(
|
||||||
|
194
wix/template.wxs
194
wix/template.wxs
@ -6,119 +6,119 @@
|
|||||||
<?define UPGRADECODE = "9df571ae-d56d-46e6-af79-4e72ad54efe6" ?>
|
<?define UPGRADECODE = "9df571ae-d56d-46e6-af79-4e72ad54efe6" ?>
|
||||||
|
|
||||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||||
<Product Id="*"
|
<Product Id="*"
|
||||||
Name="$(var.PRODUCTLONGNAME)"
|
Name="$(var.PRODUCTLONGNAME)"
|
||||||
Version="$(var.PRODUCTVERSION)"
|
Version="$(var.PRODUCTVERSION)"
|
||||||
UpgradeCode="$(var.UPGRADECODE)"
|
UpgradeCode="$(var.UPGRADECODE)"
|
||||||
Language="!(bind.fileLanguage.EDMarketConnector.exe)"
|
Language="!(bind.fileLanguage.EDMarketConnector.exe)"
|
||||||
Manufacturer="EDCD">
|
Manufacturer="EDCD">
|
||||||
|
|
||||||
<Package Id="*" Keywords="Installer"
|
<Package Id="*" Keywords="Installer"
|
||||||
InstallScope="perMachine"
|
InstallScope="perMachine"
|
||||||
Description="$(var.PRODUCTLONGNAME) installer"
|
Description="$(var.PRODUCTLONGNAME) installer"
|
||||||
InstallerVersion="300" Compressed="yes"
|
InstallerVersion="300" Compressed="yes"
|
||||||
Platform="x86"
|
Platform="x86"
|
||||||
Languages="1033,1029,1031,1034,1035,1036,1038,1040,1041,1043,1045,1046,1049,1058,1062,2052,2070,2074,6170,1060,1053,18,0" />
|
Languages="1033,1029,1031,1034,1035,1036,1038,1040,1041,1043,1045,1046,1049,1058,1062,2052,2070,2074,6170,1060,1053,18,0" />
|
||||||
<!-- en cs, de es fi fr hu it ja nl pl pt-BR ru uk lv zh-CN pt-PT sr-Latn sr-Latn-BA sl sv-SE ko neutral -->
|
<!-- en cs, de es fi fr hu it ja nl pl pt-BR ru uk lv zh-CN pt-PT sr-Latn sr-Latn-BA sl sv-SE ko neutral -->
|
||||||
<!-- https://msdn.microsoft.com/en-gb/goglobal/bb964664.aspx -->
|
<!-- https://msdn.microsoft.com/en-gb/goglobal/bb964664.aspx -->
|
||||||
|
|
||||||
<!-- Always reinstall since patching is problematic -->
|
<!-- Always reinstall since patching is problematic -->
|
||||||
<!-- http://www.joyofsetup.com/2010/01/16/major-upgrades-now-easier-than-ever/ -->
|
<!-- http://www.joyofsetup.com/2010/01/16/major-upgrades-now-easier-than-ever/ -->
|
||||||
<MajorUpgrade AllowSameVersionUpgrades="yes" DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
|
<MajorUpgrade AllowSameVersionUpgrades="yes" DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
|
||||||
|
|
||||||
<Media Id="1" Cabinet="product.cab" EmbedCab="yes" />
|
<Media Id="1" Cabinet="product.cab" EmbedCab="yes" />
|
||||||
|
|
||||||
<Icon Id="EDMarketConnector.exe" SourceFile="EDMarketConnector.ico"/>
|
<Icon Id="EDMarketConnector.exe" SourceFile="EDMarketConnector.ico"/>
|
||||||
|
|
||||||
<!-- For Add/Remove programs -->
|
<!-- For Add/Remove programs -->
|
||||||
<Property Id="ARPPRODUCTICON" Value="EDMarketConnector.exe" />
|
<Property Id="ARPPRODUCTICON" Value="EDMarketConnector.exe" />
|
||||||
<Property Id="ARPNOMODIFY" Value="yes" Secure="yes" /> <!-- Remove modify - also set by WixUI_Minimal -->
|
<Property Id="ARPNOMODIFY" Value="yes" Secure="yes" /> <!-- Remove modify - also set by WixUI_Minimal -->
|
||||||
<Property Id="ARPHELPLINK" Value="https://github.com/EDCD/EDMarketConnector/wiki" />
|
<Property Id="ARPHELPLINK" Value="https://github.com/EDCD/EDMarketConnector/wiki" />
|
||||||
|
|
||||||
<!-- Set INSTALLDIR from ARPINSTALLLOCATION if replacing/upgrading -->
|
<!-- Set INSTALLDIR from ARPINSTALLLOCATION if replacing/upgrading -->
|
||||||
<!-- https://wyrdfish.wordpress.com/2012/07/20/msi-writing-guidelines-this-may-be-out-of-date/ -->
|
<!-- https://wyrdfish.wordpress.com/2012/07/20/msi-writing-guidelines-this-may-be-out-of-date/ -->
|
||||||
<Property Id="ARPINSTALLLOCATION">
|
<Property Id="ARPINSTALLLOCATION">
|
||||||
<RegistrySearch Id="GetARPINSTALLLOCATION"
|
<RegistrySearch Id="GetARPINSTALLLOCATION"
|
||||||
Root="HKLM"
|
Root="HKLM"
|
||||||
Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[WIX_UPGRADE_DETECTED]"
|
Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[WIX_UPGRADE_DETECTED]"
|
||||||
Name="InstallLocation"
|
Name="InstallLocation"
|
||||||
Type="raw" />
|
Type="raw" />
|
||||||
</Property>
|
</Property>
|
||||||
<CustomAction Id="SetINSTALLDIR" Property="INSTALLDIR" Value="[ARPINSTALLLOCATION]" />
|
<CustomAction Id="SetINSTALLDIR" Property="INSTALLDIR" Value="[ARPINSTALLLOCATION]" />
|
||||||
<InstallUISequence>
|
<InstallUISequence>
|
||||||
<Custom Action="SetINSTALLDIR" After="AppSearch">
|
<Custom Action="SetINSTALLDIR" After="AppSearch">
|
||||||
WIX_UPGRADE_DETECTED AND ARPINSTALLLOCATION
|
WIX_UPGRADE_DETECTED AND ARPINSTALLLOCATION
|
||||||
</Custom>
|
</Custom>
|
||||||
</InstallUISequence>
|
</InstallUISequence>
|
||||||
<InstallExecuteSequence>
|
<InstallExecuteSequence>
|
||||||
<Custom Action="SetINSTALLDIR" After="AppSearch">
|
<Custom Action="SetINSTALLDIR" After="AppSearch">
|
||||||
WIX_UPGRADE_DETECTED AND ARPINSTALLLOCATION
|
WIX_UPGRADE_DETECTED AND ARPINSTALLLOCATION
|
||||||
</Custom>
|
</Custom>
|
||||||
</InstallExecuteSequence>
|
</InstallExecuteSequence>
|
||||||
|
|
||||||
<!-- Set ARPINSTALLLOCATION from INSTALLDIR if new install -->
|
<!-- Set ARPINSTALLLOCATION from INSTALLDIR if new install -->
|
||||||
<!-- http://blogs.technet.com/b/alexshev/archive/2008/02/09/from-msi-to-wix-part-2.aspx -->
|
<!-- http://blogs.technet.com/b/alexshev/archive/2008/02/09/from-msi-to-wix-part-2.aspx -->
|
||||||
<CustomAction Id="SetARPINSTALLLOCATION" Property="ARPINSTALLLOCATION" Value="[INSTALLDIR]" />
|
<CustomAction Id="SetARPINSTALLLOCATION" Property="ARPINSTALLLOCATION" Value="[INSTALLDIR]" />
|
||||||
<InstallExecuteSequence>
|
<InstallExecuteSequence>
|
||||||
<Custom Action="SetARPINSTALLLOCATION" After="InstallValidate">
|
<Custom Action="SetARPINSTALLLOCATION" After="InstallValidate">
|
||||||
NOT Installed
|
NOT Installed
|
||||||
</Custom>
|
</Custom>
|
||||||
</InstallExecuteSequence>
|
</InstallExecuteSequence>
|
||||||
|
|
||||||
<!-- Launch app after upgrade -->
|
<!-- Launch app after upgrade -->
|
||||||
<Property Id="LAUNCH" Value="yes" />
|
<Property Id="LAUNCH" Value="yes" />
|
||||||
<CustomAction Id="DoLaunch"
|
<CustomAction Id="DoLaunch"
|
||||||
Directory="INSTALLDIR"
|
Directory="INSTALLDIR"
|
||||||
ExeCommand='"[INSTALLDIR]EDMarketConnector.exe"'
|
ExeCommand='"[INSTALLDIR]EDMarketConnector.exe"'
|
||||||
Return="asyncNoWait"
|
Return="asyncNoWait"
|
||||||
Execute="deferred"
|
Execute="deferred"
|
||||||
Impersonate="yes"
|
Impersonate="yes"
|
||||||
/>
|
/>
|
||||||
<InstallExecuteSequence>
|
<InstallExecuteSequence>
|
||||||
<!-- http://alekdavis.blogspot.co.uk/2013/05/wix-woes-what-is-your-installer-doing.html -->
|
<!-- http://alekdavis.blogspot.co.uk/2013/05/wix-woes-what-is-your-installer-doing.html -->
|
||||||
<Custom Action="DoLaunch" Before="InstallFinalize">
|
<Custom Action="DoLaunch" Before="InstallFinalize">
|
||||||
NOT Installed AND LAUNCH ~= "yes"
|
NOT Installed AND LAUNCH ~= "yes"
|
||||||
</Custom>
|
</Custom>
|
||||||
</InstallExecuteSequence>
|
</InstallExecuteSequence>
|
||||||
|
|
||||||
<Directory Id="TARGETDIR" Name="SourceDir">
|
<Directory Id="TARGETDIR" Name="SourceDir">
|
||||||
|
|
||||||
<!-- http://wixtoolset.org/documentation/manual/v3/howtos/files_and_registry/write_a_registry_entry.html -->
|
<!-- http://wixtoolset.org/documentation/manual/v3/howtos/files_and_registry/write_a_registry_entry.html -->
|
||||||
<Component Id="RegistryEntries" Guid="*">
|
<Component Id="RegistryEntries" Guid="*">
|
||||||
<RegistryKey Root="HKCR" Key="edmc">
|
<RegistryKey Root="HKCR" Key="edmc">
|
||||||
<RegistryValue Type="string" Value="$(var.PRODUCTLONGNAME)"/>
|
<RegistryValue Type="string" Value="$(var.PRODUCTLONGNAME)"/>
|
||||||
<RegistryValue Type="string" Name="URL Protocol" Value=""/>
|
<RegistryValue Type="string" Name="URL Protocol" Value=""/>
|
||||||
<RegistryKey Key="DefaultIcon">
|
<RegistryKey Key="DefaultIcon">
|
||||||
<RegistryValue Type="string" Value="[INSTALLDIR]EDMarketConnector.exe,0"/>
|
<RegistryValue Type="string" Value="[INSTALLDIR]EDMarketConnector.exe,0"/>
|
||||||
</RegistryKey>
|
</RegistryKey>
|
||||||
<RegistryKey Key="shell">
|
<RegistryKey Key="shell">
|
||||||
<RegistryKey Key="open">
|
<RegistryKey Key="open">
|
||||||
<RegistryKey Key="command">
|
<RegistryKey Key="command">
|
||||||
<RegistryValue Type="string" Value='"[INSTALLDIR]EDMarketConnector.exe" "%1"'/>
|
<RegistryValue Type="string" Value='"[INSTALLDIR]EDMarketConnector.exe" "%1"'/>
|
||||||
</RegistryKey>
|
</RegistryKey>
|
||||||
<RegistryKey Key="ddeexec">
|
<RegistryKey Key="ddeexec">
|
||||||
<RegistryValue Type="string" Value='Open("%1")'/>
|
<RegistryValue Type="string" Value='Open("%1")'/>
|
||||||
</RegistryKey>
|
</RegistryKey>
|
||||||
</RegistryKey>
|
</RegistryKey>
|
||||||
</RegistryKey>
|
</RegistryKey>
|
||||||
</RegistryKey>
|
</RegistryKey>
|
||||||
</Component>
|
</Component>
|
||||||
|
|
||||||
<!-- Generate with `heat.exe dir dist.win32 -ag -sfrag -suid -out foo.wxs` -->
|
<!-- Generate with `heat.exe dir dist.win32 -ag -sfrag -suid -out foo.wxs` -->
|
||||||
<!-- Sadly too late for auto-generated Component UUIDs -->
|
<!-- Sadly too late for auto-generated Component UUIDs -->
|
||||||
|
|
||||||
<Directory Id="ProgramFilesFolder">
|
<Directory Id="ProgramFilesFolder">
|
||||||
</Directory>
|
</Directory>
|
||||||
|
|
||||||
<Directory Id="ProgramMenuFolder" Name="Programs">
|
<Directory Id="ProgramMenuFolder" Name="Programs">
|
||||||
</Directory>
|
</Directory>
|
||||||
|
|
||||||
</Directory>
|
</Directory>
|
||||||
|
|
||||||
<Feature Id='Complete' Level='1'>
|
<Feature Id='Complete' Level='1'>
|
||||||
</Feature>
|
</Feature>
|
||||||
|
|
||||||
</Product>
|
</Product>
|
||||||
</Wix>
|
</Wix>
|
||||||
|
|
||||||
<!-- Local Variables: -->
|
<!-- Local Variables: -->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user