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 OnlineInstallerScript Default check wine settings #1264

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

borinquenkid
Copy link

@borinquenkid borinquenkid commented Jan 30, 2023

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

  • Operating system (and linux kernel version):
  • Hardware (GPU/CPU):

Ready for review

  • Script tested as a regular phoenicis user and working (if you have a problem -> create as draft and ask for help).
  • json-align and eslint run according to the documentation.
  • Codacy and travis checked.

@plata
Copy link
Collaborator

plata commented Jan 31, 2023

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
Copy link
Author

@borinquenkid borinquenkid left a 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

Copy link
Collaborator

@plata plata left a 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";
Copy link
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.

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";
Copy link
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);
.

@borinquenkid
Copy link
Author

The upstream builds for Darwin do not work?

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.

@borinquenkid
Copy link
Author

Could not figure out your exact implementation, but I hope this is acceptable

Comment on lines 124 to 125
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+)?$/);
Copy link
Collaborator

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.

Copy link
Author

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";
Copy link
Author

Choose a reason for hiding this comment

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

Prototyped field wineDistribution

@plata
Copy link
Collaborator

plata commented Feb 7, 2023

I understand that the variables exist in QuickScript. However, the "versions" does not derive from it.
And also the scripts are not necessarily QuickScripts, e.g.: https://github.com/PhoenicisOrg/scripts/blob/master/Applications/Internet/Internet%20Explorer%206.0/Online/script.js

@plata
Copy link
Collaborator

plata commented Feb 14, 2023

Please check https://phoenicisorg.github.io/scripts/General/tools/. Somehow the formatting got messed up.

@borinquenkid
Copy link
Author

I ran ESLint

return getLatestVersion(wizard, `${this._wineDistribution}-${this._winePackage}-${architecture}`, /^\d+\.0(\.\d+)?$/);
}

module.getLatestStableVersion = function (wizard, distribution, winePackage, architecture) {
Copy link
Collaborator

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.

@@ -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"))
Copy link
Collaborator

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()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
this._winePackage = operatingSystemFetcher.fetchCurrentOperationSystem().getWinePackage()
this._winePackage = operatingSystemFetcher.fetchCurrentOperationSystem().getWinePackage();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants