create directory before hand

This commit is contained in:
Mylloon 2024-09-25 13:44:45 +02:00
parent 56ce28b2fc
commit 4be99735f2
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -1,4 +1,5 @@
@ECHO OFF @ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
:: Start as administrator :: Start as administrator
fltmc >NUL 2>&1 || ( fltmc >NUL 2>&1 || (
@ -8,16 +9,18 @@ fltmc >NUL 2>&1 || (
EXIT 0 EXIT 0
) )
SET "fivem=%LOCALAPPDATA%\FiveM"
MKDIR !fivem! 2>NUL
ECHO FiveM... ECHO FiveM...
PowerShell -Command "" ^ PowerShell -Command "" ^
"$baselink = 'https://runtime.fivem.net/client';" ^ "$baselink = 'https://runtime.fivem.net/client';" ^
"$exe = 'FiveM.exe';" ^ "$exe = 'FiveM.exe';" ^
"$path = \"$env:LOCALAPPDATA\FiveM\";" ^ "$outFile = Join-Path -Path '!fivem!' -ChildPath $exe;" ^
"$outFile = Join-Path -Path $path -ChildPath $exe;" ^
"Invoke-WebRequest -Uri \"https://runtime.fivem.net/client/$exe\" -OutFile $outFile;" ^ "Invoke-WebRequest -Uri \"https://runtime.fivem.net/client/$exe\" -OutFile $outFile;" ^
"$WshShell = New-Object -comObject WScript.Shell;" ^ "$WshShell = New-Object -comObject WScript.Shell;" ^
"$Shortcut = $WshShell.CreateShortcut('%APPDATA%\Microsoft\Windows\Start Menu\Programs\FiveM.lnk');" ^ "$Shortcut = $WshShell.CreateShortcut('%APPDATA%\Microsoft\Windows\Start Menu\Programs\FiveM.lnk');" ^
"$Shortcut.WorkingDirectory = \"$path\";" ^ "$Shortcut.WorkingDirectory = '!fivem!';" ^
"$Shortcut.TargetPath = $outFile;" ^ "$Shortcut.TargetPath = $outFile;" ^
"$Shortcut.Save()" "$Shortcut.Save()"
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\fivem" /f /v DisplayName /t REG_SZ /d "FiveM" REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\fivem" /f /v DisplayName /t REG_SZ /d "FiveM"