How to create a Windows 8.1 Store app (appxupload) in PowerShell?

Usually, when I want to create a Windows 8.1 or Windows Phone 8.1 application for the Store, I open Visual Studio 2015 and in the Solution Explorer start SaveCreate application packages. master.

I would like to produce identical signed .appxupload packages using PowerShell , ideally providing the target project file, target platform (s), build configuration, and version number.

There is a page for packaging and deployment , but I just don't know what the correct order of commands is. There should be a simple solution to this standard task, right? Note. I installed Windows 10 and Visual Studio 2015 Pro, so all the prerequisites should be there.

And the bonus question, is it possible to run the Windows Certification Kit on this created package, as well as in PowerShell?
Thanks

+1
source share
2 answers

After digging the log, I myself found the answer.
After linking the project to the Store and creating the application for the store using the Wizard and saving all the changes, you can create a repository package that again calls "msbuild" with the project / solution in the parameter.

I described it in detail here:
https://www.suchan.cz/2015/09/building-windows-store-appxupload-packages-using-powershell/

+1
source

These commands work with VS2013 on the W8.1 machine and in the W8.1 project. I have not been able to test them with VS2015 / W10 yet. I believe that they should work if the W8.1 SDK is installed.

"C:\Program Files (x86)\Windows Kits\8.1\bin\x86\makeappx.exe" pack /d "<BinDirOfProject>" /p "<BindirOfProject>\output\project.appx" /l "C:\Program Files (x86)\Windows Kits\8.1\bin\x86\makecert.exe" /n "CN=tom" /r /h 0 /eku "1.3.6.1.5.5.7.3.3,1.3.6.1.4.1.311.10.3.13" /e "01/01/2020" /sv "<BinDirOfProject>\output\key.pvk" "<BinDirOfProject>\output\key.cer" "C:\Program Files (x86)\Windows Kits\8.1\bin\x86\pvk2pfx.exe" /pvk "<BinDirOfProject>\output\key.pvk" /pi "<Pwd>" /spc "<BinDirOfProject>\output\key.cer" /pfx "<BinDirOfProject>\output\key.pfx" "C:\Program Files (x86)\Windows Kits\8.1\bin\x86\signtool.exe" sign /fd SHA256 /a /f "<BinDirOfProject>\output\key.pfx" /p "<Pwd>" "<BinDirOfProject>\output\project.appx" certutil -addStore TrustedPeople "<BinDirOfProject>\output\key.cer" 

When creating a certificate, you will be prompted to enter a private key batch (makecert.exe, you can use an existing certificate). <Pwd> is your private key for this certificate.

0
source

All Articles