Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a useful batch script that updates GHelper for you. #3566

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions updateGHelper.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
:: Check for administrative privileges
net session >nul 2>&1
if %errorlevel% neq 0 (
echo Requesting administrative privileges...
powershell -Command "Start-Process '%~f0' -Verb RunAs"
exit /b
)

set G_HELPER_PATH="C:\Program Files\GHelper"
set URL=https://github.com/seerge/g-helper/releases/latest/download/GHelper.zip

:: Kill current running instance
taskkill /IM GHelper.exe /F

:: Go to GHelper Directory
cd /D %G_HELPER_PATH%

:: Delete old exe
del GHelper.exe

:: Download and unzip new version
curl -L %URL% --output GHelper.zip
powershell -Command "Expand-Archive .\GHelper.zip"
move .\GHelper\GHelper.exe %G_HELPER_PATH%

:: Delete downloaded setup
rmdir /S /Q GHelper
del GHelper.zip

:: Start updated GHelper
start GHelper.exe