Use Tailscale and Moonlight to enable remote gaming
This commit is contained in:
@@ -0,0 +1,77 @@
|
||||
$TailscaleUri = 'https://pkgs.tailscale.com/stable/tailscale-setup-1.88.3-amd64.msi'
|
||||
$TailscaleMsi = 'tailscale.msi'
|
||||
$TailscaleInstalledExe = 'C:\Program Files\Tailscale\tailscale.exe'
|
||||
$TailscaleInstallLog = 'tailscale-install.log'
|
||||
# FIXME(jona): Tailscale auth-key should not be stored in plain text!
|
||||
$TailscaleAuthKey = '${tailscale_authkey}'
|
||||
|
||||
$AmdDriverUri = 'https://download.microsoft.com/download/44ee0d6c-74dd-4214-b6d5-24fbf2eac33b/whql-amd-software-cloud-edition-25.1.1-win10-win11-azure-ngads-v620.exe'
|
||||
$AmdDriverExe = 'amd-gpu-driver.exe'
|
||||
$AmdDriverInstallLog = "$PWD\amd-gpu-driver-install.log"
|
||||
|
||||
$SunshineInstallerUri = 'https://github.com/LizardByte/Sunshine/releases/latest/download/Sunshine-Windows-AMD64-installer.exe'
|
||||
$SunshineInstallerExe = 'sunshine-installer.exe'
|
||||
|
||||
$SteamInstallerUri = 'https://cdn.fastly.steamstatic.com/client/installer/SteamSetup.exe'
|
||||
$SteamInstallerExe = 'steam-installer.exe'
|
||||
|
||||
Write-Host "Provisioning software"
|
||||
|
||||
##
|
||||
# Tailscale
|
||||
Write-Host 'Setting up tailscale'
|
||||
|
||||
Write-Host "Downloading Tailscale MSI from $TailscaleUri to $TailscaleMsi"
|
||||
Invoke-WebRequest -UseBasicParsing -Uri $TailscaleUri -OutFile $TailscaleMsi
|
||||
|
||||
Write-Host "Installing Tailscale from MSI to $TailscaleInstalledExe, see log at $TailscaleInstallLog"
|
||||
Start-Process msiexec.exe -ArgumentList '/i', $TailscaleMsi, '/qn', '/l*v', $TailscaleInstallLog -Wait -NoNewWindow -PassThru
|
||||
|
||||
Write-Host 'Joining host to tailscale network'
|
||||
Start-Process $TailscaleInstalledExe -ArgumentList 'up', '--authkey', $TailscaleAuthKey, '--accept-dns=false', '--accept-routes', '--unattended' -NoNewWindow -PassThru -Wait
|
||||
|
||||
# FIXME(jona): Tailscale auth key should not be stored in registry in plain text
|
||||
Write-Host 'Creating login script to authenticate to tailscale'
|
||||
$TailscaleLoginCmd = ('"{0}" login --auth-key "{1}"' -f $TailscaleInstalledExe, $TailscaleAuthKey)
|
||||
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" `
|
||||
-Name "TailscaleLogin" `
|
||||
-Value "cmd /c $TailscaleLoginCmd" `
|
||||
-PropertyType String -Force
|
||||
|
||||
Write-Host 'Done setting up tailscale'
|
||||
|
||||
##
|
||||
# AMD GPU driver
|
||||
Write-Host 'Installing AMD GPU driver'
|
||||
|
||||
Write-Host "Downloading AMD GPU driver installer from $AndDriverUri to $AmdDriverExe"
|
||||
Invoke-WebRequest -UseBasicParsing -Uri $AmdDriverUri -OutFile $AmdDriverExe
|
||||
|
||||
Write-Host "Installing AMD GPU driver from, see log at $AmdDriverInstallLog"
|
||||
Start-Process $AmdDriverExe -ArgumentList '-install', '-log', $AmdDriverInstallLog -Wait -NoNewWindow -PassThru
|
||||
|
||||
Write-Host 'Done installing AMD GPU driver'
|
||||
|
||||
##
|
||||
# Sunshine
|
||||
Write-Host "Installing Sunshine"
|
||||
Write-Host "Downloading sunshine installer from $SunshineInstallerUri to $SunshineInstallerExe"
|
||||
Invoke-WebRequest -UseBasicParsing -Uri $SunshineInstallerUri -OutFile $SunshineInstallerExe
|
||||
|
||||
Write-Host "Installing Sunshine from $SunshineInstallerExe"
|
||||
Start-Process $SunshineInstallerExe -ArgumentList '/S' -Wait -NoNewWindow -PassThru
|
||||
|
||||
Write-Host 'Done installing Sunshine, configure at https://localhost:47990/'
|
||||
|
||||
##
|
||||
# Steam
|
||||
Write-Host "Installing Steam"
|
||||
Write-Host "Downloading Steam installer from $SteamInstallerUri to $SteamInstallerExe"
|
||||
Invoke-WebRequest -UseBasicParsing -Uri $SteamInstallerUri -OutFile $SteamInstallerExe
|
||||
|
||||
Write-Host "Installing Steam from $SteamInstallerExe"
|
||||
Start-Process $SteamInstallerExe -ArgumentList '/S' -Wait -NoNewWindow -PassThru
|
||||
|
||||
Write-Host 'Done installing Steam'
|
||||
|
||||
Write-Host 'Done provisioning software'
|
||||
Reference in New Issue
Block a user