Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions Engines/Wine/Engine/Versions/script.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const { cat, touch } = include("utils.functions.filesystem.files");
const Downloader = include("utils.functions.net.download");
const propertyReader = Bean("propertyReader");
const operatingSystemFetcher = Bean("operatingSystemFetcher");

/**
* Sorts an array of Wine versions in place
Expand Down Expand Up @@ -122,15 +123,24 @@ module.getAvailableVersions = function (wizard) {


module.getLatestStableVersion = function (wizard, architecture) {
return getLatestVersion(wizard, "upstream-linux-" + architecture, /^\d+\.0(\.\d+)?$/);
const os = operatingSystemFetcher.fetchCurrentOperationSystem().getWinePackage()
const arch = operatingSystemFetcher.fetchCurrentOperationSystem().getWinePackage() === "darwin" ? "x86on64" : "x86";
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Use the architecture parameter. You've already fixed the default _wineArchitecture in QuickScript, so it should work without further changes.

const distribution = operatingSystemFetcher.fetchCurrentOperationSystem().getWinePackage() === "darwin" ? "cx" : "upstream";
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Pass the distribution as additional parameter (like architecture). See

this._wineVersion = this._wineVersionFunction(wizard, this._wineArchitecture);
.

return getLatestVersion(wizard, `${distribution}-${os}-${arch}`, /^\d+\.0(\.\d+)?$/);
}

module.getLatestDevelopmentVersion = function (wizard, architecture) {
return getLatestVersion(wizard, "upstream-linux-" + architecture, /^\d+\.\d+(\.\d+)?$/);
const os = operatingSystemFetcher.fetchCurrentOperationSystem().getWinePackage()
const arch = operatingSystemFetcher.fetchCurrentOperationSystem().getWinePackage() === "darwin" ? "x86on64" : "x86";
const distribution = operatingSystemFetcher.fetchCurrentOperationSystem().getWinePackage() === "darwin" ? "cx" : "upstream";
return getLatestVersion(wizard, `${distribution}-${os}-${arch}`, /^\d+\.0(\.\d+)?$/);
}

module.getLatestStagingVersion = function (wizard, architecture) {
return getLatestVersion(wizard, "staging-linux-" + architecture, /^\d+\.\d+(\.\d+)?$/);
const os = operatingSystemFetcher.fetchCurrentOperationSystem().getWinePackage()
const arch = operatingSystemFetcher.fetchCurrentOperationSystem().getWinePackage() === "darwin" ? "x86on64" : "x86";
const distribution = operatingSystemFetcher.fetchCurrentOperationSystem().getWinePackage() === "darwin" ? "cx" : "staging";
return getLatestVersion(wizard, `${distribution}-${os}-${arch}`, /^\d+\.0(\.\d+)?$/);
}

module.getLatestDosSupportVersion = function (/*wizard, architecture*/) {
Expand Down
1 change: 0 additions & 1 deletion Engines/Wine/QuickScript/Online Installer Script/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const { createTempFile } = include("utils.functions.filesystem.files");
module.default = class OnlineInstallerScript extends InstallerScript {
constructor() {
super();

this._installationArgs = [];
}

Expand Down
5 changes: 3 additions & 2 deletions Engines/Wine/QuickScript/Quick Script/script.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
const { getLatestStableVersion } = include("engines.wine.engine.versions");
const WineShortcut = include("engines.wine.shortcuts.wine");
const operatingSystemFetcher = Bean("operatingSystemFetcher");

module.default = class QuickScript {
constructor() {
this._wineVersionFunction = getLatestStableVersion;
this._wineArchitecture = "x86";
this._wineDistribution = "upstream";
this._wineArchitecture = operatingSystemFetcher.fetchCurrentOperationSystem().getWinePackage() === "darwin" ? "x86on64" : "x86";
this._wineDistribution = operatingSystemFetcher.fetchCurrentOperationSystem().getWinePackage() === "darwin" ? "cx" : "upstream";
this._wineUserSettings = false;

this._type = "Applications";
Expand Down