-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.bat
More file actions
129 lines (111 loc) · 5.14 KB
/
setup.bat
File metadata and controls
129 lines (111 loc) · 5.14 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
@echo off
chcp 65001 >nul
mode con: cols=80 lines=30
title Setup
powershell -Command ^
"$lines = @(" ^
"'███████╗███████╗████████╗██╗ ██╗██████╗ '," ^
"'██╔════╝██╔════╝╚══██╔══╝██║ ██║██╔══██╗'," ^
"'███████╗█████╗ ██║ ██║ ██║██████╔╝'," ^
"'╚════██║██╔══╝ ██║ ██║ ██║██╔═══╝ '," ^
"'███████║███████╗ ██║ ╚██████╔╝██║ '," ^
"'╚══════╝╚══════╝ ╚═╝ ╚═════╝ ╚═╝ '" ^
"); foreach ($line in $lines) { Write-Host $line -ForegroundColor Cyan }"
REM ---- 変数の設定 ----
set "PROJECT_NAME=ProjectName"
set "DOWNLOAD_URL=https://dxlib.xsrv.jp/DxLib/DxLib_VC3_24f.zip"
set "DXLIB_ZIP=DxLib_VC.zip"
set "TEMP_DIR=dxlib_tmp"
powershell -Command ^
"$lines = @(" ^
"'================================='," ^
"'= Dxlib Setup ='," ^
"'================================='" ^
"); foreach ($line in $lines) { Write-Host $line -ForegroundColor DarkMagenta }"
REM ---- DxLibのダウンロード ----
powershell -Command "Write-Host '[ ]Download Dxlib...' -ForegroundColor DarkCyan"
curl -L --progress-bar "%DOWNLOAD_URL%" -o "%DXLIB_ZIP%"
if errorlevel 1 (
powershell -Command "Write-Host 'Failed to Download' -ForegroundColor Red"
pause
exit /b 1
)
powershell -Command "Write-Host '[✔] Download Complete!' -ForegroundColor Green"
REM ---- 一時ディレクトリの作成 ----
if exist "%TEMP_DIR%" rmdir /s /q "%TEMP_DIR%"
mkdir "%TEMP_DIR%"
REM ---- ダウンロードしたZIPを解凍 ----
powershell -Command "Write-Host '[ ]Extract DxLib.zip file...' -ForegroundColor DarkCyan"
powershell -Command "Expand-Archive -Path '%DXLIB_ZIP%' -DestinationPath '%TEMP_DIR%'"
if errorlevel 1 (
powershell -Command "Write-Host 'Failed to Extract' -ForegroundColor Red"
pause
exit /b 1
)
powershell -Command "Write-Host '[✔] Extract Complete!' -ForegroundColor Green"
REM ---- 必要なディレクトリのリネーム ----
powershell -Command "Write-Host '[ ]Rename Directory' -ForegroundColor DarkCyan"
set "SRC_DIR=%TEMP_DIR%\DxLib_VC\プロジェクトに追加すべきファイル_VC用"
set "DST_DIR=%TEMP_DIR%\DxLib_VC\DxLib"
if not exist "%SRC_DIR%" (
powershell -Command "Write-Host 'not found : "%SRC_DIR%"' -ForegroundColor Red"
pause
exit /b 1
)
ren "%SRC_DIR%" DxLib
powershell -Command "Write-Host '[✔] Rename Complete!' -ForegroundColor Green"
REM ---- Dxlibディレクトリの移動 ----
powershell -Command "Write-Host '[ ]Move DxLib to include Directory' -ForegroundColor DarkCyan"
move "%TEMP_DIR%\DxLib_VC\DxLib" "%PROJECT_NAME%\include"
powershell -Command "Write-Host '[✔] Move Complete!' -ForegroundColor Green"
REM ---- 残りの一時ファイル・ZIPを削除 ----
powershell -Command "Write-Host '======= CleneUp =======' -ForegroundColor DarkGray"
rmdir /s /q "%TEMP_DIR%"
del "%DXLIB_ZIP%"
powershell -Command "Write-Host '======= Done =======' -ForegroundColor Green"
powershell -Command ^
"$lines = @(" ^
"'---------------------------------'," ^
"' Dxlib Setup is Complete!! '," ^
"'---------------------------------'" ^
"); foreach ($line in $lines) { Write-Host $line -ForegroundColor DarkYellow }"
powershell -Command ^
"$lines = @(" ^
"'================================='," ^
"'= nlohman-json Setup ='," ^
"'================================='" ^
"); foreach ($line in $lines) { Write-Host $line -ForegroundColor DarkMagenta }"
REM nlohmann-jsonをダウンロード
powershell -Command "Write-Host '[ ]Download nlohmann-json...' -ForegroundColor DarkCyan"
if exist "%PROJECT_NAME%/include/nlohmann" rmdir /s /q "%PROJECT_NAME%/include/nlohmann"
mkdir "%PROJECT_NAME%/include/nlohmann"
curl -L -o "%PROJECT_NAME%/include/nlohmann/json.hpp" ^
"https://github.com/nlohmann/json/raw/refs/heads/develop/single_include/nlohmann/json.hpp"
curl -L -o "%PROJECT_NAME%/include/nlohmann/json_fwd.hpp" ^
"https://github.com/nlohmann/json/raw/refs/heads/develop/single_include/nlohmann/json_fwd.hpp"
REM ダウンロード失敗時はエラー表示
if errorlevel 1 (
powershell -Command "Write-Host 'failed to download nlohmann-json' -ForegroundColor Red"
pause
exit /b 1
)
powershell -Command "Write-Host '[✔] Download Complete!' -ForegroundColor Green"
rem 完了報告
powershell -Command ^
"$lines = @(" ^
"'---------------------------------'," ^
"' nlohman-json Setup is Complete! '," ^
"'---------------------------------'" ^
"); foreach ($line in $lines) { Write-Host $line -ForegroundColor DarkYellow }"
powershell -Command ^
"$lines = @(" ^
"'======== INSTALL COMPLETE ========'," ^
"' Let''s develop it! '" ^
"); foreach ($line in $lines) { Write-Host $line -ForegroundColor Black -BackgroundColor DarkGreen }"
pause
rem slnを開く
for %%f in ("%PROJECT_NAME%\*.sln") do (
start "" "%%f"
goto :done
)
:done