Add question to install modules

This commit is contained in:
Jonny_Bro (Nikita) 2024-03-28 00:00:57 +05:00
parent 7c33676c4e
commit 75860e5e59
No known key found for this signature in database
GPG key ID: 3F1ECC04147E9BD8

View file

@ -266,7 +266,7 @@ Class VdfTextReader
function GetCount($thing) {
$aux = $($thing | Get-Member -MemberType NoteProperty);
$count = 0;
if ($aux -eq $null) {
if ($null -eq $aux) {
$count = 0;
} elseif ( $aux -is [PSCustomObject] ) {
$count = 1;
@ -301,10 +301,10 @@ for ($i = 0; $i -lt $libcount; $i++) {
$GMODPath = $Install.path + "\\steamapps\\common\\GarrysMod";
$AddonsPath = $GMODPath + "\\garrysmod\\addons";
$_text = "Do you want to install in this path? It will completely wipe the previous Beatrun install if you had one! `n" + $GMODPath.replace('\\', '\') + " (y/n)";
$_text = "Do you want to install in this path? It will completely wipe the previous Beatrun install if you had one! `n" + $GMODPath.replace("\\", "\") + " (y/n)";
$GMODConfirmation = Read-Host $_text;
if ($GMODConfirmation -eq 'y') {
if ($GMODConfirmation -eq "y") {
$TempPath = $GMODPath + "\\temp\\";
$ZIPPath = $TempPath + "beatrun.zip";
$FolderPath = $TempPath + "beatrun";
@ -323,9 +323,12 @@ for ($i = 0; $i -lt $libcount; $i++) {
Rename-Item $FolderMainPath $FolderPath;
Remove-Item $ZIPPath;
$confirmation = Read-Host "Do you want to install modules? (Discord + Steam Presence) (y/n)";
if ($confirmation -eq "y") {
$ModulesPath = $FolderPath + "\\lua\\*";
$NewModulesPath = $GMODPath + "\\garrysmod\\lua\\";
Copy-Item -Path $ModulesPath -Destination $NewModulesPath -Force -Recurse;
}
$AddonPath = $FolderPath + "\\beatrun";
$NewAddonPath = $AddonsPath + "\\beatrun";
@ -338,8 +341,8 @@ for ($i = 0; $i -lt $libcount; $i++) {
Write-Host Beatrun Installed!;
$confirmation = Read-Host "Do you want custom animations? (y/n):";
if ($confirmation -eq 'y') {
$confirmation = Read-Host "`nDo you want to change animations? (y/n)";
if ($confirmation -eq "y") {
Set-Location -Path $NewAddonPath;
$AnimChangerPath = $NewAddonPath + "\\BeatrunAnimInstaller.exe";
Start-Process -FilePath $AnimChangerPath -WorkingDirectory $NewAddonPath