Skip to content

Commit

Permalink
Update InstallToDir.pl
Browse files Browse the repository at this point in the history
  • Loading branch information
jzy-chitong56 authored Sep 24, 2024
1 parent 12eb0ac commit 6c2a895
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions InstallToDir.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
Expand All @@ -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";
Expand All @@ -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) {
Expand Down

0 comments on commit 6c2a895

Please sign in to comment.