aboutsummaryrefslogtreecommitdiffstats
path: root/coin/provisioning/common/windows/exceutequeueditems.ps1
blob: 0d6a7267a5bb2047569a5d7e7b977e423fb53939 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Copyright (C) 2018 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
. "$PSScriptRoot\helpers.ps1"

function ngen() {
    Param (
        [ValidateSet("Framework","Framework64","FrameworkArm64")][string]$framework
    )
    Start-Process -NoNewWindow -FilePath "C:\WINDOWS\Microsoft.NET\$framework\v4.0.30319\ngen.exe" -ArgumentList ExecuteQueuedItems -Wait
}

$cpu_arch = Get-CpuArchitecture
switch ($cpu_arch) {
    arm64 {
        ngen("FrameworkArm64")
        Break
    }
    x64 {
        ngen("Framework")
        ngen("Framework64")
        Break
    }
    x86 {
        ngen("Framework")
        Break
    }
    default {
        throw "Unknown architecture $cpu_arch"
    }
}