Use wget again for windows [skip ci]

This commit is contained in:
Akkadius 2020-05-23 16:29:04 -05:00
parent 4603fa2ef8
commit b585d9b062

View File

@ -84,6 +84,7 @@ if (-d "bin") {
############################################# #############################################
# run routines # run routines
############################################# #############################################
get_windows_wget();
check_xml_to_json_conversion() if $ARGV[0] eq "convert_xml"; check_xml_to_json_conversion() if $ARGV[0] eq "convert_xml";
do_self_update_check_routine() if !$skip_self_update_check; do_self_update_check_routine() if !$skip_self_update_check;
get_perl_version(); get_perl_version();
@ -699,6 +700,16 @@ sub get_perl_version
no warnings; no warnings;
} }
sub get_windows_wget {
if (!-e "wget.exe" && $OS eq "Windows") {
eval "use LWP::Simple qw(getstore);";
if (!-d "bin") {
mkdir("bin");
}
getstore("https://raw.githubusercontent.com/Akkadius/eqemu-install-v2/master/windows/wget.exe", "bin/wget.exe");
}
}
sub do_self_update_check_routine sub do_self_update_check_routine
{ {
@ -1048,10 +1059,6 @@ sub show_menu_prompt
fetch_latest_windows_appveyor(); fetch_latest_windows_appveyor();
$dc = 1; $dc = 1;
} }
elsif ($input eq "windows_server_download_bots") {
fetch_latest_windows_binaries_bots();
$dc = 1;
}
elsif ($input eq "windows_server_latest_bots") { elsif ($input eq "windows_server_latest_bots") {
fetch_latest_windows_appveyor_bots(); fetch_latest_windows_appveyor_bots();
$dc = 1; $dc = 1;
@ -1626,13 +1633,13 @@ sub fetch_latest_windows_binaries
sub fetch_latest_windows_appveyor_bots sub fetch_latest_windows_appveyor_bots
{ {
print "[Update] Fetching Latest Windows Binaries with Bots (unstable) from Appveyor... \n"; print "[Update] Fetching Latest Windows Binaries with Bots (unstable) from Appveyor... \n";
get_remote_file("https://ci.appveyor.com/api/projects/KimLS/server/artifacts/eqemu-x86-bots.zip", get_remote_file("https://ci.appveyor.com/api/projects/KimLS/server-87crp/artifacts/build_x64.zip",
"updates_staged/eqemu-x86-bots.zip", "updates_staged/eqemu-x64-bots.zip",
1); 1);
print "[Update] Fetched Latest Windows Binaries (unstable) from Appveyor... \n"; print "[Update] Fetched Latest Windows Binaries (unstable) from Appveyor... \n";
print "[Update] Extracting... --- \n"; print "[Update] Extracting... --- \n";
unzip('updates_staged/eqemu-x86-bots.zip', 'updates_staged/binaries/'); unzip('updates_staged/eqemu-x64-bots.zip', 'updates_staged/binaries/');
my @files; my @files;
my $start_dir = "updates_staged/binaries"; my $start_dir = "updates_staged/binaries";
find( find(
@ -1650,33 +1657,6 @@ sub fetch_latest_windows_appveyor_bots
rmtree('updates_staged'); rmtree('updates_staged');
} }
sub fetch_latest_windows_binaries_bots
{
print "[Update] Fetching Latest Windows Binaries with Bots...\n";
get_remote_file($install_repository_request_url . "master_windows_build_bots.zip",
"updates_staged/master_windows_build_bots.zip",
1);
print "[Update] Fetched Latest Windows Binaries with Bots...\n";
print "[Update] Extracting...\n";
unzip('updates_staged/master_windows_build_bots.zip', 'updates_staged/binaries/');
my @files;
my $start_dir = "updates_staged/binaries";
find(
sub {push @files, $File::Find::name unless -d;},
$start_dir
);
for my $file (@files) {
$destination_file = $file;
$destination_file =~ s/updates_staged\/binaries\///g;
print "[Install] Installing [" . $bin_dir . $destination_file . "]\n";
copy_file($file, $bin_dir . $destination_file);
}
print "[Update] Done...\n";
rmtree('updates_staged');
}
sub do_windows_login_server_setup sub do_windows_login_server_setup
{ {
print "[Install] Pulling down Loginserver database tables...\n"; print "[Install] Pulling down Loginserver database tables...\n";