forked from OpenMeridian/Meridian59
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpostbuild.bat
67 lines (55 loc) · 2.02 KB
/
postbuild.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
@echo off
setlocal EnableDelayedExpansion
rem Create a shortcut that can connect to localhost.
call :makeshortcut
echo Post-Build started.
set foundcli=0
rem Step 1: Try 64-bit Program Files
set m59path=%ProgramW6432%\Open Meridian\Meridian 105
if EXIST !m59path! (
call :copying
if %ERRORLEVEL% LSS 8 goto found
)
rem Step 2: try 32-bit Program Files(x86)
set m59path=%ProgramFiles(x86)%\Open Meridian\Meridian 105
if EXIST !m59path! (
call :copying
if %ERRORLEVEL% LSS 8 goto found
)
rem Step 3: try AppData\Local
set m59path=%LocalAppData%\Open Meridian\Meridian 105
if EXIST !m59path! (
call :copying
if %ERRORLEVEL% LSS 8 goto found
)
echo No graphics found, Please download the classic client from https://www.meridiannext.com/play/.
exit /b 0
:copying
echo Copying live graphics from !m59path! to client folder.
rem The error check after this is currently redundant, but kept in case
rem further copying code is added.
robocopy "!m59path!\resource" ".\run\localclient\resource" *.bsf *.bgf *.ogg /R:0 /MT /XO > postbuild.log
if %ERRORLEVEL% GTR 7 goto:eof
rem These extensions aren't used.
rem robocopy "!m59path!\resource" ".\run\localclient\resource" *.mid *.xmi *.wav *.mp3 /R:0 /MT /XO > nul
rem if %ERRORLEVEL% GTR 7 goto:eof
goto:eof
:found
echo Post-Build Finished.
echo Please remember to update blakserv.cfg if server is being copied to production.
goto:eof
:makeshortcut
echo Creating meridian.exe shortcut to connect to localhost.
set CURPATH=%~dp0
set cSctVBS=CreateShortcut.vbs
(
echo Set oWS = WScript.CreateObject^("WScript.Shell"^)
echo sLinkFile = oWS.ExpandEnvironmentStrings^("!CURPATH!run\localclient\meridian.exe - Shortcut.lnk"^)
echo Set oLink = oWS.CreateShortcut^(sLinkFile^)
echo oLink.Arguments = "/H:127.0.0.1 /P:5959"
echo oLink.TargetPath = oWS.ExpandEnvironmentStrings^("!CURPATH!run\localclient\meridian.exe"^)
echo oLink.WorkingDirectory = oWS.ExpandEnvironmentStrings^("!CURPATH!run\localclient"^)
echo oLink.Save
)1>!cSctVBS!
cscript //nologo .\!cSctVBS!
DEL !cSctVBS! /f /q