]> git.xonotic.org Git - xonotic/xonotic.git/blob - misc/tools/rsync-updater/update-xonotic.bat
more windows fixes
[xonotic/xonotic.git] / misc / tools / rsync-updater / update-xonotic.bat
1 @echo off\r
2 \r
3 if "%1" == "did-copy" goto copied\r
4 cd %~dp0\r
5 del /s /q %TEMP%\xonotic-rsync-updater\r
6 mkdir %TEMP%\xonotic-rsync-updater\r
7 for %%f in (*.exe *.dll *.bat) do copy /b %%f %TEMP%\xonotic-rsync-updater\\r
8 %TEMP%\xonotic-rsync-updater\update-xonotic did-copy\r
9 del /s /q %TEMP%\xonotic-rsync-updater\r
10 pause\r
11 exit\r
12 \r
13 :copied\r
14 set options=-Prtzil --executability --delete-after --delete-excluded --stats\r
15 \r
16 if exist Xonotic-low goto xonoticlow\r
17 if exist Xonotic-high goto xonotichigh\r
18 if exist ..\..\..\.git goto xonoticdatagit\r
19 if exist ..\..\..\data goto xonoticdata\r
20 goto xonotic\r
21 :xonoticlow\r
22         set url=rsync://beta.xonotic.org/autobuild-Xonotic-low/\r
23         set target=Xonotic-low/\r
24         goto endxonotic\r
25 :xonotichigh\r
26         set url=rsync://beta.xonotic.org/autobuild-Xonotic-high/\r
27         set target=Xonotic-high/\r
28         goto endxonotic\r
29 :xonoticdatagit\r
30         echo NOTE: this is a git repository download. Using the regular update method.\r
31         ..\..\..\all update\r
32         goto end\r
33 :xonoticdata\r
34         if exist ..\..\..\misc\tools\rsync-updater\rsync.exe goto xonoticdatarsync\r
35         echo FATAL: rsync not in misc\tools\rsync-updater. This update script cannot be used.\r
36         goto end\r
37 :xonoticdatarsync\r
38         set PATH=misc\tools\rsync-updater;%PATH%\r
39         cd ..\..\..\r
40         if exist data\xonotic-rsync-data-low.pk3 goto xonoticdatalow\r
41         if exist data\xonotic-*-data-low.pk3 goto xonoticdatalowfuzzy\r
42         if exist data\xonotic-rsync-data-high.pk3 goto xonoticdatahigh\r
43         if exist data\xonotic-*-data-high.pk3 goto xonoticdatahighfuzzy\r
44         if exist data\xonotic-rsync-data.pk3 goto xonoticdatanormal\r
45         if exist data\xonotic-*-data.pk3 goto xonoticdatanormalfuzzy\r
46         echo FATAL: unrecognized Xonotic build. This update script cannot be used.\r
47         goto end\r
48 :xonoticdatalow\r
49                 set url=rsync://beta.xonotic.org/autobuild-Xonotic-low/\r
50                 goto endxonoticdata\r
51 :xonoticdatalowfuzzy\r
52                 set url=rsync://beta.xonotic.org/autobuild-Xonotic-low/\r
53                 set options=%options% -y\r
54                 goto endxonoticdata\r
55 :xonoticdatahigh\r
56                 set url=rsync://beta.xonotic.org/autobuild-Xonotic-high/\r
57                 goto endxonoticdata\r
58 :xonoticdatahighfuzzy\r
59                 set url=rsync://beta.xonotic.org/autobuild-Xonotic-high/\r
60                 set options=%options% -y\r
61                 goto endxonoticdata\r
62 :xonoticdatanormal\r
63                 set url=rsync://beta.xonotic.org/autobuild-Xonotic/\r
64                 goto endxonoticdata\r
65 :xonoticdatanormalfuzzy\r
66                 set url=rsync://beta.xonotic.org/autobuild-Xonotic/\r
67                 set options=%options% -y\r
68                 goto endxonoticdata\r
69 :endxonoticdata\r
70         set target=./\r
71         goto endxonotic\r
72 :xonotic\r
73         set url=rsync://beta.xonotic.org/autobuild-Xonotic/\r
74         set target=Xonotic/\r
75         goto endxonotic\r
76 :endxonotic\r
77 \r
78 set excludes=\r
79 if not "%XONOTIC_INCLUDE_ALL%" == "" goto endbit\r
80 set excludes=%excludes% --exclude=/xonotic-linux*\r
81 set excludes=%excludes% --exclude=/xonotic-osx-*\r
82 set excludes=%excludes% --exclude=/Xonotic*.app\r
83 set excludes=%excludes% --exclude=/fteqcc/fteqcc.linux*\r
84 set excludes=%excludes% --exclude=/fteqcc/fteqcc.osx\r
85 \r
86 if "%ProgramFiles(x86)%" == "" goto bit32\r
87 :bit64\r
88         if not "%XONOTIC_INCLUDE_32BIT%" == "" goto endbit\r
89         set excludes=%excludes% --exclude=/xonotic.exe\r
90         set excludes=%excludes% --exclude=/xonotic-sdl.exe\r
91         set excludes=%excludes% --exclude=/xonotic-dedicated.exe\r
92         set excludes=%excludes% --exclude=/fteqcc/fteqcc.exe\r
93         set excludes=%excludes% --exclude=/bin32\r
94         set excludes=%excludes% --exclude=/*.dll\r
95         goto endbit\r
96 :bit32\r
97         set excludes=%excludes% --exclude=/xonotic-x64.exe\r
98         set excludes=%excludes% --exclude=/xonotic-x64-sdl.exe\r
99         set excludes=%excludes% --exclude=/xonotic-x64-dedicated.exe\r
100         set excludes=%excludes% --exclude=/fteqcc/fteqcc-x64.exe\r
101         set excludes=%excludes% --exclude=/bin64\r
102         goto endbit\r
103 :endbit\r
104 \r
105 for %%f in (*.exe *.dll) do copy /b %%f %TEMP%\xonotic-rsync-updater\\r
106 %TEMP%\xonotic-rsync-updater\rsync %options% %excludes% %url% %target%\r
107 %TEMP%\xonotic-rsync-updater\chmod -R a+x %target%\r
108 \r
109 :end\r