Skip to content

Commit ffdc0b8

Browse files
committed
Update version calculation and remove unnecessary application for Microsoft Store compatibility
1 parent 0f75607 commit ffdc0b8

File tree

2 files changed

+16
-21
lines changed

2 files changed

+16
-21
lines changed

_msbuild.py

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -228,17 +228,24 @@ def get_commands():
228228

229229

230230
def _make_xyzw_version(v, sep="."):
231+
"""Calculate a suitable x.y.z.w version from our user-friendly version.
232+
233+
For MSIX in the Store, the fourth field must be 0.
234+
235+
For MSI, the first field must be <256.
236+
237+
If the explicit version contains a non-zero field 3, it will override the
238+
one that is calculated from prerelease markers.
239+
"""
231240
from packaging.version import parse
232241
v = parse(v)
233-
if not v.pre:
234-
return "{0}{4}{1}{4}{2}{4}{3}".format(v.major, v.minor, v.micro, 0xF0, sep)
235-
return "{0}{4}{1}{4}{2}{4}{3}".format(
236-
v.major,
237-
v.minor,
238-
v.micro,
239-
{"a": 0xA0, "b": 0xB0, "rc": 0xC0}.get(v.pre[0].lower(), 0) | v.pre[1],
240-
sep,
241-
)
242+
micro = 0xF0
243+
if v.pre:
244+
micro = {"a": 0xA0, "b": 0xB0, "rc": 0xC0}.get(v.pre[0].lower(), 0) | v.pre[1]
245+
if v.micro:
246+
print("[WARNING]Overriding calculated version field 3 with", v)
247+
micro = v.micro
248+
return "{0}{4}{1}{4}{2}{4}{3}".format(v.major, v.minor, micro, 0, sep)
242249

243250

244251
def _patch_appx_identity(source, dest, **new):

src/pymanager/appxmanifest.xml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,6 @@
4949
Square44x44Logo="_resources/setupx44.png"
5050
BackgroundColor="transparent" />
5151
</Application>
52-
<Application Id="Pyw.Manager.Exe"
53-
Executable="pyw-manager.exe"
54-
EntryPoint="Windows.FullTrustApplication"
55-
desktop4:SupportsMultipleInstances="true"
56-
desktop4:Subsystem="windows">
57-
<uap:VisualElements DisplayName="Python install manager (windowed)"
58-
Description="Add, remove and launch Python without creating a console window."
59-
Square150x150Logo="_resources/setupx150.png"
60-
Square44x44Logo="_resources/setupx44.png"
61-
BackgroundColor="transparent"
62-
AppListEntry="none" />
63-
</Application>
6452

6553
<Application Id="Pymanager.Exe"
6654
Executable="pymanager.exe"

0 commit comments

Comments
 (0)