Skip to content

Commit e11e18a

Browse files
authored
Add iso.bat script
1 parent e6adece commit e11e18a

1 file changed

Lines changed: 88 additions & 0 deletions

File tree

.github/workflows/iso.bat

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
@ECHO off
2+
3+
curl -Is https://github.com >nul 2>&1
4+
if errorlevel 1 (
5+
echo Please connect to the internet
6+
exit /b 1
7+
)
8+
9+
SET latest=GITHUBRELEASE
10+
SET latestkver=%latest%
11+
CALL SET latestkver=%%latestkver:v=%%
12+
FOR /f "tokens=1,2 delims=-" %%a IN ("%latestkver%") DO (
13+
SET latestkver=%%a
14+
)
15+
16+
SET downloads=%userprofile%\Downloads
17+
18+
ECHO.
19+
ECHO Choose the flavour of Linux Mint you wish to install:
20+
ECHO.
21+
ECHO 1. Cinnamon
22+
ECHO 2. Xfce
23+
ECHO 3. MATE
24+
ECHO.
25+
ECHO Type your choice (1,2 or 3) from the above list and press return.
26+
SET /P flavinput=
27+
28+
IF "%flavinput%"=="1" (
29+
SET flavour=cinnamon
30+
SET flavourcap=Cinnamon
31+
) ELSE (
32+
IF "%flavinput%"=="2" (
33+
SET flavour=xfce
34+
SET flavourcap=Xfce
35+
) ELSE (
36+
IF "%flavinput%"=="3" (
37+
SET flavour=mate
38+
SET flavourcap=MATE
39+
) ELSE (
40+
ECHO Invalid input. Aborting!
41+
EXIT
42+
)
43+
)
44+
)
45+
46+
SET iso=linuxmint-22.3-%flavour%-%latestkver%-t2-noble
47+
SET ver=Linux Mint 22.3 "Zena" - %flavourcap% Edition
48+
49+
ECHO.
50+
ECHO Downloading Part 1 for %ver%
51+
ECHO.
52+
curl -#L https://github.com/t2linux/T2-Mint/releases/download/%latest%/%iso%.iso.00 > %downloads%\%iso%.iso
53+
54+
ECHO.
55+
ECHO Downloading Part 2 for %ver%
56+
ECHO.
57+
curl -#L https://github.com/t2linux/T2-Mint/releases/download/%latest%/%iso%.iso.01 >> %downloads%\%iso%.iso
58+
59+
curl -s -L https://github.com/t2linux/T2-Mint/releases/download/%latest%/sha256-%flavour% -o shafile.txt
60+
61+
FOR /F "DELIMS=" %%A IN (shafile.txt) DO (
62+
SET actual_iso_chksum=%%A
63+
GOTO :break_loop
64+
)
65+
:break_loop
66+
67+
DEL shafile.txt
68+
69+
FOR /f "tokens=1,2 delims= " %%a IN ("%actual_iso_chksum%") DO (
70+
SET actual_iso_chksum=%%a
71+
)
72+
73+
ECHO.
74+
ECHO Verifying sha256 checksums
75+
76+
FOR /f "tokens=1" %%i IN ('certutil -hashfile %downloads%\%iso%.iso SHA256 ^| findstr /v "hash"') DO (
77+
SET "downloaded_iso_chksum=%%i"
78+
)
79+
80+
IF "%actual_iso_chksum%" NEQ "%downloaded_iso_chksum%" (
81+
ECHO.
82+
ECHO Error: Failed to verify sha256 checksums of the ISO
83+
DEL %downloads%\%iso%.iso
84+
EXIT
85+
)
86+
87+
ECHO.
88+
ECHO ISO saved to Downloads

0 commit comments

Comments
 (0)