mirror of
https://github.com/pepaskopec-blip/Graduately.git
synced 2026-10-27 15:14:35 +00:00
Rename published packages and installers from maturita-* to graduately-*.
Keep temporary legacy aliases on the builds branch so older updaters still find downloads. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
8891bb2a38
commit
bce63459d1
35 changed files with 197 additions and 158 deletions
84
installers/graduately-installer-windows.cmd
Normal file
84
installers/graduately-installer-windows.cmd
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
@echo off
|
||||
rem Graduately installer for Windows.
|
||||
rem
|
||||
rem Carries no application of its own. Fastly caches branch-named URLs on
|
||||
rem raw.githubusercontent.com, so this script looks up the tip of `builds`
|
||||
rem and downloads that commit — not a stale zip from the last five minutes.
|
||||
rem
|
||||
rem Double-click the file to run it. The app updates itself from then on.
|
||||
|
||||
setlocal EnableDelayedExpansion
|
||||
set "REPO=pepaskopec-blip/Graduately"
|
||||
set "BRANCH=builds"
|
||||
set "ASSET=graduately-windows-x64.zip"
|
||||
set "DEST=%LOCALAPPDATA%\Programs\Graduately"
|
||||
|
||||
echo Installing Graduately
|
||||
echo ---------------------
|
||||
|
||||
where curl >nul 2>&1 || goto :no_tools
|
||||
where tar >nul 2>&1 || goto :no_tools
|
||||
|
||||
set "TMP_DIR=%TEMP%\graduately-installer"
|
||||
rmdir /s /q "%TMP_DIR%" 2>nul
|
||||
mkdir "%TMP_DIR%" || goto :fail_tmp
|
||||
|
||||
echo Looking up the latest build...
|
||||
set "SHA="
|
||||
for /f "usebackq delims=" %%S in (`powershell -NoProfile -ExecutionPolicy Bypass -Command "$r = & curl.exe -fsSL --max-time 20 'https://github.com/%REPO%/commits/%BRANCH%.atom'; if ($r -match 'Commit/([0-9a-f]{40})') { $Matches[1] }"`) do set "SHA=%%S"
|
||||
if not defined SHA goto :fail_download
|
||||
set "URL=https://raw.githubusercontent.com/%REPO%/%SHA%/%ASSET%"
|
||||
set "LEGACY_URL=https://raw.githubusercontent.com/%REPO%/%SHA%/maturita-windows-x64.zip"
|
||||
|
||||
echo Downloading build %SHA:~0,7%...
|
||||
curl -fL --progress-bar --max-time 1800 -o "%TMP_DIR%\%ASSET%" "%URL%"
|
||||
if errorlevel 1 curl -fL --progress-bar --max-time 1800 -o "%TMP_DIR%\%ASSET%" "%LEGACY_URL%" || goto :fail_download
|
||||
|
||||
echo Installing to %DEST%
|
||||
if not exist "%DEST%" mkdir "%DEST%" || goto :fail_dest
|
||||
|
||||
tar -xf "%TMP_DIR%\%ASSET%" -C "%DEST%" || goto :fail_extract
|
||||
|
||||
set "LNK=%APPDATA%\Microsoft\Windows\Start Menu\Programs\Graduately.lnk"
|
||||
powershell -NoProfile -ExecutionPolicy Bypass -Command ^
|
||||
"$s=(New-Object -ComObject WScript.Shell).CreateShortcut('%LNK%');" ^
|
||||
"$s.TargetPath='%DEST%\graduately.exe';$s.WorkingDirectory='%DEST%';$s.Save()" >nul 2>&1
|
||||
|
||||
rmdir /s /q "%TMP_DIR%" 2>nul
|
||||
|
||||
echo.
|
||||
echo Done. Starting the app...
|
||||
start "" "%DEST%\graduately.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
|
||||
Loading…
Add table
Add a link
Reference in a new issue