[Bf-blender-cvs] [6c9c4790484] blender-v2.83-release: Windows Release: Script creation of MSIX package

Nathan Letwory noreply at git.blender.org
Wed Oct 7 10:23:19 CEST 2020


Commit: 6c9c47904841d729d27393851133dc2764184960
Author: Nathan Letwory
Date:   Wed Sep 23 11:19:49 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rB6c9c47904841d729d27393851133dc2764184960

Windows Release: Script creation of MSIX package

Script create_msix_package.py will download the ZIP file
from the given URL. It will create the MSIX package
with the version number and publisher ID given.

Strongly recommended are the path to a valid PFX file, and the
password to use that PFX file. These are needed for signing
the resulting MSIX package. The signing step is optional though,
but the resulting MSIX package cannot be installed outside of the
Microsoft Store

Example

set VERSION=2.83.2.0
set URL=https://download.blender.org/release/Blender2.83/blender-2.83.2-windows64.zip
set PUBID=CN=PUBIDHERE
set PFX=X:\path\to\cert.pfx
set PFXPW=pwhere

python create_msix_package.py --version %VERSION% --url %URL% --publisher %PUBID% --pfx %PFX% --password %PFXPW%

Requirements:
* Python default from the Microsoft Store should do (3.8)
* requests can be installed with `pip install requests`

Note that for an LTS release that gets uploaded to its own LTS application release
in the store you need to specify the `--lts` switch on the command-line to the script.

Upon completion there will be a file with the
name blender-2.83.2.0-windows64.msix. In case PFX file and its password were
given on the command line MSIX package will also be signed for the Microsoft Store.

Related Wiki page: https://wiki.blender.org/wiki/Process/Release_On_Windows_Store

Reviewed By: jbakker

Maniphest Tasks: T77348, T79356

Differential Revision: https://developer.blender.org/D8310

===================================================================

A	release/windows/msix/AppxManifest.xml.template
A	release/windows/msix/Assets/Square150x150Logo.png
A	release/windows/msix/Assets/Square310x310Logo.png
A	release/windows/msix/Assets/Square44x44Logo.png
A	release/windows/msix/Assets/Square71x71Logo.png
A	release/windows/msix/Assets/StoreLogo.png
A	release/windows/msix/Assets/Wide310x150Logo.png
A	release/windows/msix/README.md
A	release/windows/msix/create_msix_package.py

===================================================================

diff --git a/release/windows/msix/AppxManifest.xml.template b/release/windows/msix/AppxManifest.xml.template
new file mode 100644
index 00000000000..9289a67efef
--- /dev/null
+++ b/release/windows/msix/AppxManifest.xml.template
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:uap2="http://schemas.microsoft.com/appx/manifest/uap/windows10/2" xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3" xmlns:uap4="http://schemas.microsoft.com/appx/manifest/uap/windows10/4" xmlns:uap6="http://schemas.microsoft.com/appx/manifest/uap/windows10/6" xmlns:uap7="http://schemas.microsoft.com/appx/manifest [...]
+  <Identity Name="BlenderFoundation.Blender[PACKAGETYPE]" Publisher="[PUBLISHER]" Version="[VERSION]" ProcessorArchitecture="x64" />
+  <Properties>
+    <DisplayName>Blender[LTSORNOT]</DisplayName>
+    <PublisherDisplayName>Blender Foundation</PublisherDisplayName>
+    <Description>Blender [VERSION] is the Free and Open Source 3D creation suite</Description>
+    <Logo>Assets\StoreLogo.png</Logo>
+  </Properties>
+  <Resources>
+    <Resource Language="en-us" />
+  </Resources>
+  <Dependencies>
+    <TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.18335.0" />
+  </Dependencies>
+  <Capabilities>
+    <rescap:Capability Name="runFullTrust" />
+  </Capabilities>
+  <Applications>
+    <Application Id="BLENDER" Executable="Blender\blender.exe" EntryPoint="Windows.FullTrustApplication">
+      <uap:VisualElements
+          BackgroundColor="transparent"
+          DisplayName="Blender [VERSION]"
+          Square150x150Logo="Assets\Square150x150Logo.png"
+          Square44x44Logo="Assets\Square44x44Logo.png"
+          Description="Blender is the Free and Open Source 3D creation suite"
+      >
+        <uap:DefaultTile
+            Wide310x150Logo="Assets\Wide310x150Logo.png"
+            Square310x310Logo="Assets\Square310x310Logo.png"
+            Square71x71Logo="Assets\Square71x71Logo.png"
+            ShortName="Blender [VERSION]"
+        >
+          <uap:ShowNameOnTiles>
+              <uap:ShowOn Tile="square150x150Logo"/> <!-- Show app name on the 150x150 tile -->
+              <uap:ShowOn Tile="wide310x150Logo"/> <!-- …and also on the 310x150 tile -->
+              <uap:ShowOn Tile="square310x310Logo"/> <!-- …and also on the 310x150 tile -->
+          </uap:ShowNameOnTiles>
+        </uap:DefaultTile>
+      </uap:VisualElements>
+      <Extensions>
+        <uap3:Extension Category="windows.fileTypeAssociation">
+          <uap3:FileTypeAssociation Name="blend">
+            <uap:SupportedFileTypes>
+              <uap:FileType>.blend</uap:FileType>
+            </uap:SupportedFileTypes>
+            <uap2:SupportedVerbs>
+              <uap3:Verb Id="open" Parameters=""%1"">open</uap3:Verb>
+            </uap2:SupportedVerbs>
+          </uap3:FileTypeAssociation>
+        </uap3:Extension>
+        <uap3:Extension Category="windows.appExecutionAlias" Executable="Blender\blender.exe" EntryPoint="Windows.FullTrustApplication">
+          <uap3:AppExecutionAlias>
+            <desktop:ExecutionAlias Alias="blender.exe" />
+          </uap3:AppExecutionAlias>
+        </uap3:Extension>
+      </Extensions>
+    </Application>
+  </Applications>
+</Package>
diff --git a/release/windows/msix/Assets/Square150x150Logo.png b/release/windows/msix/Assets/Square150x150Logo.png
new file mode 100644
index 00000000000..7dbbde793ba
Binary files /dev/null and b/release/windows/msix/Assets/Square150x150Logo.png differ
diff --git a/release/windows/msix/Assets/Square310x310Logo.png b/release/windows/msix/Assets/Square310x310Logo.png
new file mode 100644
index 00000000000..2190415e35b
Binary files /dev/null and b/release/windows/msix/Assets/Square310x310Logo.png differ
diff --git a/release/windows/msix/Assets/Square44x44Logo.png b/release/windows/msix/Assets/Square44x44Logo.png
new file mode 100644
index 00000000000..7b9ca070558
Binary files /dev/null and b/release/windows/msix/Assets/Square44x44Logo.png differ
diff --git a/release/windows/msix/Assets/Square71x71Logo.png b/release/windows/msix/Assets/Square71x71Logo.png
new file mode 100644
index 00000000000..75bd9bb264a
Binary files /dev/null and b/release/windows/msix/Assets/Square71x71Logo.png differ
diff --git a/release/windows/msix/Assets/StoreLogo.png b/release/windows/msix/Assets/StoreLogo.png
new file mode 100644
index 00000000000..e8a671b7e0f
Binary files /dev/null and b/release/windows/msix/Assets/StoreLogo.png differ
diff --git a/release/windows/msix/Assets/Wide310x150Logo.png b/release/windows/msix/Assets/Wide310x150Logo.png
new file mode 100644
index 00000000000..59f5736393a
Binary files /dev/null and b/release/windows/msix/Assets/Wide310x150Logo.png differ
diff --git a/release/windows/msix/README.md b/release/windows/msix/README.md
new file mode 100644
index 00000000000..8967a655e3d
--- /dev/null
+++ b/release/windows/msix/README.md
@@ -0,0 +1,81 @@
+create_msix_package
+===================
+
+This tool is used to create MSIX packages from a given ZiP archive. The MSIX
+package is distributed mainly through the Microsoft Store. It can also be
+installed when downloaded from blender.org. For that to work the MSIX package
+needs to be signed.
+
+Requirements
+============
+
+* MakeAppX - this tool is distributed with Windows 10 SDK
+* SignTool - this tool is also distributed with Windows 10 SDK
+* Python 3 (3.7 or later tested) - to run the create_msix_package.py script
+* requests module - can be installed with `pip install requests`
+* PFX file (optional, but strongly recommended) - for signing the resulting MSIX
+  package. **NOTE:** If the MSIX package is not signed when uploaded to the Microsoft
+  store the validation and certification process can take up to three full
+  business day.
+
+Usage
+=====
+
+On the command-line:
+```batch
+set VERSION=2.83.4.0
+set URL=https://download.blender.org/release/Blender2.83/blender-2.83.4-windows64.zip
+set PUBID=CN=PUBIDHERE
+set PFX=X:\path\to\cert.pfx
+set PFXPW=pwhere
+
+python create_msix_package.py --version %VERSION% --url %URL% --publisher %PUBID% --pfx %PFX% --password %PFXPW%
+```
+
+Result will be a MSIX package with the name `blender-2.83.4-windows64.msix`.
+With the above usage it will be signed. If the signing options are left out the
+package will not be signed.
+
+Optional arguments
+==================
+
+In support of testing and developing the manifest and scripts there are a few
+optional arguments:
+
+* `--skipdl` : If a `blender.zip` is available already next to the tool use this
+  to skip actual downloading of the archive designated by `--url`. The latter
+  option is still required
+* `--overwrite` : When script fails the final clean-up may be incomplete leaving
+  the `Content` folder with its structure. Specify this argument to automatically
+  clean up this folder before starting to seed the `Content` folder
+* `--leavezip` : When specified leave the `blender.zip` file while cleaning up
+  all other intermediate files, including the `Content` folder. This is useful
+  to not have to re-download the same archive from `--url` on each usage
+
+
+What it does
+============
+
+The tool creates in the directory it lives a subfolder called `Content`. This is
+where all necessary files are placed.
+
+The `Assets` folder is copied to the `Content` folder.
+
+From the application manifest template a version with necessary parts replaced as
+their actual values as specified on the command-line is realized. This manifest controls the packaging of Blender into the MSIX format.
+
+Next the tool downloads the designated ZIP archive locally as blender.zip. From
+this archive the files are extracted into the `Content\Blender` folder, but skip
+the leading part of paths in the ZIP. We want to write the files to the
+content_blender_folder where blender.exe ends up as
+`Content\Blender\blender.exe`, and not
+`Content\Blender\blender-2.83.4-windows64\blender.exe`
+
+Once the extraction is completed the MakeAppX tool is executed with the `Content`
+folder as input. The result will be the MSIX package with the name in the form
+`blender-X.YY.Z-windows64.msix`.
+
+If the PFX file and its password are given on the command-line this MSIX package
+will be signed.
+
+All intermediate files and directories will be removed.
diff --git a/release/windows/msix/create_msix_package.py b/release/windows/msix/create_msix_package.py
new file mode 100644
index 00000000000..69b0a2ef901
--- /dev/null
+++ b/release/windows/msix/create_msix_package.py
@@ -0,0 +1,135 @@
+#!/usr/bin/env python3
+
+import argparse
+import os
+import pathlib
+import requests
+import shutil
+import subprocess
+import zipfile
+
+parser = argparse.ArgumentParser()
+parser.add_argument("--version", required=True, help="Version string in the form of 2.83.3.0")
+parser.add_argu

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list