Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update League Of Legends #797

Closed
wants to merge 5 commits into from
Closed
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
112 changes: 38 additions & 74 deletions Applications/Games/League of Legends/Online/script.js
Original file line number Diff line number Diff line change
@@ -1,118 +1,82 @@
const CustomInstallerScript = include("engines.wine.quick_script.custom_installer_script");
const {LATEST_STAGING_VERSION} = include("engines.wine.engine.versions");
const {fileName, mkdir, writeToFile} = include("utils.functions.filesystem.files");
const Resource = include("utils.functions.net.resource");

include("engines.wine.plugins.csmt");
include("engines.wine.plugins.override_dll");
include("engines.wine.plugins.windows_version");
include("engines.wine.verbs.sandbox");
include("engines.wine.verbs.d3dx9");
include("engines.wine.verbs.corefonts");
include("engines.wine.verbs.d9vk");

// Installs League of Legends

new CustomInstallerScript()
.name("League of Legends")
.editor("Riot Games")
.applicationHomepage("http://leagueoflegends.com/")
.author("Plata, feanor12, Thog")
.author("Plata, feanor12, Thog, TheRuntimeIsNotWorkingRey, ImperatorS79, Zemogiter, Kreyren")
.installationCommand(function (wizard) {
// Select the region and download the setup file
////////////////////////////////////////////////
var regions = [
"EU West",
"Latin America North",
"Latin America South",
"Oceania",
"Japan",
"Turkey",
"Brasil",
"EU Nordic & East",
"North America",
"Russia"
];
var selectedRegion = wizard.menu(tr("Select your region:"), regions);
var regionID, url, sha1;
var baseUrl = "https://riotgamespatcher-a.akamaihd.net/ShellInstaller/";
switch (selectedRegion.text) {
let url, regionID;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move these directly over the switch statement where they are set

/// Select the region and download the setup file
const regions = ["EU West",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For better readability:

const region = [
   "EU West",
   ...
];

"Latin America North",
// "Latin America South", URL not found
"Oceania",
"Japan",
"Turkey",
"Brasil",
"EU Nordic & East",
"North America",
"Russia"];
const selectedRegion = wizard.menu(tr("Select your region:"), regions);
const baseUrl = "https://riotgamespatcher-a.akamaihd.net/releases/live/installer/deploy/League%20of%20Legends%20installer%20";
switch (selectedRegion.text){
case "EU West":
regionID = "EUW";
url = baseUrl + "EUW/LeagueofLegends_EUW_Installer_2016_11_10.exe";
sha1 = "e8cb081395849f3753f8c00d558901b8c3df69e3";
break;
case "Latin America North":
regionID = "LA1";
url = baseUrl + "LA1/LeagueofLegends_LA1_Installer_2016_05_26.exe";
sha1 = "996ece64ba2ba9c8b9195c3519a6d7637d82b8d3";
break;
case "Latin America South":
regionID = "LA2";
url = baseUrl + "LA2/LeagueofLegends_LA2_Installer_2016_05_27.exe";
sha1 = "5c5e007ee266315b6433dd87e6692753170aab78";
break;
case "Oceania":
regionID = "OC1";
url = baseUrl + "OC1/LeagueofLegends_OC1_Installer_2016_05_13.exe";
sha1 = "74b9a327e66fc527edb86e9ea45c9798bdffec5f";
url = baseUrl+"EUW.exe";
break;
case "Japan":
regionID = "JP";
url = baseUrl + "JP/LeagueofLegends_JP_Installer_2016_05_31.exe";
sha1 = "da25b973358837ef9abbb9cb3d55aae214a75de0";
url = baseUrl+"JP.exe";
break;
case "Turkey":
regionID = "TR";
url = baseUrl + "TR/LeagueofLegends_TR_Installer_2016_11_08.exe";
sha1 = "93fe9b3e581fa5cd41c504ef91ce55e4227b43e3";
url = baseUrl+"TR.exe";
break;
case "Brasil":
regionID = "BR";
url = baseUrl + "BR/LeagueofLegends_BR_Installer_2016_05_13.exe";
sha1 = "fbef6186cb690b4259e63d53d8c73e556e1d5ddc";
url = baseUrl+"BR.exe";
break;
case "EU Nordic & East":
regionID = "EUNE";
url = baseUrl + "EUNE/LeagueofLegends_EUNE_Installer_2016_11_10.exe";
sha1 = "17727c665ce59e3faf95c2c0db2fe5509383e750";
url = baseUrl+"EUNE.exe";
break;
case "North America":
regionID = "NA";
url = baseUrl + "NA/LeagueofLegends_NA_Installer_2016_05_13.exe";
sha1 = "70a253f29351f1d6952fa1af39fb8b2b01bc6cde";
url = baseUrl+"NA.exe";
break;
case "Russia":
regionID = "RU";
url = baseUrl + "RU/LeagueofLegends_RU_Installer_2016_05_13.exe";
sha1 = "2d462decf629cab880386407598f9c5ea6db2ef5";
url = baseUrl+"RU.exe";
break;
case "Oceania":
regionID = "OCE1";
url = baseUrl+"OCE1.exe";
break;
case "Latin America North":
regionID = "LA1";
url = baseUrl+"LA1.exe";
break;
}
var setupFile = new Resource()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add an empty line for readability purposes and const

.wizard(wizard)
.url(url)
.checksum(sha1)
.name(fileName(url))
.name("League%20of%20Legends%20installer%20" + regionID + ".exe")
.get();

return { command: setupFile, args: ["--installdir", "C:\\LoL\\", "--mode", "unattended"] };
return {command: setupFile};
})
.executable("LeagueClient.exe")
.category("Games")
.wineDistribution("staging")
.wineVersion(LATEST_STAGING_VERSION)
.preInstall(function (wine /*, wizard*/) {
wine.windowsVersion("winxp");
wine.d3dx9();
wine
.overrideDLL()
.set("native, builtin", ["atl120", "msvcp120", "msvcr120", "vcomp120", "msvcp140"])
.do();
wine.enableCSMT();

mkdir(wine.prefixDirectory() + "drive_c/LoL");

// Create run script to start the right exe
/////////////////////////////////////////
var client = wine.prefixDirectory() + "drive_c/LoL/run.bat";
var batContent = "start C:\\LoL\\LeagueClient.exe";
writeToFile(client, batContent);
wine.corefonts();
wine.D9VK();
})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

});

.executable("run.bat");