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