From 44c4b8a41e39533c0eb9055427ad02f485de75b1 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Tue, 26 Nov 2024 21:06:44 +0100 Subject: [PATCH] onthespot installer --- windows/installers/onthespot.bat | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 windows/installers/onthespot.bat diff --git a/windows/installers/onthespot.bat b/windows/installers/onthespot.bat new file mode 100644 index 0000000..2c793dd --- /dev/null +++ b/windows/installers/onthespot.bat @@ -0,0 +1,22 @@ +@ECHO OFF + +ECHO onthespot... +MKDIR "%LOCALAPPDATA%\onthespot" 2>NUL +PowerShell -Command "" ^ + "$repo = 'justin025/onthespot';" ^ + "$releases = \"https://api.github.com/repos/$repo/releases/latest\";" ^ + "$assets = (Invoke-WebRequest $releases | ConvertFrom-Json)[0].assets;" ^ + "$link = ($assets | Where-Object { $_.name -like '*-x86_64.exe' }).browser_download_url;" ^ + "$exe = 'OnTheSpot-x86_64.exe';" ^ + "$outfile = Join-Path -Path '%LOCALAPPDATA%\onthespot' -ChildPath $exe;" ^ + "Invoke-WebRequest -Uri $link -OutFile $outFile;" ^ + "$WshShell = New-Object -comObject WScript.Shell;" ^ + "$Shortcut = $WshShell.CreateShortcut('%APPDATA%\Microsoft\Windows\Start Menu\Programs\onthespot.lnk');" ^ + "$Shortcut.TargetPath = $outfile;" ^ + "$Shortcut.Save()" + +REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\onthespot" /f /v DisplayName /t REG_SZ /d "onthespot" +REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\onthespot" /f /v InstallLocation /t REG_SZ /d "%LOCALAPPDATA%\onthespot" + +IF NOT "%1"=="yes" PAUSE +EXIT /B