Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install Script for Windows Powershell (Script included) #110

Open
floriankraemer opened this issue Sep 17, 2023 · 0 comments
Open

Install Script for Windows Powershell (Script included) #110

floriankraemer opened this issue Sep 17, 2023 · 0 comments

Comments

@floriankraemer
Copy link

I like to automate my stuff, so I asked ChatGTP to write me a Powershell script to do the work for me. I ran it only on Windows 11. It might help somebody else. It also includes sultim-t/RayTracedGL1#22

powershell.exe -ExecutionPolicy Bypass -File .\prboom-rtx.ps1`

Put the script in a file ending with ps1 and execute it with the command above.

# Define the URL of the prboom-rt file to download
$prboomFileUrl = "https://github.com/sultim-t/prboom-plus-rt/releases/download/v2.6.1-rt1.0.7/prboom-rt-1.0.7.zip"

# Define the URL of the nvngx_dlss.dll file to download
$dlssDllUrl = "https://github.com/NVIDIA/DLSS/raw/main/lib/Windows_x86_64/rel/nvngx_dlss.dll"

# Define the URL of the RayTracedGL1-DLSS.zip file to download
# Please see: https://github.com/sultim-t/RayTracedGL1/issues/22
$rayTracedGL1ZipUrl = "https://github.com/sultim-t/RayTracedGL1/files/10120309/RayTracedGL1.zip"

# Set the destination folder to the current directory
$destinationFolder = $PSScriptRoot

# Create the "Prboom" folder if it doesn't exist
$prboomFolder = Join-Path -Path $destinationFolder -ChildPath "Prboom"
if (-not (Test-Path -Path $prboomFolder -PathType Container)) {
    New-Item -Path $prboomFolder -ItemType Directory
}

# Download the prboom-rt file to the "Prboom" folder
$prboomDownloadedFilePath = Join-Path -Path $prboomFolder -ChildPath "prboom-rt.zip"
Invoke-WebRequest -Uri $prboomFileUrl -OutFile $prboomDownloadedFilePath

# Unpack the downloaded prboom-rt file (assuming it's a ZIP file) within the "Prboom" folder
Expand-Archive -Path $prboomDownloadedFilePath -DestinationPath $prboomFolder -Force

# Download the nvngx_dlss.dll file to the "Prboom" folder
Invoke-WebRequest -Uri $dlssDllUrl -OutFile (Join-Path -Path $prboomFolder -ChildPath "nvngx_dlss.dll")

# Download the RayTracedGL1-DLSS.zip file
$rayTracedGL1ZipPath = Join-Path -Path $prboomFolder -ChildPath "RayTracedGL1-DLSS.zip"
Invoke-WebRequest -Uri $rayTracedGL1ZipUrl -OutFile $rayTracedGL1ZipPath

# Unpack the downloaded zip file to a temporary folder
$unzipFolder = Join-Path -Path $prboomFolder -ChildPath "TempUnzip"
Expand-Archive -Path $rayTracedGL1ZipPath -DestinationPath $unzipFolder -Force

# Copy only the RayTracedGL1.dll to the Prboom folder and override any existing file
Copy-Item -Path (Join-Path -Path $unzipFolder -ChildPath "RayTracedGL1.dll") -Destination $prboomFolder -Force

# Remove the temporary unzip folder
Remove-Item -Path $unzipFolder -Recurse -Force

# Remove the downloaded zip file
Remove-Item -Path $rayTracedGL1ZipPath

# Provide feedback
Write-Host "Files downloaded and extracted successfully."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant