Require Windows 10 or newer for the MSI package. [skip ci]
This commit is contained in:
parent
eacd43d5b5
commit
62b744b2c4
|
@ -30,6 +30,9 @@ import xml.etree.ElementTree as ET
|
||||||
sys.path.append(os.getcwd())
|
sys.path.append(os.getcwd())
|
||||||
from mesonbuild import coredata
|
from mesonbuild import coredata
|
||||||
|
|
||||||
|
# Elementtree does not support CDATA. So hack it.
|
||||||
|
WINVER_CHECK = '<![CDATA[Installed OR (VersionNT64 > 602)]]>'
|
||||||
|
|
||||||
def gen_guid():
|
def gen_guid():
|
||||||
'''
|
'''
|
||||||
Generate guid
|
Generate guid
|
||||||
|
@ -205,6 +208,9 @@ class PackageGenerator:
|
||||||
'SummaryCodepage': '1252',
|
'SummaryCodepage': '1252',
|
||||||
})
|
})
|
||||||
|
|
||||||
|
condition = ET.SubElement(product, 'Condition', {'Message': 'This application is only supported on Windows 10 or higher.'})
|
||||||
|
|
||||||
|
condition.text = 'X'*len(WINVER_CHECK)
|
||||||
ET.SubElement(product, 'MajorUpgrade',
|
ET.SubElement(product, 'MajorUpgrade',
|
||||||
{'DowngradeErrorMessage': 'A newer version of Meson is already installed.'})
|
{'DowngradeErrorMessage': 'A newer version of Meson is already installed.'})
|
||||||
|
|
||||||
|
@ -270,6 +276,12 @@ class PackageGenerator:
|
||||||
doc = xml.dom.minidom.parse(self.main_xml)
|
doc = xml.dom.minidom.parse(self.main_xml)
|
||||||
with open(self.main_xml, 'w') as open_file:
|
with open(self.main_xml, 'w') as open_file:
|
||||||
open_file.write(doc.toprettyxml())
|
open_file.write(doc.toprettyxml())
|
||||||
|
# One last fix, add CDATA.
|
||||||
|
with open(self.main_xml, 'r') as open_file:
|
||||||
|
data = open_file.read()
|
||||||
|
data = data.replace('X'*len(WINVER_CHECK), WINVER_CHECK)
|
||||||
|
with open(self.main_xml, 'w') as open_file:
|
||||||
|
open_file.write(data)
|
||||||
|
|
||||||
def build_features(self, top_feature, staging_dir):
|
def build_features(self, top_feature, staging_dir):
|
||||||
'''
|
'''
|
||||||
|
|
Loading…
Reference in New Issue