-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuildDistribution.bat
More file actions
87 lines (67 loc) · 2.65 KB
/
Copy pathbuildDistribution.bat
File metadata and controls
87 lines (67 loc) · 2.65 KB
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
80
81
82
83
84
85
86
87
@echo off
@break off
@title Build distribution script for Pixed
@cls
echo Build distribution script for Pixed
set VERSION=1.20
set SOLUTION_PATH=%~dp0
set ZIP_PATH=%SOLUTION_PATH%build\Dist\Pixed.%VERSION%.win_x64.zip
set ZIP_LINUX_PATH=%SOLUTION_PATH%build\Dist\Pixed.%VERSION%.linux.zip
set ZIP_EXPORTER_PATH=%SOLUTION_PATH%build\Dist\Pixed.Exporter.%VERSION%.win_x64.zip
set MSI_PATH=%SOLUTION_PATH%build\Dist\Pixed.%VERSION%.win_x64.msi
set MSIX_PATH=%SOLUTION_PATH%build\Dist\Pixed.%VERSION%.win_x64.msixbundle
set MSIX_STORE_PATH=%SOLUTION_PATH%build\Dist\Pixed.%VERSION%.win_x64.msixupload
set MSIX_INPUT_PATH=%SOLUTION_PATH%\build\AppPackages\Pixed.MSStore_%VERSION%.0.0_Test\Pixed.MSStore_%VERSION%.0.0_x64.msixbundle
set MSIX_STORE_INPUT_PATH=%SOLUTION_PATH%\build\AppPackages\Pixed.MSStore_%VERSION%.0.0_x64_bundle.msixupload
set MSI_INPUT_PATH=%SOLUTION_PATH%build\Pixed.Installer.msi
echo Removing old files...
if not exist "%SOLUTION_PATH%build\Dist" (
mkdir "%SOLUTION_PATH%build\Dist"
)
if exist "%ZIP_PATH%" (
del "%ZIP_PATH%"
)
if exist "%MSI_PATH%" (
del "%MSI_PATH%"
)
if exist "%MSIX_PATH%" (
del "%MSIX_PATH%"
)
if exist "%MSIX_STORE_PATH%" (
del "%MSIX_STORE_PATH%"
)
if exist "%ZIP_LINUX_PATH%" (
del "%ZIP_LINUX_PATH%"
)
if exist "%ZIP_EXPORTER_PATH%" (
del "%ZIP_EXPORTER_PATH%"
)
echo Deploying for Windows...
dotnet publish Pixed.Desktop/Pixed.Desktop.csproj --framework net9.0 --runtime win-x64 --output build/Deploy-win
echo Deploying for Linux...
dotnet publish Pixed.Desktop/Pixed.Desktop.csproj --framework net9.0 --runtime linux-x64 --output build/Deploy-linux
echo Deploying exporter for Windows...
dotnet publish Pixed.Exporter/Pixed.Exporter.csproj --framework net9.0 --runtime win-x64 --output build/Deploy-exporter-win
echo Compressing files for Windows...
cd "%SOLUTION_PATH%\build\Deploy-win"
"%SOLUTION_PATH%\7za.exe" a -x"!win-x64/" "%ZIP_PATH%" -mx9 -tzip
echo Compressing files for Linux...
cd "%SOLUTION_PATH%\build\Deploy-linux"
"%SOLUTION_PATH%\7za.exe" a -x"!linux-x64/" "%ZIP_LINUX_PATH%" -mx9 -tzip
echo Compressing exporter files for Windows...
cd "%SOLUTION_PATH%\build\Deploy-exporter-win"
"%SOLUTION_PATH%\7za.exe" a -x"!win-x64/" "%ZIP_EXPORTER_PATH%" -mx9 -tzip
cd "%SOLUTION_PATH%"
echo Creating MSI Installer...
wix build -ext WixToolset.UI.wixext -bindvariable WixUILicenseRtf=EULA.rtf msi.wxs -arch x64 -out build\Pixed.Installer.msi
echo Copying final files...
if exist "%MSI_INPUT_PATH%" (
copy "%MSI_INPUT_PATH%" "%MSI_PATH%"
)
if exist "%MSIX_INPUT_PATH%" (
copy "%MSIX_INPUT_PATH%" "%MSIX_PATH%"
)
if exist "%MSIX_STORE_INPUT_PATH%" (
copy "%MSIX_STORE_INPUT_PATH%" "%MSIX_STORE_PATH%"
)
exit