Files
public/Among Us - TOHE.ps1

1 line
1.1 KiB
PowerShell

$gameName = "Among Us";$registryPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall";$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}