You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# this is an native x86 exe or a .net x86 that requires of prefers 32bit
38
+
$platform=if ($corFlagsOutput-like"*does not have a valid managed header*"-or$corFlagsOutput-like"*32BITREQ : 1*"-or$corFlagsOutput-like"*32BITPREF : 1*") {
39
+
# this is an native x86 exe or a .net x86 that requires of prefers 32bit
40
+
"x86" } else {
41
+
# this is a x86 executable that is built as AnyCpu and does not prefer 32-bit so it will run as x64 on 64-bit system.
42
+
"x86-64" }
43
+
}
44
+
45
+
if (($pair=$exclusions.GetEnumerator() |Where-Object { $fullName-like"*$($_.Name)" })) {
46
+
if (1-lt$($pair).Count) {
47
+
$err="Too many paths matched the query, only one match is allowed. Matches: $($pair.Name)"
48
+
$errs+=$err
49
+
Write-Host-ForegroundColor Red Error: $err
50
+
}
51
+
52
+
if ($platform-ne$pair.Value) {
53
+
$err="$fullName must have architecture $($pair.Value), but it was $platform."
54
+
$errs+=$err
55
+
Write-Host-ForegroundColor Red Error: $err
56
+
}
57
+
}
58
+
elseif ("x86"-eq$platform) {
59
+
if ($name-notlike"*x86*") {
60
+
$err="$fullName has architecture $platform, and must contain x86 in the name of the executable."
61
+
$errs+=$err
62
+
Write-Host-ForegroundColor Red Error: $err
63
+
}
64
+
}
65
+
elseif ($platform-in"x64","x86-64") {
66
+
if ($name-like"*x86*"-or$name-like"*arm64*") {
67
+
$err="$fullName has architecture $platform, and must NOT contain x86 or arm64 in the name of the executable."
68
+
$errs+=$err
69
+
Write-Host-ForegroundColor Red Error: $err
70
+
}
71
+
}
72
+
elseif ("arm64"-eq$platform) {
73
+
if ($name-notlike"*arm64*") {
74
+
$err="$fullName has architecture $platform, and must contain arm64 in the name of the executable."
75
+
$errs+=$err
76
+
Write-Host-ForegroundColor Red Error: $err
77
+
}
78
+
}
79
+
else {
80
+
$err="$fullName has unknown architecture $platform."
<!-- Setting both RuntimeIdentifier and PlatformTarget ends up building as AnyCPU and selecting the default x86 architecture, irregardless of RuntimeIdentifier,
0 commit comments