-
Notifications
You must be signed in to change notification settings - Fork 45
Update OnlineInstallerScript Default check wine settings #1264
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
base: master
Are you sure you want to change the base?
Changes from 6 commits
f6056ad
fc41ac7
f3d75b2
df6cf9d
2689aa2
85f7a63
6cdd730
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,8 +8,7 @@ const propertyReader = Bean("propertyReader"); | |
| * @returns {void} | ||
| */ | ||
| function sortVersions(versions) { | ||
| versions.sort((a, b) => | ||
| { | ||
| versions.sort((a, b) => { | ||
| // check version format | ||
| const versionRegExp = /^(\d+\.\d+(\.\d+)?)(.*)?$/; | ||
| if (!versionRegExp.test(a.version)) { | ||
|
|
@@ -89,7 +88,7 @@ function getLatestVersion(wizard, category, regex) { | |
| .filter(({ version }) => regExp.test(version)) | ||
| .map(packageData => packageData.version); | ||
|
|
||
| return versions[versions.length-1]; | ||
| return versions[versions.length - 1]; | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -120,17 +119,21 @@ module.getAvailableVersions = function (wizard) { | |
| return versionsJson; | ||
| } | ||
|
|
||
|
|
||
| module.getLatestStableVersion = function (wizard, architecture) { | ||
| return getLatestVersion(wizard, "upstream-linux-" + architecture, /^\d+\.0(\.\d+)?$/); | ||
| return getLatestVersion(wizard, `${this._wineDistribution}-${this._winePackage}-${architecture}`, /^\d+\.0(\.\d+)?$/); | ||
| } | ||
|
|
||
| module.getLatestStableVersion = function (wizard, distribution, winePackage, architecture) { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, this is how it should be. Just remove the other |
||
| return getLatestVersion(wizard, `${distribution}-${winePackage}-${architecture}`, /^\d+\.0(\.\d+)?$/); | ||
| } | ||
|
|
||
| module.getLatestDevelopmentVersion = function (wizard, architecture) { | ||
| return getLatestVersion(wizard, "upstream-linux-" + architecture, /^\d+\.\d+(\.\d+)?$/); | ||
| return getLatestVersion(wizard, `${this._wineDistribution}-${this._winePackage}-${architecture}`, /^\d+\.0(\.\d+)?$/); | ||
| } | ||
|
|
||
| module.getLatestStagingVersion = function (wizard, architecture) { | ||
| return getLatestVersion(wizard, "staging-linux-" + architecture, /^\d+\.\d+(\.\d+)?$/); | ||
| const distribution = this._winePackage === "darwin" ? "cx" : "staging"; | ||
| return getLatestVersion(wizard, `${distribution}-${this._winePackage}-${architecture}`, /^\d+\.0(\.\d+)?$/); | ||
| } | ||
|
|
||
| module.getLatestDosSupportVersion = function (/*wizard, architecture*/) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,11 +1,13 @@ | ||||||
| const { getLatestStableVersion } = include("engines.wine.engine.versions"); | ||||||
| const WineShortcut = include("engines.wine.shortcuts.wine"); | ||||||
| const operatingSystemFetcher = Bean("operatingSystemFetcher"); | ||||||
|
|
||||||
| module.default = class QuickScript { | ||||||
| constructor() { | ||||||
| this._winePackage = operatingSystemFetcher.fetchCurrentOperationSystem().getWinePackage() | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| this._wineArchitecture = this._winePackage === "darwin" ? "x86on64" : "x86"; | ||||||
| this._wineDistribution = this._winePackage === "darwin" ? "cx" : "upstream"; | ||||||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prototyped field wineDistribution |
||||||
| this._wineVersionFunction = getLatestStableVersion; | ||||||
| this._wineArchitecture = "x86"; | ||||||
| this._wineDistribution = "upstream"; | ||||||
| this._wineUserSettings = false; | ||||||
|
|
||||||
| this._type = "Applications"; | ||||||
|
|
@@ -154,7 +156,7 @@ module.default = class QuickScript { | |||||
| * @returns {void} | ||||||
| */ | ||||||
| _determineWineVersion(wizard) { | ||||||
| this._wineVersion = this._wineVersionFunction(wizard, this._wineArchitecture); | ||||||
| this._wineVersion = this._wineVersionFunction(wizard, this._wineDistribution, this._winePackage, this._wineArchitecture); | ||||||
| } | ||||||
|
|
||||||
| /** | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea was more:
Honestly, I don't even understand how the current implementation can work, e.g.
this._wineDistributionshould not exist here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the field wineDistribution to QuickScript.