mirror of
https://github.com/pepaskopec-blip/Graduately.git
synced 2026-10-27 15:14:35 +00:00
Releases and version numbers are gone. CI now rebuilds all three platforms on every change to main and commits the packages to the `builds` branch, so what anyone downloads is the current state of the repository. The branch is rewritten from scratch each time rather than added to, so the repository keeps one copy of the packages instead of a ~70 MB set per commit. Without tags there is no version to compare, so a build carries the commit it was made from and the branch carries a VERSION file naming the same commit. The updater fetches those few bytes and treats any difference as being behind; commits are not ordered, and the branch only ever holds the current build. The installers fetch from the branch over raw.githubusercontent.com for the same reason. Co-authored-by: Cursor <cursoragent@cursor.com>
81 lines
2.3 KiB
Batchfile
81 lines
2.3 KiB
Batchfile
@echo off
|
|
rem maturita.c installer for Windows.
|
|
rem
|
|
rem Carries no application of its own: it downloads the current build straight
|
|
rem from the repository's `builds` branch, which CI rewrites whenever main
|
|
rem changes. This file therefore never goes stale.
|
|
rem
|
|
rem Double-click the file to run it. The app updates itself from then on.
|
|
|
|
setlocal
|
|
set "REPO=pepaskopec-blip/maturita.c"
|
|
set "BRANCH=builds"
|
|
set "ASSET=maturita-windows-x64.zip"
|
|
set "URL=https://raw.githubusercontent.com/%REPO%/%BRANCH%/%ASSET%"
|
|
set "DEST=%LOCALAPPDATA%\Programs\Maturita"
|
|
|
|
echo Installing maturita.C
|
|
echo ---------------------
|
|
|
|
rem curl and tar both ship with Windows 10 1803 and later.
|
|
where curl >nul 2>&1 || goto :no_tools
|
|
where tar >nul 2>&1 || goto :no_tools
|
|
|
|
set "TMP_DIR=%TEMP%\maturita-installer"
|
|
rmdir /s /q "%TMP_DIR%" 2>nul
|
|
mkdir "%TMP_DIR%" || goto :fail_tmp
|
|
|
|
echo Downloading the latest release...
|
|
curl -fL --progress-bar -o "%TMP_DIR%\%ASSET%" "%URL%" || goto :fail_download
|
|
|
|
echo Installing to %DEST%
|
|
if not exist "%DEST%" mkdir "%DEST%" || goto :fail_dest
|
|
|
|
rem Extracted over any existing install rather than replacing the folder, so
|
|
rem the progress files kept inside it survive an upgrade.
|
|
tar -xf "%TMP_DIR%\%ASSET%" -C "%DEST%" || goto :fail_extract
|
|
|
|
rem Start menu entry, so the app can be found without digging for the folder.
|
|
set "LNK=%APPDATA%\Microsoft\Windows\Start Menu\Programs\maturita.C.lnk"
|
|
powershell -NoProfile -ExecutionPolicy Bypass -Command ^
|
|
"$s=(New-Object -ComObject WScript.Shell).CreateShortcut('%LNK%');" ^
|
|
"$s.TargetPath='%DEST%\maturita.exe';$s.WorkingDirectory='%DEST%';$s.Save()" >nul 2>&1
|
|
|
|
rmdir /s /q "%TMP_DIR%" 2>nul
|
|
|
|
echo.
|
|
echo Done. Starting the app...
|
|
start "" "%DEST%\maturita.exe"
|
|
exit /b 0
|
|
|
|
:no_tools
|
|
echo.
|
|
echo Error: this installer needs curl and tar, which come with Windows 10
|
|
echo version 1803 and later. Please update Windows, or download the zip
|
|
echo manually from https://github.com/%REPO%/tree/%BRANCH%
|
|
pause
|
|
exit /b 1
|
|
|
|
:fail_tmp
|
|
echo.
|
|
echo Error: could not create a temporary folder in %TEMP%.
|
|
pause
|
|
exit /b 1
|
|
|
|
:fail_download
|
|
echo.
|
|
echo Error: the download failed. Check your internet connection.
|
|
pause
|
|
exit /b 1
|
|
|
|
:fail_dest
|
|
echo.
|
|
echo Error: could not create %DEST%.
|
|
pause
|
|
exit /b 1
|
|
|
|
:fail_extract
|
|
echo.
|
|
echo Error: the archive could not be unpacked.
|
|
pause
|
|
exit /b 1
|