13 lines
877 B
PowerShell
13 lines
877 B
PowerShell
# Run explicitly in an elevated PowerShell. Trusts only the FileBow development certificate.
|
|
[CmdletBinding()]param()
|
|
$ErrorActionPreference='Stop'
|
|
. (Join-Path $PSScriptRoot 'hash-file.ps1')
|
|
$root=[IO.Path]::GetFullPath((Join-Path $PSScriptRoot '..'))
|
|
$record=Get-Content (Join-Path $root 'out\msix\build-Development.json') -Raw | ConvertFrom-Json
|
|
if (-not $record.Signed) { throw 'Zuerst build-msix.ps1 -SignDevelopment ausführen.' }
|
|
if ((Get-FileBowSha256 $record.Package) -ne $record.SHA256) { throw 'Paket-Prüfsumme stimmt nicht überein.' }
|
|
$cert=[Security.Cryptography.X509Certificates.X509Certificate2]::new($record.Certificate)
|
|
if ($cert.Subject -ne 'CN=FileBow Development') { throw 'Unerwartetes Zertifikat.' }
|
|
Import-Certificate -FilePath $record.Certificate -CertStoreLocation Cert:\LocalMachine\TrustedPeople | Out-Null
|
|
Add-AppxPackage -Path $record.Package
|