-
Notifications
You must be signed in to change notification settings - Fork 47
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 OnlineInstallerScript Default check wine settings #1264
base: master
Are you sure you want to change the base?
Conversation
We cannot do it like this. The scripts should use the default or specify it via e.g. .wineVersion(getLatestStagingVersion)
.wineDistribution("staging") If the default version (latest stable) is not fetched correctly anymore, we must fix that. See
|
Add conditions for MacOSX
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 don't know how to elegantly combine the version logic with the architecture and distribution logic
The only distro-architecture that works on intel mac is cx-x86on64. I imagine that m2 macs would be cx-amd64, so we would need some other flag on the Java side to detect M2
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 upstream builds for Darwin do not work?
@@ -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"; |
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.
Use the architecture
parameter. You've already fixed the default _wineArchitecture
in QuickScript
, so it should work without further changes.
return getLatestVersion(wizard, "upstream-linux-" + architecture, /^\d+\.0(\.\d+)?$/); | ||
const os = operatingSystemFetcher.fetchCurrentOperationSystem().getWinePackage() | ||
const arch = operatingSystemFetcher.fetchCurrentOperationSystem().getWinePackage() === "darwin" ? "x86on64" : "x86"; | ||
const distribution = operatingSystemFetcher.fetchCurrentOperationSystem().getWinePackage() === "darwin" ? "cx" : "upstream"; |
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.
Pass the distribution
as additional parameter (like architecture
). See
this._wineVersion = this._wineVersionFunction(wizard, this._wineArchitecture); |
MacOS except for really old is all 64 bit, so x86on64 is only cx. If on an AMD64 machine they can switch by hand to amd64 engine. |
Could not figure out your exact implementation, but I hope this is acceptable |
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+)?$/); |
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:
module.getLatestStableVersion = function (wizard, distribution, package, architecture) {
return getLatestVersion(wizard, `${distribution}-${package}-${architecture}`, /^\d+\.0(\.\d+)?$/);
Honestly, I don't even understand how the current implementation can work, e.g. this._wineDistribution
should 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.
@@ -4,9 +4,10 @@ const operatingSystemFetcher = Bean("operatingSystemFetcher"); | |||
|
|||
module.default = class QuickScript { | |||
constructor() { | |||
this._winePackage = operatingSystemFetcher.fetchCurrentOperationSystem().getWinePackage() | |||
this._wineArchitecture = this._winePackage === "darwin" ? "x86on64" : "x86"; | |||
this._wineDistribution = this._winePackage === "darwin" ? "cx" : "upstream"; |
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.
Prototyped field wineDistribution
I understand that the variables exist in |
Please check https://phoenicisorg.github.io/scripts/General/tools/. Somehow the formatting got messed up. |
I ran ESLint |
return getLatestVersion(wizard, `${this._wineDistribution}-${this._winePackage}-${architecture}`, /^\d+\.0(\.\d+)?$/); | ||
} | ||
|
||
module.getLatestStableVersion = function (wizard, distribution, winePackage, architecture) { |
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.
Yes, this is how it should be. Just remove the other getLatestStableVersion
and update getLatestDevelopmentVersion
and getLatestStagingVersion
. Then, ensure that it's called everywhere with the correct parameters.
…entVersion is neeeded
@@ -31,7 +31,7 @@ new PlainInstaller().withScript(() => { | |||
|
|||
const wine = new Wine() | |||
.wizard(setupWizard) | |||
.prefix("InternetExplorer6", "upstream", "x86", getLatestStableVersion(setupWizard, "x86")) | |||
.prefix("InternetExplorer6", "upstream", "x86", getLatestStableVersion(setupWizard, null, null, "x86")) |
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.
Did you try this? PlainInstaller
is not a QuickScript
, so I don't see how this._wineDistribution
etc. should be set. Generally, I think it would be better to explicitly pass all parameters everywhere (Versions
should provide a set of functions and not depend on QuickScript
).
|
||
module.default = class QuickScript { | ||
constructor() { | ||
this._winePackage = operatingSystemFetcher.fetchCurrentOperationSystem().getWinePackage() |
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.
this._winePackage = operatingSystemFetcher.fetchCurrentOperationSystem().getWinePackage() | |
this._winePackage = operatingSystemFetcher.fetchCurrentOperationSystem().getWinePackage(); |
Description
Currently OnlineInstallerScript does not work correctly since it defaults to upstream and no version.
Asking for wine settings configures correctly
What works
What was not tested
Test
Ready for review
json-align
andeslint
run according to the documentation.