Skip to content

Commit

Permalink
Update dotnet (add versions +fix) (#839)
Browse files Browse the repository at this point in the history
  • Loading branch information
ImperatorS79 committed Mar 2, 2019
1 parent b4fd291 commit dbc073b
Show file tree
Hide file tree
Showing 14 changed files with 402 additions and 66 deletions.
46 changes: 46 additions & 0 deletions Engines/Wine/Verbs/Remove Mono/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
include("engines.wine.engine.object");
include("utils.functions.filesystem.files");
include("engines.wine.plugins.regedit");

/**
* Verb to remove mono
* @returns {Wine} Wine object
*/
Wine.prototype.removeMono = function () {
if (this.uninstall("Mono"))
{
this.wizard().wait(tr("Please wait..."));
this.regedit().deleteKey("HKLM\\Software\\Microsoft\\.NETFramework\\v2.0.50727\\SBSDisabled");

this.wizard().wait(tr("Please wait..."));
this.regedit().deleteKey("HKLM\\Software\\Microsoft\\NET Framework Setup\\NDP\\v3.5");

this.wizard().wait(tr("Please wait..."));
this.regedit().deleteKey("HKLM\\Software\\Microsoft\\NET Framework Setup\\NDP\\v4");

remove(this.system32directory() + "/mscoree.dll");
if (this.architecture() == "amd64")
{
remove(this.system64directory() + "/mscoree.dll");
}
}

return this;
};

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

/* exported Verb */
var Verb = Java.extend(org.phoenicis.engines.Verb, verbImplementation);
11 changes: 11 additions & 0 deletions Engines/Wine/Verbs/Remove Mono/script.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"scriptName" : "Remove Mono",
"id" : "engines.wine.verbs.remove_mono",
"compatibleOperatingSystems" : [
"MACOSX",
"LINUX"
],
"testingOperatingSystems" : [],
"free" : true,
"requiresPatch" : false
}
31 changes: 22 additions & 9 deletions Engines/Wine/Verbs/dotnet20/script.js
Original file line number Diff line number Diff line change
@@ -1,43 +1,56 @@
include("engines.wine.engine.object");
include("engines.wine.plugins.override_dll");
include("utils.functions.net.resource");
include("engines.wine.verbs.luna");
include("utils.functions.filesystem.files");
include("engines.wine.plugins.windows_version");
include("engines.wine.verbs.remove_mono");


/**
* Verb to install .NET 2.0
* @returns {Wine} Wine object
*/
Wine.prototype.dotnet20 = function () {
var osVersion = this.windowsVersion();

if (this.architecture() == "x86") {
this.windowsVersion("win2k");
var setupFile = new Resource()

var setupFile32 = new Resource()
.wizard(this.wizard())
.url("https://download.lenovo.com/ibmdl/pub/pc/pccbbs/thinkvantage_en/dotnetfx.exe")
.checksum("a3625c59d7a2995fb60877b5f5324892a1693b2a")
.name("dotnetfx.exe")
.get();
this.uninstall("Mono");
remove(this.system32directory() + "/mscoree.dll");

this.removeMono();

this.wizard().wait(tr("Please wait while {0} is installed...", ".NET Framework 2.0"));
this.run(setupFile, ["/q:a", "/c:install.exe /q"], null, false, true);
this.windowsVersion("win7");
this.run(setupFile32, ["/q:a", "/c:install.exe /q"], null, false, true);

this.windowsVersion(osVersion);

remove(this.system32directory() + "/msvcr80.dll");
remove(this.system32directory() + "/msvcm80.dll");
remove(this.system32directory() + "/msvcp80.dll");
}
else {
var setupFile = new Resource()
var setupFile64 = new Resource()
.wizard(this.wizard())
.url("https://download.microsoft.com/download/a/3/f/a3f1bf98-18f3-4036-9b68-8e6de530ce0a/NetFx64.exe")
.checksum("e59cca309463a5d98daeaada83d1b05fed5126c5")
.name("NetFx64.exe")
.get();
this.uninstall("Mono");

this.removeMono();

this.wizard().wait(tr("Please wait while {0} is installed...", ".NET Framework 2.0"));
this.run(setupFile, ["/q:a", "/c:install.exe /q"], null, false, true)
this.run(setupFile64, ["/q:a", "/c:install.exe /q"], null, false, true)
}

//This is in winetricks source, but does not seem to work
//this.wizard().wait(tr("Please wait while executing ngen..."));
//this.run(this.prefixDirectory() + "/drive_c/windows/Microsoft.NET/Framework/v2.0.50727/ngen.exe", "executequeueditems", null, false, true);

return this;
};
43 changes: 32 additions & 11 deletions Engines/Wine/Verbs/dotnet40/script.js
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
include("engines.wine.engine.object");
include("engines.wine.plugins.override_dll");
include("utils.functions.net.resource");
include("engines.wine.verbs.luna");
include("utils.functions.filesystem.files");
include("engines.wine.plugins.windows_version");
include("engines.wine.verbs.remove_mono");
include("engines.wine.plugins.regedit");


/**
* Verb to install .NET 4.0
* @returns {Wine} Wine object
*/
Wine.prototype.dotnet40 = function () {
if (this.architecture() == "amd64") {
print(tr("This package ({0}) may not fully work on a 64-bit installation. 32-bit prefixes may work better.", "dotnet40"));
}

var osVersion = this.windowsVersion();

var setupFile = new Resource()
.wizard(this.wizard())
.url("http://download.microsoft.com/download/9/5/A/95A9616B-7A37-4AF6-BC36-D6EA96C8DAAE/dotNetFx40_Full_x86_x64.exe")
.checksum("58da3d74db353aad03588cbb5cea8234166d8b99")
.name("dotNetFx40_Full_x86_x64.exe")
.get();

this.uninstall("Mono");
this.removeMono();

this.wizard().wait(tr("Please wait..."));
this.run("reg", ["delete", "HKLM\Software\Microsoft\NET Framework Setup\NDP\v4", "/f"], null, false, true);

remove(this.system32directory() + "/mscoree.dll");
this.windowsVersion("winxp");

this.overrideDLL()
.set("builtin", ["fusion"])
Expand All @@ -30,14 +35,27 @@ Wine.prototype.dotnet40 = function () {
this.wizard().wait(tr("Please wait while {0} is installed...", ".NET Framework 4.0"));
this.run(setupFile, [setupFile, "/q", "/c:\"install.exe /q\""], null, false, true);

this.wizard().wait(tr("Please wait..."));
this.regedit().deleteValue("HKCU\\Software\\Wine\\DllOverrides", "*fusion");

this.overrideDLL()
.set("native", ["mscoree"])
.do();

this.wizard().wait(tr("Please wait..."));
this.run("reg", ["add", "HKLM\Software\Microsoft\NET Framework Setup\NDP\v4\Full", "/v", "Install", "/t", "REG_DWORD", "/d", "0001", "/f"], null, false, true);
this.wizard().wait(tr("Please wait..."));
this.run("reg", ["add", "HKLM\Software\Microsoft\NET Framework Setup\NDP\v4\Full", "/v", "Version", "/t", "REG_SZ", "/d", "4.0.30319", "/f"], null, false, true);
var regeditFileContent = "REGEDIT4\n" +
"\n" +
"[HKEY_LOCAL_MACHINE\\Software\\Microsoft\\NET Framework Setup\\NDP\\v4\\Full]\n" +
"\"Install\"=dword:0001\n" +
"\"Version\"=\"4.0.30319\"";

this.regedit().patch(regeditFileContent);

//This is in winetricks source, but does not seem to work
//this.wizard().wait(tr("Please wait while executing ngen..."));
//this.run(this.prefixDirectory() + "/drive_c/windows/Microsoft.NET/Framework/v4.0.30319/ngen.exe", "executequeueditems", null, false, true);

this.windowsVersion(osVersion);

return this;
};
Expand All @@ -50,6 +68,10 @@ var verbImplementation = {
var wine = new Wine();
wine.prefix(container);
var wizard = SetupWizard(InstallationType.VERBS, "dotnet40", java.util.Optional.empty());
if (wine.architecture() == "amd64")
{
wizard.message(tr("This package ({0}) may not fully work on a 64-bit installation. 32-bit prefixes may work better.", "dotnet40"));
}
wine.wizard(wizard);
wine.dotnet40();
wizard.close();
Expand All @@ -58,4 +80,3 @@ var verbImplementation = {

/* exported Verb */
var Verb = Java.extend(org.phoenicis.engines.Verb, verbImplementation);

30 changes: 15 additions & 15 deletions Engines/Wine/Verbs/dotnet45/script.js
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
include("engines.wine.engine.object");
include("engines.wine.plugins.override_dll");
include("engines.wine.plugins.windows_version");
include("utils.functions.net.resource");
include("engines.wine.verbs.luna");
include("utils.functions.filesystem.files");
include("engines.wine.plugins.windows_version");
include("engines.wine.verbs.remove_mono");
include("engines.wine.plugins.regedit");
include("engines.wine.verbs.dotnet40");

/**
* Verb to install .NET 4.5
* @returns {Wine} Wine object
*/
Wine.prototype.dotnet45 = function () {

if (this.architecture() == "amd64") {
throw "{0} cannot be installed in a 64bit wine prefix!".format("dotnet45");
print(tr("This package ({0}) may not fully work on a 64-bit installation. 32-bit prefixes may work better.", "dotnet45"));
}

var OSVersion = this.windowsVersion();
var osVersion = this.windowsVersion();

var setupFile = new Resource()
.wizard(this.wizard())
Expand All @@ -25,12 +24,7 @@ Wine.prototype.dotnet45 = function () {
.name("dotnetfx45_full_x86_x64.exe")
.get();

this.uninstall("Mono");

this.wizard().wait(tr("Please wait..."));
this.run("reg", ["delete", "HKLM\Software\Microsoft\NET Framework Setup\NDP\v4", "/f"], null, false, true);

remove(this.system32directory() + "/mscoree.dll");
this.removeMono();

this.dotnet40();
this.windowsVersion("win7");
Expand All @@ -42,13 +36,16 @@ Wine.prototype.dotnet45 = function () {
this.wizard().wait(tr("Please wait while {0} is installed...", ".NET Framework 4.5"));
this.run(setupFile, [setupFile, "/q", "/c:\"install.exe /q\""], null, false, true);

this.wizard().wait(tr("Please wait..."));
this.regedit().deleteValue("HKCU\\Software\\Wine\\DllOverrides", "*fusion");

this.overrideDLL()
.set("native", ["mscoree"])
.do();

this.windowsVersion(OSVersion);
this.windowsVersion(osVersion);

if (OSVersion != "win2003") {
if (osVersion != "win2003") {
print(tr("{0} applications can have issues when windows version is not set to \"win2003\"", ".NET 4.5"));
}

Expand All @@ -63,6 +60,10 @@ var verbImplementation = {
var wine = new Wine();
wine.prefix(container);
var wizard = SetupWizard(InstallationType.VERBS, "dotnet45", java.util.Optional.empty());
if (wine.architecture() == "amd64")
{
wizard.message(tr("This package ({0}) may not fully work on a 64-bit installation. 32-bit prefixes may work better.", "dotnet45"));
}
wine.wizard(wizard);
wine.dotnet45();
wizard.close();
Expand All @@ -71,4 +72,3 @@ var verbImplementation = {

/* exported Verb */
var Verb = Java.extend(org.phoenicis.engines.Verb, verbImplementation);

25 changes: 13 additions & 12 deletions Engines/Wine/Verbs/dotnet452/script.js
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
include("engines.wine.engine.object");
include("engines.wine.plugins.override_dll");
include("engines.wine.plugins.windows_version");
include("utils.functions.net.resource");
include("engines.wine.verbs.luna");
include("utils.functions.filesystem.files");
include("engines.wine.plugins.windows_version");
include("engines.wine.verbs.remove_mono");
include("engines.wine.plugins.regedit");
include("engines.wine.verbs.dotnet40");


/**
* Verb to install .NET 4.5.2
* @returns {Wine} Wine object
*/
Wine.prototype.dotnet452 = function () {
print(tr("This package ({0}) does not work currently. Use it only for testing!", "dotnet452"));

var OSVersion = this.windowsVersion();
var osVersion = this.windowsVersion();

var setupFile = new Resource()
.wizard(this.wizard())
Expand All @@ -21,12 +23,7 @@ Wine.prototype.dotnet452 = function () {
.name("NDP452-KB2901907-x86-x64-AllOS-ENU.exe")
.get();

this.uninstall("Mono");

this.wizard().wait(tr("Please wait..."));
this.run("reg", ["delete", "HKLM\Software\Microsoft\NET Framework Setup\NDP\v4", "/f"], null, false, true);

remove(this.system32directory() + "/mscoree.dll");
this.removeMono();

this.dotnet40();
this.windowsVersion("win7");
Expand All @@ -38,13 +35,16 @@ Wine.prototype.dotnet452 = function () {
this.wizard().wait(tr("Please wait while {0} is installed...", ".NET Framework 4.5.2"));
this.run(setupFile, [setupFile, "/q", "/c:\"install.exe /q\""], null, false, true);

this.wizard().wait(tr("Please wait..."));
this.regedit().deleteValue("HKCU\\Software\\Wine\\DllOverrides", "*fusion");

this.overrideDLL()
.set("native", ["mscoree"])
.do();

this.windowsVersion(OSVersion);
this.windowsVersion(osVersion);

if (OSVersion != "win2003") {
if (osVersion != "win2003") {
print(tr("{0} applications can have issues when windows version is not set to \"win2003\"", ".NET 4.5.2"));
}

Expand All @@ -59,6 +59,7 @@ var verbImplementation = {
var wine = new Wine();
wine.prefix(container);
var wizard = SetupWizard(InstallationType.VERBS, "dotnet452", java.util.Optional.empty());
wizard.message(tr("This package ({0}) does not work currently. Use it only for testing!", "dotnet452"));
wine.wizard(wizard);
wine.dotnet452();
wizard.close();
Expand Down
9 changes: 6 additions & 3 deletions Engines/Wine/Verbs/dotnet452/script.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
"MACOSX",
"LINUX"
],
"testingOperatingSystems" : [],
"free" : true,
"requiresPatch" : false
"testingOperatingSystems" : [
"MACOSX",
"LINUX"
],
"free" : true,
"requiresPatch" : false
}

0 comments on commit dbc073b

Please sign in to comment.