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

Add Adobeair #801

Merged
merged 8 commits into from
Jan 12, 2019
Merged
Show file tree
Hide file tree
Changes from all 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
34 changes: 21 additions & 13 deletions Engines/Wine/Plugins/Windows version/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,26 @@ Wine.prototype.windowsVersion = function (version, servicePack) {
}

// set
var regeditFileContent =
"REGEDIT4\n" +
"\n" +
"[HKEY_CURRENT_USER\\Software\\Wine]\n" +
"\"Version\"=\"" + version + "\"\n";

if (servicePack) {
var servicePackNumber = servicePack.replace("sp", "");
regeditFileContent += "[HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion]\n";
regeditFileContent += "\"CSDVersion\"=\"Service Pack "+ servicePackNumber +"\"\n";
regeditFileContent += "[HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Windows]\n";
regeditFileContent += "\"CSDVersion\"=dword:00000"+servicePackNumber+"00\n";
var regeditFileContent;
if (version == null) {
regeditFileContent =
"REGEDIT4\n" +
"\n" +
Copy link
Collaborator

Choose a reason for hiding this comment

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

This part is the same, so you could actually change the code to:

regeditFileContent =
    "REGEDIT4\n" +
    "\n" +
    "[-HKEY_CURRENT_USER\\Software\\Wine]";

if (version) {
...

Copy link
Member Author

Choose a reason for hiding this comment

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

No it is not if you look well

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah the "-" in front of HKEY is different. Didn't see that.

Still would prefer

if (version)

over

if (version == null)

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure because if version is undefined, then, we switch back to the getter. The I think in this particular case, we really need version to be explicitely null

Copy link
Collaborator

Choose a reason for hiding this comment

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

I see. It's not so nice from an API perspective.

"[-HKEY_CURRENT_USER\\Software\\Wine]";
} else {
regeditFileContent =
"REGEDIT4\n" +
"\n" +
"[HKEY_CURRENT_USER\\Software\\Wine]\n" +
"\"Version\"=\"" + version + "\"\n";

if (servicePack) {
var servicePackNumber = servicePack.replace("sp", "");
regeditFileContent += "[HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion]\n";
regeditFileContent += "\"CSDVersion\"=\"Service Pack " + servicePackNumber + "\"\n";
regeditFileContent += "[HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Windows]\n";
regeditFileContent += "\"CSDVersion\"=dword:00000" + servicePackNumber + "00\n";
}
}

this.regedit().patch(regeditFileContent);
Expand All @@ -51,7 +59,7 @@ var SetOsForApplication = function () {
return that;
};

that.do = function () {
that.do = function () {
that._wine.regedit().patch(that._regeditFileContent);
return that._wine;
}
Expand Down
42 changes: 42 additions & 0 deletions Engines/Wine/Verbs/adobeair/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
include(["engines", "wine", "engine", "object"]);
include(["utils", "functions", "net", "resource"]);
include(["engines", "wine", "plugins", "windows_version"]);

/**
* Verb to install adobeair
* @returns {Wine} Wine object
*/
Wine.prototype.adobeair = function () {
var adobeair = new Resource()
.wizard(this.wizard())
.url("https://airdownload.adobe.com/air/win/download/latest/AdobeAIRInstaller.exe")
.checksum("68d26cca4c6c8230d3f7aa850ee227d518288dfc")
.name("AdobeAIRInstaller.exe")
.get();

// Using Windows XP to workaround the wine bug 43506
// See https://bugs.winehq.org/show_bug.cgi?id=43506
var currentWindowsVersion = this.windowsVersion();
this.windowsVersion("winxp");
this.run(adobeair).wait();
this.windowsVersion(currentWindowsVersion);

return this;
};

/**
* Verb to install adobeair
*/
var verbImplementation = {
install: function (container) {
var wine = new Wine();
wine.prefix(container);
var wizard = SetupWizard(InstallationType.VERBS, "adobeair", java.util.Optional.empty());
wine.wizard(wizard);
wine.adobeair();
wizard.close();
}
};

/* exported Verb */
var Verb = Java.extend(org.phoenicis.engines.Verb, verbImplementation);
11 changes: 11 additions & 0 deletions Engines/Wine/Verbs/adobeair/script.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"scriptName" : "Adobe Air",
"id" : "adobeair",
"compatibleOperatingSystems" : [
"MACOSX",
"LINUX"
],
"testingOperatingSystems" : [],
"free" : true,
"requiresPatch" : false
}