diff --git a/installer/installer.cmd b/installer/installer.cmd index 071bd5b..f45cba6 100644 --- a/installer/installer.cmd +++ b/installer/installer.cmd @@ -6,6 +6,9 @@ set "repoUrl=https://api.github.com/repos/IMXNOOBX/ghost/releases/latest" set "installPath=%APPDATA%\Ghost" set "shortcutPath=%APPDATA%\Microsoft\Windows\Start Menu\Programs\Ghost.lnk" +rem Create installation directory if it doesn't exist +if not exist "%installPath%" mkdir "%installPath%" + rem Download latest release from GitHub powershell -Command "$response = Invoke-WebRequest -Uri '%repoUrl%' -UseBasicParsing; if ($response.StatusCode -eq 200) { $downloadUrl = ($response.Content | ConvertFrom-Json).assets.browser_download_url; Invoke-WebRequest -Uri $downloadUrl -OutFile '%installPath%\temp.zip'; if ($?) { exit 0 } else { exit 1 } } else { exit 1 }" @@ -15,9 +18,6 @@ if %errorlevel% neq 0 ( exit /b 1 ) -rem Create installation directory if it doesn't exist -if not exist "%installPath%" mkdir "%installPath%" - rem Extract files to destination powershell -Command "Expand-Archive -Path '%installPath%\temp.zip' -DestinationPath '%installPath%' -Force"