-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
40 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,38 @@ | ||
@echo off | ||
setlocal | ||
|
||
set workpath=%~dp0 | ||
set updatepath=%workpath%updates\ | ||
set latestpath=%updatepath%latest\ | ||
REM 현재 실행 중인 배치파일의 위치를 변수로 저장 | ||
set current_dir=%~dp0 | ||
set update_dir=%current_dir%updates | ||
|
||
timeout 1 | ||
::xcopy "%latestpath%*.*" "%workpath%" /s /k /h /y | ||
if not errorlevel 0 goto update_error | ||
timeout /t 1 | ||
|
||
del "%updatepath%latest.json" | ||
::del "%updatepath%latest.zip" | ||
::del /q "%latestpath%*" | ||
::for /d %%p in ("%latestpath%*.*") do rmdir /s /q "%%p" | ||
::rmdir /s /q "%latestpath%" | ||
REM 새 버전의 shatagon.exe 파일을 update 폴더에서 복사 | ||
if exist "%update_dir%\Shatagon.exe" ( | ||
echo Update the new Shatagon.exe file... | ||
move /y "%update_dir%\Shatagon.exe" "%current_dir%Shatagon.exe" | ||
if %errorlevel% equ 0 ( | ||
echo The update completed successfully. | ||
set "update_status=0" | ||
) else ( | ||
echo The update failed. | ||
set "update_status=1" | ||
) | ||
) else ( | ||
echo The update file was not found. | ||
set "update_status=1" | ||
goto :end | ||
) | ||
|
||
start "" "%workpath%Shatagon.exe" update_status 0 | ||
exit | ||
REM update 폴더 및 그 안의 모든 파일을 삭제 | ||
if exist "%update_dir%" ( | ||
echo Delete the ''updates' older... | ||
rmdir /s /q "%update_dir%" | ||
) | ||
|
||
:update_error | ||
:end | ||
REM shatagon.exe 파일을 update_status 파라미터와 함께 실행 | ||
echo Run Shatagon.exe with the value update_status %update_status%... | ||
start "" "%current_dir%shatagon.exe" update_status %update_status% | ||
|
||
start "" "%workpath%Shatagon.exe" update_status 1" | ||
exit | ||
endlocal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters