Source: Engines/Wine/Verbs/dotnet45/script.js

  1. const Wine = include("engines.wine.engine.object");
  2. const Resource = include("utils.functions.net.resource");
  3. const Optional = Java.type("java.util.Optional");
  4. const OverrideDLL = include("engines.wine.plugins.override_dll");
  5. const WindowsVersion = include("engines.wine.plugins.windows_version");
  6. const Regedit = include("engines.wine.plugins.regedit");
  7. const RemoveMono = include("engines.wine.verbs.remove_mono");
  8. const DotNET40 = include("engines.wine.verbs.dotnet40");
  9. /**
  10. * Verb to install .NET 4.5
  11. */
  12. class DotNET45 {
  13. constructor(wine) {
  14. this.wine = wine;
  15. }
  16. go() {
  17. const wizard = this.wine.wizard();
  18. const architecture = this.wine.architecture();
  19. const windowsVersion = new WindowsVersion(this.wine).getWindowsVersion();
  20. if (architecture == "amd64") {
  21. print(
  22. tr(
  23. "This package ({0}) may not fully work on a 64-bit installation. 32-bit prefixes may work better.",
  24. "dotnet45"
  25. )
  26. );
  27. }
  28. const setupFile = new Resource()
  29. .wizard(wizard)
  30. .url(
  31. "http://download.microsoft.com/download/b/a/4/ba4a7e71-2906-4b2d-a0e1-80cf16844f5f/dotnetfx45_full_x86_x64.exe"
  32. )
  33. .checksum("b2ff712ca0947040ca0b8e9bd7436a3c3524bb5d")
  34. .name("dotnetfx45_full_x86_x64.exe")
  35. .get();
  36. new RemoveMono(this.wine).go();
  37. new DotNET40(this.wine).go();
  38. new WindowsVersion(this.wine).withWindowsVersion("win7").go();
  39. new OverrideDLL(this.wine).withMode("builtin", ["fusion"]).go();
  40. wizard.wait(tr("Please wait while {0} is installed...", ".NET Framework 4.5"));
  41. this.wine.run(setupFile, [setupFile, "/q", '/c:"install.exe /q"'], null, false, true);
  42. wizard.wait(tr("Please wait..."));
  43. new Regedit(this.wine).deleteValue("HKCU\\Software\\Wine\\DllOverrides", "*fusion");
  44. new OverrideDLL(this.wine).withMode("native", ["mscoree"]).go();
  45. new WindowsVersion(this.wine).withWindowsVersion(windowsVersion).go();
  46. if (windowsVersion != "win2003") {
  47. print(tr('{0} applications can have issues when windows version is not set to "win2003"', ".NET 4.5"));
  48. }
  49. }
  50. static install(container) {
  51. const wine = new Wine();
  52. const wizard = SetupWizard(InstallationType.VERBS, "dotnet45", Optional.empty());
  53. wine.prefix(container);
  54. wine.wizard(wizard);
  55. if (wine.architecture() == "amd64") {
  56. wizard.message(
  57. tr(
  58. "This package ({0}) may not fully work on a 64-bit installation. 32-bit prefixes may work better.",
  59. "dotnet45"
  60. )
  61. );
  62. }
  63. new DotNET45(wine).go();
  64. wizard.close();
  65. }
  66. }
  67. module.default = DotNET45;