-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
116 additions
and
116 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,117 +1,117 @@ | ||
Add-Type -AssemblyName System.IO.Compression.FileSystem | ||
|
||
$request = 'https://api.github.com/repos/Eisbison/TheOtherRoles/releases/latest' | ||
$Jsontest = Invoke-RestMethod $request | ||
$JSONDownload = Write-Output $Jsontest.assets.browser_download_url | ||
$id = Write-Output $Jsontest.id | ||
$exefile = "" | ||
|
||
function Unzip | ||
{ | ||
param([string]$zipfile, [string]$outpath) | ||
Expand-Archive -Path $zipfile -DestinationPath $outpath -Force | ||
} | ||
|
||
function ClearOtherMods | ||
{ | ||
if (Test-Path "./mono") { | ||
Remove-Item "./mono" -Recurse | ||
} | ||
if(Test-Path "./BepInEx"){ | ||
if(Test-Path "./BepInEx/core"){ | ||
Remove-Item "./BepInEx/core" -Recurse | ||
} | ||
if(Test-Path "./BepInEx/plugin"){ | ||
Remove-Item "./BepInEx/plugin" -Recurse | ||
} | ||
if(Test-Path "./BepInEx/unity-libs"){ | ||
Remove-Item "./BepInEx/unity-libs" -Recurse | ||
} | ||
if(Test-Path "./BepInEx"){ | ||
if(Test-Path "./BepInEx/cache"){ | ||
Remove-Item "./BepInEx/cache" -Recurse | ||
} | ||
if(Test-Path "./BepInEx/patchers"){ | ||
Remove-Item "./BepInEx/patchers" -Recurse | ||
} | ||
if(Test-Path "./BepInEx/plugins"){ | ||
Remove-Item "./BepInEx/plugins" -Recurse | ||
} | ||
if(Test-Path "./BepInEx/config"){ | ||
if(Test-Path "./BepInEx/config/BepInEx.cfg") { | ||
Remove-Item "./BepInEx/config/BepInEx.cfg" -Recurse | ||
} | ||
if(Test-Path "./BepInEx/config/gg.reactor.api.cfg"){ | ||
Remove-Item "./BepInEx/config/gg.reactor.api.cfg" -Recurse | ||
} | ||
if(Test-Path "./BepInEx/config/me.eisbison.theotherroles.cfg"){ | ||
Remove-Item "./BepInEx/config/me.eisbison.theotherroles.cfg" -Recurse | ||
} | ||
} | ||
} | ||
} | ||
|
||
} | ||
|
||
function getOtherMods { | ||
ClearOtherMods | ||
if(Test-Path ".\otherroles.zip"){ | ||
Remove-Item ".\otherroles.zip" -force | ||
} | ||
Invoke-WebRequest -Uri $JSONDownload -OutFile .\otherroles.zip | ||
(get-item .\otherroles.zip).Attributes += 'Hidden' | ||
Write-Host "Please Wait ..." | ||
|
||
Unzip ".\otherroles.zip" "." | ||
} | ||
|
||
function overwriteVersion { | ||
if(Test-Path .\version.txt){ | ||
Remove-Item .\version.txt -force | ||
Write-Output $Jsontest.id | Out-File -FilePath .\version.txt | ||
(get-item .\version.txt).Attributes += 'Hidden' | ||
} else { | ||
Write-Output $Jsontest.id | Out-File -FilePath .\version.txt | ||
(get-item .\version.txt).Attributes += 'Hidden' | ||
} | ||
} | ||
|
||
|
||
Write-Host "Among Us Mod Updater created by Jolle & Narua" | ||
|
||
|
||
if(Test-Path ".\version.txt"){ | ||
$idfile = Get-Content -Path .\version.txt | ||
if("$($idfile)" -ne "$($id)") { | ||
overwriteVersion | ||
Write-Host "Old files will be deleted ..." | ||
Write-Host "`n `n `n `n `n `n `n `n `n Please Wait ..." | ||
getOtherMods | ||
} else { | ||
if (((Test-Path "./mono") -eq $False) -or ((Test-Path "./BepInEx") -eq $False)) { | ||
echo "Cannot find Mono or BepInEx directories ..." | ||
getOtherMods | ||
} | ||
} | ||
} else { | ||
overwriteVersion | ||
Write-Host "`n `n `n `n `n `n `n `n `n Please Wait ..." | ||
getOtherMods | ||
} | ||
|
||
Try{ | ||
$exefile = Get-Childitem -Path ".\Among Us.exe" -ErrorAction Stop -Include *.exe -Recurse | ||
} | ||
catch [System.Exception]{ | ||
Write-Host "Among Us.exe not found ... Check game directory for Among Us.exe ..." | ||
Start-Sleep 10 | ||
} | ||
|
||
if("$($exefile)" -ne ""){ | ||
Write-Host "$($exefile)" | ||
Start-Process -FilePath "$($exefile)" | ||
Write-Host "Game is starting..." | ||
Start-Sleep 10 | ||
Write-Host "After fresh update game loads slower ..." | ||
Start-Sleep 25 | ||
Add-Type -AssemblyName System.IO.Compression.FileSystem | ||
|
||
$request = 'https://api.github.com/repos/Eisbison/TheOtherRoles/releases/latest' | ||
$Jsontest = Invoke-RestMethod $request | ||
$JSONDownload = Write-Output $Jsontest.assets.browser_download_url | ||
$id = Write-Output $Jsontest.id | ||
$exefile = "" | ||
|
||
function Unzip | ||
{ | ||
param([string]$zipfile, [string]$outpath) | ||
Expand-Archive -Path $zipfile -DestinationPath $outpath -Force | ||
} | ||
|
||
function ClearOtherMods | ||
{ | ||
if (Test-Path "./mono") { | ||
Remove-Item "./mono" -Recurse | ||
} | ||
if(Test-Path "./BepInEx"){ | ||
if(Test-Path "./BepInEx/core"){ | ||
Remove-Item "./BepInEx/core" -Recurse | ||
} | ||
if(Test-Path "./BepInEx/plugin"){ | ||
Remove-Item "./BepInEx/plugin" -Recurse | ||
} | ||
if(Test-Path "./BepInEx/unity-libs"){ | ||
Remove-Item "./BepInEx/unity-libs" -Recurse | ||
} | ||
if(Test-Path "./BepInEx"){ | ||
if(Test-Path "./BepInEx/cache"){ | ||
Remove-Item "./BepInEx/cache" -Recurse | ||
} | ||
if(Test-Path "./BepInEx/patchers"){ | ||
Remove-Item "./BepInEx/patchers" -Recurse | ||
} | ||
if(Test-Path "./BepInEx/plugins"){ | ||
Remove-Item "./BepInEx/plugins" -Recurse | ||
} | ||
if(Test-Path "./BepInEx/config"){ | ||
if(Test-Path "./BepInEx/config/BepInEx.cfg") { | ||
Remove-Item "./BepInEx/config/BepInEx.cfg" -Recurse | ||
} | ||
if(Test-Path "./BepInEx/config/gg.reactor.api.cfg"){ | ||
Remove-Item "./BepInEx/config/gg.reactor.api.cfg" -Recurse | ||
} | ||
if(Test-Path "./BepInEx/config/me.eisbison.theotherroles.cfg"){ | ||
Remove-Item "./BepInEx/config/me.eisbison.theotherroles.cfg" -Recurse | ||
} | ||
} | ||
} | ||
} | ||
|
||
} | ||
|
||
function getOtherMods { | ||
ClearOtherMods | ||
if(Test-Path ".\otherroles.zip"){ | ||
Remove-Item ".\otherroles.zip" -force | ||
} | ||
Invoke-WebRequest -Uri $JSONDownload -OutFile .\otherroles.zip | ||
(get-item .\otherroles.zip).Attributes += 'Hidden' | ||
Write-Host "Please Wait ..." | ||
|
||
Unzip ".\otherroles.zip" "." | ||
} | ||
|
||
function overwriteVersion { | ||
if(Test-Path .\version.txt){ | ||
Remove-Item .\version.txt -force | ||
Write-Output $Jsontest.id | Out-File -FilePath .\version.txt | ||
(get-item .\version.txt).Attributes += 'Hidden' | ||
} else { | ||
Write-Output $Jsontest.id | Out-File -FilePath .\version.txt | ||
(get-item .\version.txt).Attributes += 'Hidden' | ||
} | ||
} | ||
|
||
|
||
Write-Host "Among Us Mod Updater created by Jolle & Narua" | ||
|
||
|
||
if(Test-Path ".\version.txt"){ | ||
$idfile = Get-Content -Path .\version.txt | ||
if("$($idfile)" -ne "$($id)") { | ||
overwriteVersion | ||
Write-Host "Old files will be deleted ..." | ||
Write-Host "`n `n `n `n `n `n `n `n `n Please Wait ..." | ||
getOtherMods | ||
} else { | ||
if (((Test-Path "./mono") -eq $False) -or ((Test-Path "./BepInEx") -eq $False)) { | ||
echo "Cannot find Mono or BepInEx directories ..." | ||
getOtherMods | ||
} | ||
} | ||
} else { | ||
overwriteVersion | ||
Write-Host "`n `n `n `n `n `n `n `n `n Please Wait ..." | ||
getOtherMods | ||
} | ||
|
||
Try{ | ||
$exefile = Get-Childitem -Path ".\Among Us.exe" -ErrorAction Stop -Include *.exe -Recurse | ||
} | ||
catch [System.Exception]{ | ||
Write-Host "Among Us.exe not found ... Check game directory for Among Us.exe ..." | ||
Start-Sleep 10 | ||
} | ||
|
||
if("$($exefile)" -ne ""){ | ||
Write-Host "$($exefile)" | ||
Start-Process -FilePath "$($exefile)" | ||
Write-Host "Game is starting..." | ||
Start-Sleep 10 | ||
Write-Host "After fresh update game loads slower ..." | ||
Start-Sleep 25 | ||
} |