-
Notifications
You must be signed in to change notification settings - Fork 0
/
Publish.bat
79 lines (64 loc) · 3 KB
/
Publish.bat
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
@echo off
cd /d %~dp0
SET "DOTNET_CLI_TELEMETRY_OPTOUT=1"
REM This file is now served as a fall-back whenever MS messed up the SDK again.
REM This batch script will force download the SDK v8.0.100.
REM call Tools\SetupEnv.bat
SETLOCAL
IF "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
SET SHA1Tool=Tools\SHA1Maker-x64.exe
) ELSE (
IF "%PROCESSOR_ARCHITECTURE%"=="x86" (
SET SHA1Tool=Tools\SHA1Maker-x86.exe
) ELSE (
echo Not supported on this platform.
goto TO_RETURN
)
)
SET "PublishRootDir=docs\publish\v8"
SET "MSBUILDDISABLENODEREUSE=1"
if not exist %PublishRootDir% (
mkdir "%PublishRootDir%"
)
IF EXIST "%~dp0Tools\sdk\8.0.100\dotnet.exe" (
REM Use the specific SDK.
SET "PATH=%~dp0Tools\sdk\8.0.100;%PATH%"
REM I need to targeting this SDK because there's no way to directly target the specific 8.0.0 runtime (so that all assembly files are compatible with all .NET8 versions).
)
dotnet build -c Release -o "Build\LauncherCore-natives" "LauncherCore\LauncherCore.csproj"
dotnet publish -c Release --no-self-contained -p:PublishReadyToRun=true -r win-x64 -o "Build\LauncherCoreNew" "LauncherCoreNew\LauncherCoreNew.csproj"
del /Q /F "Build\LauncherCoreNew\e_sqlcipher.dll"
del /Q /F "Build\LauncherCoreNew\WebView2Loader.dll"
del /F /Q "Build\LauncherCoreNew\Microsoft.Web.WebView2.WPF.dll"
copy /B /L /Y "Build\LauncherCoreNew\*.dll" "%PublishRootDir%\files\"
if not exist %PublishRootDir%\files\native-x64 (
mkdir "%PublishRootDir%\files\native-x64"
)
copy /B /L /Y "Build\LauncherCore-natives\runtimes\win-x64\native\*.dll" "%PublishRootDir%\files\native-x64\"
if not exist %PublishRootDir%\files\native-x86 (
mkdir "%PublishRootDir%\files\native-x86"
)
copy /B /L /Y "Build\LauncherCore-natives\runtimes\win-x86\native\*.dll" "%PublishRootDir%\files\native-x86\"
dotnet publish -c Release --no-self-contained -p:PublishReadyToRun=true -r win-x64 -o "Build\Updater" "Updater\Updater.csproj"
copy /B /L /Y "Build\Updater\*.dll" "%PublishRootDir%\files\"
if not exist %PublishRootDir%\files\plugins\rss (
mkdir "%PublishRootDir%\files\plugins\rss"
)
dotnet publish -c Release --no-self-contained -p:PublishReadyToRun=true -r win-x64 -o "Build\WordpressRSSFeed" "WordpressRSSFeed\WordpressRSSFeed.csproj"
copy /B /L /Y "Build\WordpressRSSFeed\WordpressRSSFeed.dll" "%PublishRootDir%\files\plugins\rss\"
dotnet publish -c Release --no-self-contained -p:PublishReadyToRun=true -r win-x64 -o "Build\PSUBlogRSSFeed" "PSUBlogRSSFeed\PSUBlogRSSFeed.csproj"
copy /B /L /Y "Build\PSUBlogRSSFeed\PSUBlogRSSFeed.dll" "%PublishRootDir%\files\plugins\rss\"
REM Remove unncessary files
REM del /F /Q "%PublishRootDir%\files\Microsoft.Web.WebView2.WPF.dll"
REM del /F /Q "%PublishRootDir%\files\WebView2Loader.dll"
del /F /Q "%PublishRootDir%\files\PSO2LeaLauncher.dll"
IF "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
echo Using x64 SHA1Maker.
) ELSE (
IF "%PROCESSOR_ARCHITECTURE%"=="x86" (
echo Using x86 SHA1Maker.
)
)
%SHA1Tool% "%PublishRootDir%" "%PublishRootDir%\update.json" "https://leayal.github.io/PSO2-Launcher-CSharp/publish/v8/"
:TO_RETURN
ENDLOCAL