MSIX: minor cleanup, add certificate generation script

This commit is contained in:
yuyoyuppe
2019-12-20 19:12:52 +03:00
committed by yuyoyuppe
parent 62c65659cc
commit a321eb8737
7 changed files with 21 additions and 17 deletions

View File

@@ -1,7 +1,7 @@
<PackagingLayout xmlns="http://schemas.microsoft.com/appx/makeappx/2017">
<PackageFamily ID="PowerToys" FlatBundle="true" ManifestPath="appxmanifest.xml" ResourceManager="false">
<Package ID="x64" ProcessorArchitecture="x64">
<Package ID="PowerToys-x64" ProcessorArchitecture="x64">
<Files>
<File DestinationPath="License.rtf" SourcePath="..\..\License.rtf"/>

View File

@@ -0,0 +1,5 @@
$expirationDate = {Get-Date}.Invoke().AddYears(5)
$pass = ConvertTo-SecureString -String "12345" -Force -AsPlainText
$thumbprint = (New-SelfSignedCertificate -notafter $expirationDate -Type CodeSigningCert -Subject "CN=Microsoft Corporation" -FriendlyName "PowerToys Test Certificate" -KeyDescription "PowerToys Test Certificate" -KeyFriendlyName "PowerToys Test Key" -KeyUsage "DigitalSignature" -CertStoreLocation Cert:\LocalMachine\My).Thumbprint
Export-PfxCertificate -Cert cert:\LocalMachine\My\$thumbprint -FilePath PowerToys_TemporaryKey.pfx -Password $pass
Import-PfxCertificate -CertStoreLocation Cert:\LocalMachine\Root -FilePath PowerToys_TemporaryKey.pfx -Password $pass

View File

@@ -0,0 +1,6 @@
taskkill /f /im explorer.exe
Get-AppxPackage -Name 'PowerToys' | select -ExpandProperty "PackageFullName" | Remove-AppxPackage
makeappx build /v /overwrite /f PackagingLayout.xml /id "PowerToys-x64" /op bin\
signtool sign /debug /a /fd SHA256 /f PowerToys_TemporaryKey.pfx /p 12345 bin\PowerToys-x64.msix
Add-AppxPackage .\bin\PowerToys-x64.msix
start $Env:windir\explorer.exe

View File

@@ -1,7 +0,0 @@
$name='PowerToys'
taskkill /f /im explorer.exe
Get-AppxPackage -Name $name | select -ExpandProperty "PackageFullName" | Remove-AppxPackage
makeappx build /v /overwrite /f PackagingLayout.xml /id "x64" /op bin\
signtool sign /debug /a /fd SHA256 /f PowerToysTestKey.pfx /p 12345 bin\x64.msix
Add-AppxPackage .\bin\x64.msix
start $Env:windir\explorer.exe