From cbd7443c735593a37fc7e2c78b45477f179fd9df Mon Sep 17 00:00:00 2001 From: Michael Resta Date: Mon, 7 Oct 2024 14:31:42 +0000 Subject: [PATCH] Upload files to "/" --- Among Us - TOHE.ps1 | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Among Us - TOHE.ps1 diff --git a/Among Us - TOHE.ps1 b/Among Us - TOHE.ps1 new file mode 100644 index 0000000..7cd9277 --- /dev/null +++ b/Among Us - TOHE.ps1 @@ -0,0 +1,24 @@ +$gameName = "Among Us" +$registryPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" + +# Search for the game in the registry +$gameKey = Get-ChildItem $registryPath | Where-Object {(Get-ItemProperty $_.PSPath).DisplayName -like "*$gameName*"} +$GamePath = (Get-ItemProperty $gameKey.PSPath).InstallLocation +if ($GamePath) + { + $ModURL = "https://github.com/EnhancedNetwork/TownofHost-Enhanced/releases/download/v2.0.3/TOH-Enhanced.2.0.3.zip" + $Temp = "C:\Temp\Among Us" + $installPath = $GamePath -replace ".{9}$" + Remove-Item "$installPath\TOHE" -Recurse -Force -ErrorAction SilentlyContinue + Remove-Item "C:\Users\$env:Username\Desktop\Among Us - TOHE" -Recurse -Force -ErrorAction SilentlyContinue + New-Item $Temp -ItemType Directory -Force -ErrorAction SilentlyContinue + Curl -Uri $ModURL -OutFile "$Temp\File.zip" + Copy-Item -Path "$installPath\$gameName" -Destination "$installPath\TOHE" -Recurse + Expand-Archive "$Temp\File.zip" -DestinationPath "$installPath\TOHE" + New-Item -ItemType SymbolicLink -Path "C:\Users\$env:Username\Desktop" -Name "Among Us - TOHE" -Value "$installPath\TOHE\Among Us.exe" + Remove-Item "$Temp" -Recurse + } +else + { + Write-Output "Cannot autodetect the game's install location. Please manually install the mods." + } \ No newline at end of file