Files @ r27836:e1c1dfbccca2
Branch filter:

Location: cpp/openttd-patchpack/source/os/windows/winstore/prepare-manifests.ps1

Patric Stout
Fix: [CI] Allow release-flow to run in forks (while skipping survey-key) (#11241)
[CmdletBinding()]
[Alias()]
Param
(
    # Output folder
    [Parameter(Mandatory=$true, Position=0)]
    $OutputFolder,

    # Publisher ("CN=xyz")
    [Parameter(Mandatory=$true, Position=1)]
    $Publisher,

    # IdentityName
    [Parameter(Mandatory=$true, Position=2)]
    $IdentityName,

    # Version
    [Parameter(Mandatory=$true, Position=3)]
    $AppVersion
)

function Prepare-Manifest {
    param (
        $Architecture
    )

    (Get-Content "$($PSScriptRoot)\manifests\Package.appxmanifest").replace('$PUBLISHER$', $Publisher).replace('$IDENTITY_NAME$', $IdentityName).replace('$VERSION$', $AppVersion).replace('$ARCHITECTURE$', $Architecture) | Set-Content "$($OutputFolder)\Package-$($Architecture).appxmanifest"
}

# Prepare the application binary manifests
Prepare-Manifest x86
Prepare-Manifest x64
Prepare-Manifest arm64

# Prepare the assets package manifest
(Get-Content "$($PSScriptRoot)\manifests\AssetsPackage.appxmanifest").replace('$PUBLISHER$', $Publisher).replace('$IDENTITY_NAME$', $IdentityName).replace('$VERSION$', $AppVersion) | Set-Content "$($OutputFolder)\AssetsPackage.appxmanifest"

# Prepare the overall package manifest
(Get-Content "$($PSScriptRoot)\manifests\Package.appxmanifest").replace('$PUBLISHER$', $Publisher).replace('$IDENTITY_NAME$', $IdentityName).replace('$VERSION$', $AppVersion).replace(' ProcessorArchitecture="$ARCHITECTURE$"', '') | Set-Content "$($OutputFolder)\Package.appxmanifest"

# Copy the PackagingLayout XML file
(Get-Content "$($PSScriptRoot)\manifests\PackagingLayout.xml") | Set-Content "$($OutputFolder)\PackagingLayout.xml"