microsoft / WSL-DistroLauncher

Sample/reference launcher app for WSL distro Microsoft Store packages.
MIT License
1.68k stars 518 forks source link

error APPX0107: The certificate specified is not valid for signing #29

Closed sjenning closed 6 years ago

sjenning commented 6 years ago

There once was a pkg.bat that handled the creation of the signing key. I can't find anything about cert generation in the in README.

Output of build:

       "C:\Users\wsl\Desktop\WSL-DistroLauncher\DistroLauncher.sln" (Build target) (1) ->
       "C:\Users\wsl\Desktop\WSL-DistroLauncher\DistroLauncher-Appx\DistroLauncher-Appx.vcxproj.metaproj" (default targ
       et) (3) ->
       "C:\Users\wsl\Desktop\WSL-DistroLauncher\DistroLauncher-Appx\DistroLauncher-Appx.vcxproj" (default target) (4) -
       >
       (_CreateMainPackage target) ->
         C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage
       \Microsoft.AppXPackage.Targets(3786,5): error APPX0104: Certificate file 'DistroLauncher-Appx_TemporaryKey.pfx'
       not found. [C:\Users\wsl\Desktop\WSL-DistroLauncher\DistroLauncher-Appx\DistroLauncher-Appx.vcxproj]
         C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage
       \Microsoft.AppXPackage.Targets(3786,5): error APPX0107: The certificate specified is not valid for signing. For
       more information about valid certificates, see http://go.microsoft.com/fwlink/?LinkID=241478. [C:\Users\wsl\Desk
       top\WSL-DistroLauncher\DistroLauncher-Appx\DistroLauncher-Appx.vcxproj]

This is just after cloning the repo and putting in an install.tar.gz, without changing any of the MyDistro placeholders.

kirkone commented 6 years ago

Hi,

the problem is that the file DistroLauncher-Appx_TemporaryKey.pfx is not part of this repo. You can fix this by creating your own .pfx as shown here: Create a certificate for package signing

Or the easy way: create a new solution in Visual Studio from "Windows Universal App" and than copy and rename the .pfx file to the DistroLauncher-Appx folder.

I hope this helps. CU KirK

EDIT: Maybe it is possible to change the .gitignore to exclude this file from the general .pfx exclusion

benhillis commented 6 years ago

Good call, I'll update the documentation. In the meantime here's how to generate a test certificate:

Open MyDistro.appx, select the Packaging tab, select Choose Certificate, click the Configure Certificate drop down and select Create test certificate.

kirkone commented 6 years ago

@benhillis That is much easier 😄

sjenning commented 6 years ago

Thanks! I'll give this a try this evening and close if I succeed.

benhillis commented 6 years ago

@sjenning - Sounds good, thanks for the feedback.