Distribution through the Microsoft Store

I’m trying to improve the developer experience on Windows, where a big pain point is not having a proper repository of applications. Vcpkg is awesome when it comes to library dependencies, but is not the preferred way to build/distribute end user applications.

The Microsoft Store is readily available, auto-updates packages and might be the best way to distribute tools for those who want to always ride the latest stable of everything. As far as CMake is concerned I usually rely on CMake bundled with the Visual C++ Build Tools installer, however they do lag a few months behind.

I was wondering if CMake could distribute itself via the Microsoft Store. I recently gave the MSIX Packaging Tool a spin after reading up a bit on MSIX. (The MISX-Labs have some useful materials to digest) I ran the CMake installer through the package converter, and after getting the signature right (mind where you install the self-signed certificate) but it only runs the cmake-gui.exe, because that I run from my graphical shell “from the Start Menu”. The console parts presumably run too from there, but I can’t provide flags by clicking. Invoking them from the command-line result in

PS C:\Users\mnagy> & 'C:\Program Files\WindowsApps\CMake_3.16.0.0_x64__phh279nh44mjt\VFS\ProgramFilesX64\CMake\bin\cmake.exe'
ResourceUnavailable: Program 'cmake.exe' failed to run: A hozzáférés megtagadva.At line:1 char:1
+ & 'C:\Program Files\WindowsApps\CMake_3.16.0.0_x64__phh279nh44mjt\VFS …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.

Because they are not UWP console applications they don’t appear under users AppData for WindowsApps:

PS C:\Users\mnagy> gci C:\Users\mnagy\AppData\Local\Microsoft\WindowsApps\


    Directory: C:\Users\mnagy\AppData\Local\Microsoft\WindowsApps

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d----       2019. 11. 06.    20:49                25510Hereafter2.4487AB454A81_j2gmvb2kv935w
d----       2019. 12. 03.     9:36                91750D7E.Slack_8she8kybcnzg4
d----       2019. 12. 03.     9:36                Backup
d----       2019. 08. 08.    17:01                CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc
d----       2019. 11. 30.    23:57                ChoungNetworksUS.X410_vvzc8y2tzcnsr
d----       2019. 11. 06.    20:51                Microsoft.DesktopAppInstaller_8wekyb3d8bbwe
d----       2019. 11. 14.    10:08                Microsoft.MicrosoftEdge_8wekyb3d8bbwe
d----       2019. 11. 27.    13:51                Microsoft.MsixPackagingTool_8wekyb3d8bbwe
d----       2019. 10. 29.    22:41                Microsoft.PowerShellPreview_8wekyb3d8bbwe
d----       2019. 11. 27.    13:51                Microsoft.WindowsTerminal_8wekyb3d8bbwe
d----       2019. 11. 22.    10:14                Microsoft.XboxGamingOverlay_8wekyb3d8bbwe
d----       2019. 10. 22.    21:00                PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0
la---       2019. 11. 06.    20:49              0 Cowsay.exe -> C:\Program Files\WindowsApps\25510Hereafter2.4487AB454A81_1.2.209.0_x64__j2gmvb2kv935w\Cowsay.CLI.exe
la---       2019. 11. 22.    10:14              0 GameBarElevatedFT_Alias.exe -> C:\Program Files\WindowsApps\Microsoft.XboxGamingOverlay_3.35.14003.0_x64__8wekyb3d8bbwe\GameBarElevatedFT.exe
la---       2019. 10. 22.    21:00              0 idle.exe -> C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1520.0_x64__qbz5n2kfra8p0\idle.exe
la---       2019. 10. 22.    21:00              0 idle3.7.exe -> C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1520.0_x64__qbz5n2kfra8p0\idle.exe
la---       2019. 10. 22.    21:00              0 idle3.exe -> C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1520.0_x64__qbz5n2kfra8p0\idle.exe
la---       2019. 11. 14.    10:08              0 MicrosoftEdge.exe -> C:\Windows\system32\SystemUWPLauncher.exe
la---       2019. 11. 27.    13:51              0 MsixPackagingTool.exe -> C:\Program Files\WindowsApps\Microsoft.MsixPackagingTool_1.2019.1018.0_x64__8wekyb3d8bbwe\MsixPackagingToolCLI.exe
la---       2019. 11. 27.    13:51              0 MsixPackagingToolUI.exe -> C:\Program Files\WindowsApps\Microsoft.MsixPackagingTool_1.2019.1018.0_x64__8wekyb3d8bbwe\MsixPackageTool.exe
la---       2019. 10. 22.    21:00              0 pip.exe -> C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1520.0_x64__qbz5n2kfra8p0\pip.exe
la---       2019. 10. 22.    21:00              0 pip3.7.exe -> C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1520.0_x64__qbz5n2kfra8p0\pip.exe
la---       2019. 10. 22.    21:00              0 pip3.exe -> C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1520.0_x64__qbz5n2kfra8p0\pip.exe
la---       2019. 10. 29.    22:41              0 pwsh.exe -> C:\Program Files\WindowsApps\Microsoft.PowerShellPreview_7.0.5.0_x64__8wekyb3d8bbwe\pwsh.exe
la---       2019. 10. 22.    21:00              0 python.exe -> C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1520.0_x64__qbz5n2kfra8p0\python.exe
la---       2019. 10. 22.    21:00              0 python3.7.exe -> C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1520.0_x64__qbz5n2kfra8p0\python.exe
la---       2019. 10. 22.    21:00              0 python3.exe -> C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1520.0_x64__qbz5n2kfra8p0\python.exe
la---       2019. 10. 22.    21:00              0 pythonw.exe -> C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1520.0_x64__qbz5n2kfra8p0\pythonw.exe
la---       2019. 10. 22.    21:00              0 pythonw3.7.exe -> C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1520.0_x64__qbz5n2kfra8p0\pythonw.exe
la---       2019. 10. 22.    21:00              0 pythonw3.exe -> C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1520.0_x64__qbz5n2kfra8p0\pythonw.exe
la---       2019. 12. 03.     9:36              0 Slack.exe -> C:\Program Files\WindowsApps\91750D7E.Slack_4.1.2.0_x64__8she8kybcnzg4\app\Slack.exe
la---       2019. 08. 08.    17:01              0 ubuntu1804.exe -> C:\Program Files\WindowsApps\CanonicalGroupLimited.Ubuntu18.04onWindows_1804.2019.522.0_x64__79rhkp1fndgsc\ubuntu1804.exe
la---       2019. 11. 27.    13:51              0 wt.exe -> C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_0.7.3291.0_x64__8wekyb3d8bbwe\WindowsTerminal.exe
la---       2019. 11. 30.    23:57              0 x410.exe -> C:\Program Files\WindowsApps\ChoungNetworksUS.X410_2.8.2.0_x64__vvzc8y2tzcnsr\X410\X410.exe

I don’t fully understand the process of how apps are launched from here. Python installed from the Store is registered here. I’ve never used CMake to develop apps for Windows Phone per say, but I would contribute to packaging useful things into the Microsoft Store, not just Cowsay.exe. CMake and Neovim are high on my list.

Are there any features missing to make this happen?

I (finally) managed to convert the MSI package to a functioning MSIX package, so in theory it should be able to deploy from the Microsoft Store (auto-update and all that jazz). Initial testing shows that running it from the command-line works, the console entry points are all “on the PATH”/visible.

PS C:\Users\mnagy> cmake.exe --version
cmake version 3.16.0

CMake suite maintained and supported by Kitware (kitware.com/cmake).
PS C:\Users\mnagy> gcm cmake.exe

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Application     cmake.exe                                          0.0.0.0    C:\Users\mnagy\AppData\Local\Microsoft\WindowsApps\cmake.exe

PS C:\Users\mnagy> gci C:\Users\mnagy\AppData\Local\Microsoft\WindowsApps\cmake.exe


    Directory: C:\Users\mnagy\AppData\Local\Microsoft\WindowsApps

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
la---       2019. 12. 09.    10:16              0 cmake.exe -> C:\Program Files\WindowsApps\CMake_3.16.1.0_x64__phh279nh44mjt\VFS\ProgramFilesX64\CMake\bin\cmake.exe

As a result Visual Studio Code is able to use it with the default configuration of CMake Tools as well:

@brad.king if there’s interest in upping the game on distribution on Windows, I can provide steps to reproduce the packaging. I went the GUI way, but I believe it can be automated as well. I’ve not done submissions to the Microsoft Store yet, but I’m told one can test it out via private invites to submissions (via MS account) before going public. I may try to see if it works even when downloaded from the store but others surely know more of this than me.

@MathiasMagnus thanks for investigating this. I’m not sure we can commit to providing or maintaining distribution through the MS Store, but if you can post steps for a scripted way to do it that would at least help us understand it.