use installation script, less scary

This commit is contained in:
Mylloon 2024-04-01 15:15:02 +02:00
parent 5a5fe09a93
commit 067ca081b7
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
2 changed files with 27 additions and 22 deletions

View file

@ -9,31 +9,12 @@ Tool for sharing video to Discord.
2 choices : 2 choices :
- Manually head to [the release page](https://git.mylloon.fr/Anri/dsr/releases/latest). - Manually head to [the release page](https://git.mylloon.fr/Anri/dsr/releases/latest).
- <details> - Download it via PowerShell:
<summary>Download it via command lines</summary>
Copy and paste this snippet into the windows command prompt: ```powershell
irm https://git.mylloon.fr/Anri/dsr/raw/branch/main/install.ps1 | iex
```batch
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';" ^
"Invoke-WebRequest -Uri $link -OutFile $archive;" ^
"Remove-Item '%LOCALAPPDATA%\DSR' -Recurse -ErrorAction SilentlyContinue;" ^
"Expand-Archive -Path $archive -DestinationPath '%LOCALAPPDATA%\DSR' -Force;" ^
"Move-Item -Path '%LOCALAPPDATA%\DSR\dsr-win32-x64\*' -Destination '%LOCALAPPDATA%\DSR' -Force;" ^
"Remove-Item '%LOCALAPPDATA%\DSR\dsr-win32-x64';" ^
"$WshShell = New-Object -comObject WScript.Shell;" ^
"$Shortcut = $WshShell.CreateShortcut('%APPDATA%\Microsoft\Windows\Start Menu\Programs\DSR.lnk');" ^
"$Shortcut.TargetPath = '%LOCALAPPDATA%\DSR\dsr.exe';" ^
"$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 InstallLocation /t REG_SZ /d '%LOCALAPPDATA%\DSR'"
``` ```
</details>
> - If you have Discord Nitro: add `/nitro` flag when running DSR. > - If you have Discord Nitro: add `/nitro` flag when running DSR.
> - If you have an NVidia GPU with NVenc: add `/nvenc` flag when running DSR. > - If you have an NVidia GPU with NVenc: add `/nvenc` flag when running DSR.

24
install.ps1 Normal file
View file

@ -0,0 +1,24 @@
# Enable TLSv1.2 for compatibility with older clients
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
# Download
$releases = "https://git.mylloon.fr/api/v1/repos/Anri/dsr/releases/latest"
$link = (Invoke-WebRequest $releases | ConvertFrom-Json)[0].assets.browser_download_url
$archive = "$env:TEMP\dsr.zip"
Invoke-WebRequest -Uri $link -OutFile $archive
Remove-Item "$env:LOCALAPPDATA\DSR" -Recurse -ErrorAction SilentlyContinue
# Installation
Expand-Archive -Path $archive -DestinationPath "$env:LOCALAPPDATA\DSR" -Force
Move-Item -Path "$env:LOCALAPPDATA\DSR\dsr-win32-x64\*" -Destination "$env:LOCALAPPDATA\DSR" -Force
Remove-Item "$env:LOCALAPPDATA\DSR\dsr-win32-x64"
# Add shortcut
$WshShell = New-Object -comObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut("$env:APPDATA\Microsoft\Windows\Start Menu\Programs\DSR.lnk")
$Shortcut.TargetPath = "$env:LOCALAPPDATA\DSR\dsr.exe"
$Shortcut.Save()
# Add new app to registry
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 "$env:LOCALAPPDATA\DSR"