forked from OverlayPlugin/OverlayPlugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-cef-redists.ps1
63 lines (46 loc) · 1.95 KB
/
build-cef-redists.ps1
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
try {
# This assumes Visual Studio 2019 is installed in C:. You might have to change this depending on your system.
$VS_PATH = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"
if ( -not (Test-Path "Thirdparty\ACT\Advanced Combat Tracker.exe" )) {
echo 'Error: Please run tools\fetch_deps.ps1'
exit 1
}
if ( -not (Test-Path "Thirdparty\FFXIV_ACT_Plugin\SDK\FFXIV_ACT_Plugin.Common.dll" )) {
echo 'Error: Please run tools\fetch_deps.ps1'
exit 1
}
$ENV:PATH = "$VS_PATH\MSBuild\Current\Bin;${ENV:PATH}";
if (Test-Path "C:\Program Files\7-Zip\7z.exe") {
$ENV:PATH = "C:\Program Files\7-Zip;${ENV:PATH}";
}
echo "==> Building..."
msbuild -p:Configuration=Release -p:Platform=x64 "OverlayPlugin.sln" -t:Restore
msbuild -p:Configuration=Release -p:Platform=x64 "OverlayPlugin.sln" -t:Rebuild
if (-not $?) { exit 1 }
echo "==> Building CEF archives..."
cd out\Release\libs\x64
copy ..\CefSharp* .
$text = [System.IO.File]::ReadAllText("$PWD\README.txt");
$regex = [regex]::New("CEF Version:\s*([0-9.]+)");
$m = $regex.Match($text);
if (-not $m) {
echo "Error: Version number not found in CEF's README.txt!"
exit 1
}
$version = $m.Groups[1]
$archive = "..\..\..\CefSharp-$version-x64.7z"
if (Test-Path $archive) { rm $archive }
7z a $archive "-x!*.xml" "-x!*.pdb" .
# Rename the archive here so I don't have to before uploading.
# If you're wondering why I change the extension: People don't read. This seems like the easiest way to force them to.
#mv $archive "..\..\..\CefSharp-$version-x64.DO_NOT_DOWNLOAD"
cd ..\..\libs\x86
copy ..\CefSharp* .
$archive = "..\..\..\CefSharp-$version-x86.7z"
if (Test-Path $archive) { rm $archive }
7z a $archive "-x!*.xml" "-x!*.pdb" .
#mv $archive "..\..\..\CefSharp-$version-x86.DO_NOT_DOWNLOAD"
cd ..\..
} catch {
Write-Error $Error[0]
}