← Back to DAGDA | Support | Source: https://github.com/python/cpython/pull/10245/commits/8ca533a3ebc591a4842a45856dcc9473cacde53b
Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
17ba155
bpo-34977: Add Windows App Store package
zooba Oct 1, 2018
303497e
Runs symlink tests in correct directory
zooba Nov 19, 2018
164506e
Merge remote-tracking branch 'cpython/master' into msix
zooba Nov 19, 2018
8d1d6f8
Switch python_uwp to use new API
zooba Nov 19, 2018
d02bc93
Undoes some unnecessary changes
zooba Nov 19, 2018
1bf9ae8
Merge remote-tracking branch 'cpython/master' into msix
zooba Nov 20, 2018
0e2c7ad
Merge remote-tracking branch 'cpython/master' into msix
zooba Nov 22, 2018
5d600d1
Fixes MSIX registry keys
zooba Nov 23, 2018
312e9f0
Merge remote-tracking branch 'cpython/master' into msix
zooba Nov 23, 2018
f02f481
Fixes argc issue and handle new include/ dirs
zooba Nov 23, 2018
cb34aa3
Fix invalid name
zooba Nov 23, 2018
64e24d4
Fixes tcl library not being correctly included
zooba Nov 23, 2018
28e7f1f
Fixes missing vcruntime and venv warning
zooba Nov 26, 2018
76c1864
Fix minor issues, improve sccd file
zooba Nov 26, 2018
9e7675e
Remove classicAppCompat SCCD and registry keys
zooba Nov 28, 2018
b7383fe
Fixes version number and adds registry exception
zooba Nov 29, 2018
c108ab6
Add missing XML prefix
zooba Nov 29, 2018
8ce142a
Fix version numbers and enable reg virtualization for current versions
zooba Nov 29, 2018
48dd10a
Added signed classicAppCompat.sccd
zooba Nov 30, 2018
9ac3c57
Treat classicAppCompat files as binary
zooba Nov 30, 2018
8fe2b24
Fixes size of logo image
zooba Dec 4, 2018
8ca533a
Remove mapping files and fix APPX build
zooba Dec 6, 2018
3615a73
Adds basic store info and support local signing with cert file
zooba Dec 6, 2018
bdcf497
Ensures name is passed to makepri
zooba Dec 7, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove mapping files and fix APPX build
  • Loading branch information
zooba committed Dec 6, 2018
commit 8ca533a3ebc591a4842a45856dcc9473cacde53b
40 changes: 3 additions & 37 deletions PC/layout/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,9 @@ def generate_source_files(ns):
with open(ns.temp / "AppxManifest.xml", "wb") as f:
f.write(get_appxmanifest(ns))

with open(ns.temp / "_resources.xml", "wb") as f:
f.write(get_resources_xml(ns))

if ns.include_pip:
pip_dir = get_pip_dir(ns)
if not (pip_dir / "pip").is_dir():
Expand All @@ -358,21 +361,6 @@ def generate_source_files(ns):
f.write(get_props(ns))


def _create_mapping_file(ns):
if not ns.mapping:
return None

ns.mapping.parent.mkdir(parents=True, exist_ok=True)

map_file = open(ns.mapping, "w", encoding="utf-8")
try:
print("[Files]", file=map_file)
return map_file
except:
map_file.close()
raise


def _create_zip_file(ns):
if not ns.zip:
return None
Expand Down Expand Up @@ -401,7 +389,6 @@ def copy_files(files, ns):
total = None
count = 0

map_file = _create_mapping_file(ns)
zip_file = _create_zip_file(ns)
try:
need_compile = []
Expand Down Expand Up @@ -441,10 +428,6 @@ def copy_files(files, ns):
except shutil.SameFileError:
pass

if ns.mapping:
log_debug("Write ({}, {}) to mapping file {}", src, dest, ns.mapping)
print('"{}" "{}"'.format(src, Path(dest)), file=map_file)

if ns.zip:
log_debug("Zip {} into {}", src, ns.zip)
zip_file.write(src, str(dest))
Expand All @@ -460,11 +443,6 @@ def copy_files(files, ns):
if not c:
continue
cdest = Path(dest).parent / Path(c).relative_to(src.parent)
if ns.mapping:
log_debug(
"Write ({}, {}) to mapping file {}", c, cdest, ns.mapping
)
print('"{}" "{}"'.format(c, cdest), file=map_file)
if ns.zip:
log_debug("Zip {} into {}", c, ns.zip)
zip_file.write(c, str(cdest))
Expand All @@ -478,8 +456,6 @@ def copy_files(files, ns):
write_catalog(ns.catalog, in_catalog)

finally:
if map_file:
map_file.close()
if zip_file:
zip_file.close()

Expand Down Expand Up @@ -512,13 +488,6 @@ def main():
type=Path,
default=None,
)
parser.add_argument(
"--mapping",
metavar="file",
help="The file to write mapping information to",
type=Path,
default=None,
)
parser.add_argument(
"--zip",
metavar="file",
Expand Down Expand Up @@ -599,8 +568,6 @@ def main():

if ns.copy and not ns.copy.is_absolute():
ns.copy = (Path.cwd() / ns.copy).resolve()
if ns.mapping and not ns.mapping.is_absolute():
ns.mapping = (Path.cwd() / ns.mapping).resolve()
if ns.zip and not ns.zip.is_absolute():
ns.zip = (Path.cwd() / ns.zip).resolve()
if ns.catalog and not ns.catalog.is_absolute():
Expand All @@ -615,7 +582,6 @@ def main():
Temp: {ns.temp}

Copy to: {ns.copy}
Mapping: {ns.mapping}
Zip to: {ns.zip}
Catalog: {ns.catalog}""",
ns=ns,
Expand Down
47 changes: 42 additions & 5 deletions PC/layout/support/appxmanifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,37 @@ def public(f):
</Package>"""


RESOURCES_XML_TEMPLATE = r"""<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--This file is input for makepri.exe. It should be excluded from the final package.-->
<resources targetOsVersion="10.0.0" majorVersion="1">
<packaging>
<autoResourcePackage qualifier="Language"/>
<autoResourcePackage qualifier="Scale"/>
<autoResourcePackage qualifier="DXFeatureLevel"/>
</packaging>
<index root="\" startIndexAt="\">
<default>
<qualifier name="Language" value="en-US"/>
<qualifier name="Contrast" value="standard"/>
<qualifier name="Scale" value="100"/>
<qualifier name="HomeRegion" value="001"/>
<qualifier name="TargetSize" value="256"/>
<qualifier name="LayoutDirection" value="LTR"/>
<qualifier name="Theme" value="dark"/>
<qualifier name="AlternateForm" value=""/>
<qualifier name="DXFeatureLevel" value="DX9"/>
<qualifier name="Configuration" value=""/>
<qualifier name="DeviceFamily" value="Universal"/>
<qualifier name="Custom" value=""/>
</default>
<indexer-config type="folder" foldernameAsQualifier="true" filenameAsQualifier="true" qualifierDelimiter="$"/>
<indexer-config type="resw" convertDotsToSlashes="true" initialPath=""/>
<indexer-config type="resjson" initialPath=""/>
<indexer-config type="PRI"/>
</index>
</resources>"""


SCCD_FILENAME = "PC/classicAppCompat.sccd"

REGISTRY = {
Expand Down Expand Up @@ -215,17 +246,18 @@ def get_appx_layout(ns):
return

yield "AppxManifest.xml", ns.temp / "AppxManifest.xml"
yield "_resources.xml", ns.temp / "_resources.xml"
icons = ns.source / "PC" / "icons"
yield "_resources/pythonx44.png", icons / "pythonx44.png"
yield "_resources/pythonx44.png.targetsize-44_altform-unplated", icons / "pythonx44.png"
yield "_resources/pythonx44$targetsize-44_altform-unplated.png", icons / "pythonx44.png"
yield "_resources/pythonx50.png", icons / "pythonx50.png"
yield "_resources/pythonx50.png.targetsize-50_altform-unplated", icons / "pythonx50.png"
yield "_resources/pythonx50$targetsize-50_altform-unplated.png", icons / "pythonx50.png"
yield "_resources/pythonx150.png", icons / "pythonx150.png"
yield "_resources/pythonx150.png.targetsize-150_altform-unplated", icons / "pythonx150.png"
yield "_resources/pythonx150$targetsize-150_altform-unplated.png", icons / "pythonx150.png"
yield "_resources/pythonwx44.png", icons / "pythonwx44.png"
yield "_resources/pythonwx44.png.targetsize-44_altform-unplated", icons / "pythonwx44.png"
yield "_resources/pythonwx44$targetsize-44_altform-unplated.png", icons / "pythonwx44.png"
yield "_resources/pythonwx150.png", icons / "pythonwx150.png"
yield "_resources/pythonwx150.png.targetsize-150_altform-unplated", icons / "pythonwx150.png"
yield "_resources/pythonwx150$targetsize-150_altform-unplated.png", icons / "pythonwx150.png"
sccd = ns.source / SCCD_FILENAME
if sccd.is_file():
# This should only be set for side-loading purposes.
Expand Down Expand Up @@ -448,3 +480,8 @@ def get_appxmanifest(ns):
buffer = io.BytesIO()
xml.write(buffer, encoding="utf-8", xml_declaration=True)
return buffer.getbuffer()


@public
def get_resources_xml(ns):
return RESOURCES_XML_TEMPLATE.encode("utf-8")
31 changes: 25 additions & 6 deletions Tools/msi/make_appx.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
The SHA1 hash of the certificate to sign with (optional).
#>
param(
[Parameter(Mandatory=$true)][string]$mapfile,
[Parameter(Mandatory=$true)][string]$layout,
[Parameter(Mandatory=$true)][string]$msix,
[switch]$sign,
[string]$description,
Expand All @@ -31,14 +31,33 @@ $tools = $script:MyInvocation.MyCommand.Path | Split-Path -parent;
Import-Module $tools\sdktools.psm1 -WarningAction SilentlyContinue -Force

Set-Alias makeappx (Find-Tool "makeappx.exe") -Scope Script
Set-Alias makepri (Find-Tool "makepri.exe") -Scope Script

$msixdir = ($msix | Split-Path -parent);
$msixdir = Split-Path $msix -Parent
if ($msixdir) {
mkdir -Force $msixdir;
$msixdir = (mkdir -Force $msixdir).FullName
} else {
$msixdir = Get-Location
}
makeappx pack /f $mapfile /o /p $msix
if (-not $?) {
throw "makeappx step failed"
$msix = Join-Path $msixdir (Split-Path $msix -Leaf)

pushd $layout
try {
if (Test-Path resources.pri) {
del resources.pri
}
makepri new /pr . /mn AppxManifest.xml /cf _resources.xml /of _resources.pri /mf appx /o
if (-not $? -or -not (Test-Path _resources.map.txt)) {
throw "makepri step failed"
}
$lines = gc _resources.map.txt
$lines | ?{ -not ($_ -match '"_resources[\w\.]+?"') } | Out-File _resources.map.txt -Encoding utf8
makeappx pack /f _resources.map.txt /m AppxManifest.xml /o /p $msix
if (-not $?) {
throw "makeappx step failed"
}
} finally {
popd
}

if ($sign) {
Expand Down