Skip to content

Commit

Permalink
Merge branch 'master' into 5.0-alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
plata committed Sep 11, 2018
2 parents 0e53a47 + e120aa5 commit 9639e62
Show file tree
Hide file tree
Showing 17 changed files with 318 additions and 121 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ matrix:
before_install: npm install -g json-align
script:
- find . -name "*.json" -print0 | xargs -0 json-align -i
- git diff
- diffs=$(git diff --name-only | wc -l); if [ $diffs != 0 ]; then exit 1; fi
after_failure:
- echo "Some JSON files are not aligned. Please run json-align."
Expand Down
2 changes: 1 addition & 1 deletion Applications/Games/Epic Games Launcher/Online/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var installerImplementation = {
.applicationHomepage("https://www.unrealengine.com/download")
.author("Plata")
.url("https://launcher-public-service-prod06.ol.epicgames.com/launcher/api/installer/download/EpicGamesLauncherInstaller.msi")
.checksum("15da9dd4eac2ea4da80b602a274235c8537be156")
.checksum("08ee775d59a142032f179baa9a85464ae5dc5940")
.installationArgs(["/q"])
.category("Games")
.executable("EpicGamesLauncher.exe", ["-SkipBuildPatchPrereq", "-OpenGL"])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var installerImplementation = {
.to(wine.prefixDirectory() + "drive_c/users/Public/Documents/EAW_RAM_MPLobby_update.exe")
.get();

wine.runInsidePrefix("/users/Public/Documents/EAW_RAM_MPLobby_update.exe");
wine.runInsidePrefix("/users/Public/Documents/EAW_RAM_MPLobby_update.exe", [], true);
})
.go();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var installerImplementation = {
.to(wine.prefixDirectory() + "drive_c/Program Files/LucasArts/Star Wars Battlefront II/BFIIUpdateInt1_1.exe")
.get();

wine.runInsidePrefix("/Program Files/LucasArts/Star Wars Battlefront II/BFIIUpdateInt1_1.exe");
wine.runInsidePrefix("/Program Files/LucasArts/Star Wars Battlefront II/BFIIUpdateInt1_1.exe", [], true);

})
.go();
Expand Down
4 changes: 2 additions & 2 deletions Applications/Games/Subnautica/Steam/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var installerImplementation = {
.author("Zemogiter")
.applicationHomepage("https://unknownworlds.com/subnautica/")
.wineDistribution("upstream")
.wineVersion(3.1)
.wineVersion(3.9)
.wineArchitecture("amd64")
.appId(264710)
.preInstall(function (wine/*, wizard*/) {
Expand All @@ -32,7 +32,7 @@ var installerImplementation = {

})
.gameOverlay(false)
.executable("Steam.exe", ["-silent", "-applaunch", 264710, "-no-ces-sandbox", "-force-opengl"])
.executable("Steam.exe", ["-silent", "-applaunch", 264710, "-no-ces-sandbox"])
.go();
}
};
Expand Down
6 changes: 6 additions & 0 deletions Applications/Games/Subnautica/resources/fix.reg
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@ REGEDIT4

[HKEY_CURRENT_USER\Software\Wine\X11 Driver]
"UseTakeFocus"="N"

[HKEY_CURRENT_USER\Software\Wine\AppDefaults\Steam.exe]
"Version"="winxp64"

[HKEY_CURRENT_USER\Software\Wine\AppDefaults\steamwebhelper.exe]
"Version"="winxp64"
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ var installerImplementation = {
wine.overrideDLL()
.set("native", ["inseng"])
.do();
wine.runInsidePrefix("IE 6.0 Full/IE6SETUP.EXE");
wine.runInsidePrefix("IE 6.0 Full/IE6SETUP.EXE", [], true);
wine.overrideDLL()
.set("native,builtin", [
"inetcpl.cpl", "itircl", "itss", "jscript", "mlang",
Expand Down
16 changes: 4 additions & 12 deletions Engines/Wine/Engine/Implementation/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,6 @@ var engineImplementation = {
_wineWebServiceUrl : Bean("propertyReader").getProperty("webservice.wine.url"),
_wizard: null,
_workingContainer: "",
_wineServer: function (subCategory, version, parameter) {
var binary = this.getLocalDirectory(subCategory, version) + "/bin/wineserver";
var processBuilder = new java.lang.ProcessBuilder(Java.to([binary, parameter], "java.lang.String[]"));
var environment = processBuilder.environment();
environment.put("WINEPREFIX", this.getContainerDirectory(this.getWorkingContainer()));
processBuilder.inheritIO();
var wineServerProcess = processBuilder.start();
wineServerProcess.waitFor();
},
getLocalDirectory: function (subCategory, version) {
var parts = subCategory.split("-");
var distribution = parts[0];
Expand Down Expand Up @@ -208,11 +199,13 @@ var engineImplementation = {
var extensionFile = executable.split(".").pop();

if (extensionFile == "msi") {
return this.run("msiexec", ["/i", executable].concat(args), captureOutput);
var msiArgs = org.apache.commons.lang.ArrayUtils.addAll(["/i", executable], args);
return this.run("msiexec", msiArgs, workingDir, captureOutput, wait, userData);
}

if (extensionFile == "bat") {
return this.run("start", ["/Unix", executable].concat(args), captureOutput);
var batArgs = org.apache.commons.lang.ArrayUtils.addAll(["/Unix", executable], args);
return this.run("start", batArgs, workingDir, captureOutput, wait, userData);
}

// do not run 64bit executable in 32bit prefix
Expand Down Expand Up @@ -269,7 +262,6 @@ var engineImplementation = {

if (wait) {
process.waitFor();
this._wineServer(subCategory, version, "-w");
}

if (captureOutput) {
Expand Down
57 changes: 51 additions & 6 deletions Engines/Wine/Engine/Object/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ include(["utils", "functions", "net", "resource"]);
/* exported LATEST_STABLE_VERSION */
var LATEST_STABLE_VERSION = "3.0.2";
/* exported LATEST_DEVELOPMENT_VERSION */
var LATEST_DEVELOPMENT_VERSION = "3.13";
var LATEST_DEVELOPMENT_VERSION = "3.15";
/* exported LATEST_STAGING_VERSION */
var LATEST_STAGING_VERSION = "3.2";

Expand Down Expand Up @@ -128,11 +128,20 @@ Wine.prototype.binPath = function (subCategory, version) {

/**
*
* @param executable
* @param args
* @param {string} executable
* @param {array} [args = []]
* @param {boolean} [wait=false]
*/
Wine.prototype.runInsidePrefix = function (executable, args) {
return this.run(this.prefixDirectory() + "/drive_c/" + executable, args, this.prefixDirectory(), false, true);
Wine.prototype.runInsidePrefix = function (executable, args, wait) {
if (!args) {
args = [];
} else if (typeof args === 'string' || args instanceof String) {
args = [args];
}
if (!wait) {
wait = false;
}
return this.run(this.prefixDirectory() + "/drive_c/" + executable, args, this.prefixDirectory(), false, wait);
};

/**
Expand Down Expand Up @@ -207,12 +216,48 @@ Wine.prototype.programFiles = function () {
}
};

/**
* executes wineserver in current prefix
* @param {string} wineserver parameter
*/
Wine.prototype.wineServer = function (parameter) {
var workingContainerDirectory = this._implementation.getContainerDirectory(this._implementation.getWorkingContainer());
if (fileExists(workingContainerDirectory)) {
var configFactory = Bean("compatibleConfigFileFormatFactory");
var containerConfiguration = configFactory.open(workingContainerDirectory + "/phoenicis.cfg");
var distribution = containerConfiguration.readValue("wineDistribution", "upstream");
var architecture = containerConfiguration.readValue("wineArchitecture", "x86");
var operatingSystem = this._OperatingSystemFetcher.fetchCurrentOperationSystem().getWinePackage();
var subCategory = distribution + "-" + operatingSystem + "-" + architecture;
var version = containerConfiguration.readValue("wineVersion");
var binary = this._implementation.getLocalDirectory(subCategory, version) + "/bin/wineserver";
var processBuilder = new java.lang.ProcessBuilder(Java.to([binary, parameter], "java.lang.String[]"));
var environment = processBuilder.environment();
environment.put("WINEPREFIX", this._implementation.getContainerDirectory(this._implementation.getWorkingContainer()));
processBuilder.inheritIO();
var wineServerProcess = processBuilder.start();
wineServerProcess.waitFor();
}
else {
print("Wine prefix \"" + this.getWorkingContainer() + "\" does not exist!");
}
};

/**
* wait until wineserver finishes
* @returns {Wine}
*/
Wine.prototype.wait = function () {
this.wineServer("-w");
return this;
};

/**
* kill wine server
* @returns {Wine}
*/
Wine.prototype.kill = function () {
this._wineServer("-k");
this.wineServer("-k");
return this;
};

Expand Down
8 changes: 4 additions & 4 deletions Engines/Wine/QuickScript/Installer Script/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ InstallerScript.prototype.go = function () {
var shownArchitectures = ["x86 (recommended)", "amd64"];
var selectedArchitecture = setupWizard.menu(tr("Please select the wine architecture."), shownArchitectures, "x86 (recommended)");
this._wineArchitecture = architectures[selectedArchitecture.index];
wine.architecture(this._wineArchitecture); // do this here to show correct values for distribution

var distributions = wine.availableDistributions();
var distributions = wine.availableDistributions(this._wineArchitecture);
var shownDistributions = [];
for (var distributionIdx in distributions) {
if (distributions[distributionIdx] == "upstream") {
Expand All @@ -51,9 +50,10 @@ InstallerScript.prototype.go = function () {
}
var selectedDistribution = setupWizard.menu(tr("Please select the wine distribution."), shownDistributions, "upstream (recommended)");
this._wineDistribution = distributions[selectedDistribution.index];
wine.distribution(this._wineDistribution); // do this here to show correct values for version

var versions = wine.availableVersions();
var operatingSystemFetcher = Bean("operatingSystemFetcher");
var operatingSystem = operatingSystemFetcher.fetchCurrentOperationSystem().getWinePackage();
var versions = wine.availableVersions(this._wineDistribution + "-" + operatingSystem + "-" + this._wineArchitecture);
var shownVersions = [];
for (var versionIdx in versions) {
if (versions[versionIdx] == LATEST_STABLE_VERSION) {
Expand Down
39 changes: 35 additions & 4 deletions Engines/Wine/QuickScript/Steam Script/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,24 @@ SteamScript.prototype.downloadFinished = function (wine) {
}
};

SteamScript.prototype.configVdf = function (wine) {
if (!this._configVdf) {
// cache config.vdf path (will not change during the installation)
this._configVdf = wine.prefixDirectory() + "/drive_c/" + wine.programFiles() + "/Steam/config/config.vdf";
}
return this._configVdf;
};

// Fix for the "content server unavailable" error (Wine bug 45329)
SteamScript.prototype.fixCertificateIssue = function (wine){
var steamConfigFile = this.configVdf(wine);
var steamConfig = cat(steamConfigFile);
var cmPos = steamConfig.indexOf("\"CM\"");
var csConfig = "\"CS\" \"valve511.steamcontent.com;valve501.steamcontent.com;valve517.steamcontent.com;valve557.steamcontent.com;valve513.steamcontent.com;valve535.steamcontent.com;valve546.steamcontent.com;valve538.steamcontent.com;valve536.steamcontent.com;valve530.steamcontent.com;valve559.steamcontent.com;valve545.steamcontent.com;valve518.steamcontent.com;valve548.steamcontent.com;valve555.steamcontent.com;valve556.steamcontent.com;valve506.steamcontent.com;valve544.steamcontent.com;valve525.steamcontent.com;valve567.steamcontent.com;valve521.steamcontent.com;valve510.steamcontent.com;valve542.steamcontent.com;valve519.steamcontent.com;valve526.steamcontent.com;valve504.steamcontent.com;valve500.steamcontent.com;valve554.steamcontent.com;valve562.steamcontent.com;valve524.steamcontent.com;valve502.steamcontent.com;valve505.steamcontent.com;valve547.steamcontent.com;valve560.steamcontent.com;valve503.steamcontent.com;valve507.steamcontent.com;valve553.steamcontent.com;valve520.steamcontent.com;valve550.steamcontent.com;valve531.steamcontent.com;valve558.steamcontent.com;valve552.steamcontent.com;valve563.steamcontent.com;valve540.steamcontent.com;valve541.steamcontent.com;valve537.steamcontent.com;valve528.steamcontent.com;valve523.steamcontent.com;valve512.steamcontent.com;valve532.steamcontent.com;valve561.steamcontent.com;valve549.steamcontent.com;valve522.steamcontent.com;valve514.steamcontent.com;valve551.steamcontent.com;valve564.steamcontent.com;valve543.steamcontent.com;valve565.steamcontent.com;valve529.steamcontent.com;valve539.steamcontent.com;valve566.steamcontent.com;valve165.steamcontent.com;valve959.steamcontent.com;valve164.steamcontent.com;valve1611.steamcontent.com;valve1601.steamcontent.com;valve1617.steamcontent.com;valve1603.steamcontent.com;valve1602.steamcontent.com;valve1610.steamcontent.com;valve1615.steamcontent.com;valve909.steamcontent.com;valve900.steamcontent.com;valve905.steamcontent.com;valve954.steamcontent.com;valve955.steamcontent.com;valve1612.steamcontent.com;valve1607.steamcontent.com;valve1608.steamcontent.com;valve1618.steamcontent.com;valve1619.steamcontent.com;valve1606.steamcontent.com;valve1605.steamcontent.com;valve1609.steamcontent.com;valve907.steamcontent.com;valve901.steamcontent.com;valve902.steamcontent.com;valve1604.steamcontent.com;valve908.steamcontent.com;valve950.steamcontent.com;valve957.steamcontent.com;valve903.steamcontent.com;valve1614.steamcontent.com;valve904.steamcontent.com;valve952.steamcontent.com;valve1616.steamcontent.com;valve1613.steamcontent.com;valve958.steamcontent.com;valve956.steamcontent.com;valve906.steamcontent.com\"\n";
var newSteamConfig = steamConfig.slice(0, cmPos) + csConfig + steamConfig.slice(cmPos);
writeToFile(steamConfigFile, newSteamConfig)
}

SteamScript.prototype.go = function () {
// default application homepage if not specified
if (!this._applicationHomepage) {
Expand All @@ -94,15 +112,28 @@ SteamScript.prototype.go = function () {
.to(tempFile)
.get();

setupWizard.wait(tr("Please follow the steps of the Steam setup.\n\nUncheck \"Run Steam\" or close Steam completely after the setup so that the installation of \"{0}\" can continue.", this._name));

var wine = new Wine()
.wizard(setupWizard)
.prefix(this._name, this._wineDistribution, this._wineArchitecture, this._wineVersion)
.luna();

// Steam must be started once such that config.vdf is created (see fixCertificateIssue())
setupWizard.wait(tr("Please follow the steps of the Steam setup. Then, wait until Steam is updated, log in and finally close Steam completely so the installation of \"{0}\" can continue.", this._name));
wine.run(tempFile, [], null, false, true);

// ensure that Steam is running (user might have unchecked "run Steam after installation finished")
wine.runInsidePrefix(wine.programFiles() + "/Steam/Steam.exe", ["steam://nav/games"], false);

// wait until config.vdf exists
while (!fileExists(this.configVdf(wine))) {
java.lang.Thread.sleep(1000);
}

// wait until Steam and Wine are closed
wine.wait();

this.fixCertificateIssue(wine);

// Steam installation has finished
setupWizard.wait(tr("Please wait ..."));

Expand All @@ -111,7 +142,7 @@ SteamScript.prototype.go = function () {
// back to generic wait (might have been changed in preInstall)
setupWizard.wait(tr("Please wait ..."));

wine.runInsidePrefix(wine.programFiles() + "/Steam/Steam.exe", ["steam://install/" + this._appId]);
wine.runInsidePrefix(wine.programFiles() + "/Steam/Steam.exe", ["steam://install/" + this._appId], false);

setupWizard.wait(tr("Please wait until Steam has finished the download ..."));

Expand All @@ -126,7 +157,7 @@ SteamScript.prototype.go = function () {
}

// close Steam
wine.runInsidePrefix(wine.programFiles() + "/Steam/Steam.exe", "-shutdown");
wine.runInsidePrefix(wine.programFiles() + "/Steam/Steam.exe", "-shutdown", true);

// back to generic wait
setupWizard.wait(tr("Please wait ..."));
Expand Down
17 changes: 7 additions & 10 deletions Engines/Wine/QuickScript/Uplay Script/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ include(["engines", "wine", "engine", "object"]);
include(["utils", "functions", "filesystem", "extract"]);
include(["utils", "functions", "filesystem", "files"]);
include(["engines", "wine", "verbs", "luna"]);

include(["engines", "wine", "plugins", "windows_version"]);

function UplayScript() {
QuickScript.call(this);
Expand Down Expand Up @@ -49,16 +49,13 @@ UplayScript.prototype.go = function () {
.to(tempFile)
.get();

setupWizard.wait(tr("Please follow the steps of the Uplay setup.\n\nUncheck \"Run Uplay\" or close Uplay completely after the setup so that the installation of \"{0}\" can continue.", this._name));

var wine = new Wine()
.wizard(setupWizard)
.architecture(this._wineArchitecture)
.distribution(this._wineDistribution)
.version(this._wineVersion)
.prefix(this._name)
.luna()
.run(tempFile, [], null, false, true);
.prefix(this._name, this._wineDistribution, this._wineArchitecture, this._wineVersion)
.luna();

setupWizard.wait(tr("Please follow the steps of the Uplay setup.\n\nUncheck \"Run Uplay\" or close Uplay completely after the setup so that the installation of \"{0}\" can continue.", this._name));
wine.run(tempFile, [], null, false, true);

wine.setOsForApplication().set("upc.exe", "winxp").do();

Expand All @@ -72,7 +69,7 @@ UplayScript.prototype.go = function () {

this._createShortcut(wine.prefix());

wine.runInsidePrefix(wine.programFiles() + "/Ubisoft/Ubisoft Game Launcher/Uplay.exe", ["uplay://launch/" + this._appId + "/0"]);
wine.runInsidePrefix(wine.programFiles() + "/Ubisoft/Ubisoft Game Launcher/Uplay.exe", ["uplay://launch/" + this._appId + "/0"], true);

// wait until download is finished
setupWizard.wait(tr("Please wait until Uplay has finished the download ..."));
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
Even if the application name contains ®, ™ or the like, you should not use it in the folder name.
3. Fill the files:
* [script.js](https://phoenicisorg.github.io/scripts/script-js): actual installation script
* [script.json](https://phoenicisorg.github.io/scripts/script-json): describes the installation script
* [script.js](https://phoenicisorg.github.io/scripts/Develop/script-js/): actual installation script
* [script.json](https://phoenicisorg.github.io/scripts/Develop/script-json/): describes the installation script
```json
{
"scriptName": "Online",
Expand All @@ -43,7 +43,7 @@
}
```
* main.png: application icon (400px x 300px)
* [application.json](https://phoenicisorg.github.io/scripts/application-json): describes the application
* [application.json](https://phoenicisorg.github.io/scripts/Develop/application-json/): describes the application
```json
{
"name": "Steam",
Expand Down
Loading

0 comments on commit 9639e62

Please sign in to comment.