From 6c2a895e516ee4694ce1418ac318a0bcc8a004bf Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Tue, 24 Sep 2024 15:40:25 +0800 Subject: [PATCH] Update InstallToDir.pl --- InstallToDir.pl | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/InstallToDir.pl b/InstallToDir.pl index 019ec4249..abc506673 100644 --- a/InstallToDir.pl +++ b/InstallToDir.pl @@ -24,8 +24,10 @@ sub process_dir { print "Installing $ver AMAI to dir $dirname\\$filename\n"; process_dir ($ver, "$dirname\\$filename", $commander); } elsif ($filename =~ m/\.w3m$/ || $filename =~ m/\.w3x$/ ) { - if (!(defined($commander)) || $commander eq "true") { + if (!(defined($commander)) || $commander eq "1") { print "Installing $ver AMAI and Commander to $dirname/$filename\n"; + } elsif (!(defined($commander)) || $commander eq "2") { + print "Installing $ver AMAI and Commander - VS AI to $dirname/$filename\n"; } else { print "Installing $ver AMAI without Commander to $dirname/$filename\n"; } @@ -45,7 +47,7 @@ sub process_dir { } elsif ($? >> 8 > 0) { printf "ERROR: Unknown. AMAI not have installed correctly. Adding ai scripts:%d\n", $? >> 8; } - if (!(defined($commander)) || $commander eq "true") { + if (!(defined($commander)) || $commander eq "1") { system "MPQEditor a \"$dirname/$filename\" Scripts\\$ver\\Blizzard.j Scripts\\Blizzard.j"; if ($? == -1) { printf "Unable to spawn MPQEditor process"; @@ -54,6 +56,15 @@ sub process_dir { } elsif ($? >> 8 > 0) { printf "ERROR: Unknown. AMAI not have installed correctly. Adding commander:%d\n", $? >> 8; } + } elsif (!(defined($commander)) || $commander eq "2") { + system "MPQEditor a \"$dirname/$filename\" Scripts\\$ver\\Blizzard_VSAI.j Scripts\\Blizzard.j"; + if ($? == -1) { + printf "Unable to spawn MPQEditor process"; + } elsif ($? >> 8 == 5) { + printf "ERROR: Failed to add commander - VS AI, you may not have valid permissions or are blocked by windows UAC. Ensure map files are not in a UAC protected location %d\n", $? >> 8; + } elsif ($? >> 8 > 0) { + printf "ERROR: Unknown. AMAI not have installed correctly. Adding commander - VS AI:%d\n", $? >> 8; + } } system "MPQEditor f \"$dirname/$filename\""; if ($? == -1) {