find latest release

This commit is contained in:
Mylloon 2023-11-11 15:11:51 +01:00
parent 7a2b01f2a8
commit fb94de4c76
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -199,17 +199,19 @@ REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\LosslessCut" /
:: Install DSR :: Install DSR
ECHO DSR... ECHO DSR...
PowerShell -Command "" ^ PowerShell -Command "" ^
"$releases = 'https://git.mylloon.fr/api/v1/repos/Anri/dsr/releases/latest';" ^
"$link = (Invoke-WebRequest $releases | ConvertFrom-Json)[0].assets.browser_download_url;" ^
"$archive = '%TEMP%\dsr.zip';" ^ "$archive = '%TEMP%\dsr.zip';" ^
"Invoke-WebRequest -Uri https://git.mylloon.fr/Anri/dsr/releases/download/1.4.0/dsr-win32-x64-1.4.0.zip -OutFile $archive;" ^ "Invoke-WebRequest -Uri $link -OutFile $archive;" ^
"Expand-Archive -Path $archive -DestinationPath '%ProgramFiles%\DSR' -Force;" ^ "Expand-Archive -Path $archive -DestinationPath '%LOCALAPPDATA%\DSR' -Force;" ^
"Move-Item -Path '%ProgramFiles%\DSR\dsr-win32-x64\*' -Destination '%ProgramFiles%\DSR' -Force;" ^ "Move-Item -Path '%LOCALAPPDATA%\DSR\dsr-win32-x64\*' -Destination '%LOCALAPPDATA%\DSR' -Force;" ^
"Remove-Item '%ProgramFiles%\DSR\dsr-win32-x64;'" ^ "Remove-Item '%LOCALAPPDATA%\DSR\dsr-win32-x64';" ^
"$WshShell = New-Object -comObject WScript.Shell;" ^ "$WshShell = New-Object -comObject WScript.Shell;" ^
"$Shortcut = $WshShell.CreateShortcut('%APPDATA%\Microsoft\Windows\Start Menu\Programs\DSR.lnk');" ^ "$Shortcut = $WshShell.CreateShortcut('%APPDATA%\Microsoft\Windows\Start Menu\Programs\DSR.lnk');" ^
"$Shortcut.TargetPath = '%ProgramFiles%\DSR\dsr.exe';" ^ "$Shortcut.TargetPath = '%LOCALAPPDATA%\DSR\dsr.exe';" ^
"$Shortcut.Save()" "$Shortcut.Save()"
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\dsr" /f /v DisplayName /t REG_SZ /d "DSR" REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\dsr" /f /v DisplayName /t REG_SZ /d "DSR"
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\dsr" /f /v InstallLocation /t REG_SZ /d "%ProgramFiles%\DSR" REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\dsr" /f /v InstallLocation /t REG_SZ /d "%LOCALAPPDATA%\DSR"
:: Install Vencord :: Install Vencord
:: use local script :: use local script