Compare commits

...

27 Commits

Author SHA1 Message Date
Robert Muehsig
b69d4d23bf Merge pull request #313 from ElectronNET/netcore30
Update to .NET Core 3.0
2019-10-29 00:21:32 +01:00
Robert Muehsig
239d914747 Merge pull request #328 from jimbuck/netcore30
Converted global npm dependencies to use npx
2019-10-28 23:36:00 +01:00
Robert Muehsig
5af8e489b9 Merge pull request #327 from tadic-luka/patch-1
Thanks!
2019-10-28 23:30:54 +01:00
Jim Buck
b6fb1cb0bf Converted global npm dependencies to use npx. 2019-10-22 23:59:47 -04:00
tadic-luka
aa98b85f18 Update README.md
EnableEndpointRouting should be set to false. Otherwise people will get error: 
Application startup exception: System.InvalidOperationException: Endpoint Routing does not support 'IApplicationBuilder.UseMvc(...)'. To use 'IApplicationBuilder.UseMvc' set 'MvcOptions.EnableEndpointRouting = false' inside 'ConfigureServices(...). 
The solution is even proposed in stack trace.
Issue was opened on https://github.com/aspnet/AspNetCore/issues/9542 and it is explained there what should be done.
2019-10-22 10:48:55 +02:00
Robert Muehsig
af74d24f50 Merge pull request #326 from jbeals12/patch-1 2019-10-21 21:07:07 +02:00
Jason
2240ffca82 Grammar fix. 2019-10-21 11:28:33 -06:00
Robert Muehsig
f64b780a27 documentation and one minor adjustment 2019-10-15 00:21:36 +02:00
Robert Muehsig
fbc5b93513 Merge branch 'netcore30' of https://github.com/ElectronNET/Electron.NET into netcore30 2019-10-15 00:13:34 +02:00
Robert Muehsig
14d02706c0 small changes for version stuff 2019-10-15 00:13:22 +02:00
Robert Muehsig
2c14693430 Merge branch 'master' into netcore30 2019-10-15 00:10:14 +02:00
Robert Muehsig
54ff11acf5 beta... 2019-10-15 00:09:15 +02:00
Robert Muehsig
b7e7ace6f3 fix build issues on windows 2019-10-14 22:44:30 +02:00
Robert Muehsig
1f7908a0f1 Merge pull request #321 from kant2002/issue-320
Fix `buildAll.cmd` and `buildAll.sh` when running on clear repo
2019-10-14 21:45:54 +02:00
Andrii Kurdiumov
6fbba52edd Fix buildAll.cmd and buildAll.sh when running on clear repo
This is followup to c91884a520 change which on itself was reaction to electron-builder changes in the command line parameters interface
2019-10-14 11:13:53 +03:00
Robert Muehsig
8dd5d1561a test 2019-10-07 23:16:08 +02:00
Robert Muehsig
25f35e34fe global npm outside of build commands 2019-10-07 22:53:50 +02:00
Robert Muehsig
f1eaffb203 update github sourcelink and framework reference 2019-10-07 22:48:49 +02:00
Robert Muehsig
69ca5d6f9e Merge pull request #314 from ElectronNET/dependabot/npm_and_yarn/ElectronNET.Host/lodash-4.17.15
Bump lodash from 4.17.11 to 4.17.15 in /ElectronNET.Host
2019-10-07 22:42:03 +02:00
Robert Muehsig
5cd11a8110 build 2019-10-03 23:36:21 +02:00
dependabot[bot]
c343b19a60 Bump lodash from 4.17.11 to 4.17.15 in /ElectronNET.Host
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.11 to 4.17.15.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.11...4.17.15)

Signed-off-by: dependabot[bot] <support@github.com>
2019-10-03 21:16:04 +00:00
Robert Muehsig
b3bb3ceb97 fix build issues 2019-10-03 23:07:17 +02:00
Robert Muehsig
e25b89ff6a Update to .NET Core 3.0 2019-10-03 22:30:58 +02:00
Gregor Biswanger
5157561dc6 Merge pull request #303 from hack2root/master
fix issue #301
2019-08-21 17:10:47 +02:00
Gregor Biswanger
bbecd86cce Update Changelog.md 2019-08-21 17:10:10 +02:00
Artur Mustafin
bd99da560b fix issue #301 2019-08-21 06:43:56 +03:00
Gregor Biswanger
9278402d65 remove starter kits part
Is no longer actively maintained
2019-08-03 11:45:14 +02:00
26 changed files with 103 additions and 92 deletions

View File

@@ -1,9 +1,8 @@
language: csharp
mono: none
dist: xenial
dotnet: 2.2
dotnet: 3.0
before_script:
- export PATH="$PATH:/home/travis/.dotnet/tools"
- npm install electron-packager --global
script:
- ./buildAll.sh

View File

@@ -1,5 +1,10 @@
# Not released
# 5.22.15
ElectronNET.API:
* New Feature: Add BrowserWindow.RemoveMenu() (thanks [hack2root](https://github.com/hack2root))
# Released
@@ -11,7 +16,7 @@ ElectronNET.CLI:
ElectronNET.API:
* New Feature: Implement full support for Auto Updater [(Based on electron-updater - Version 4.0.6)](https://www.electron.build/auto-update)
* New Feature: Full support for Auto Updater [(Based on electron-updater - Version 4.0.6)](https://www.electron.build/auto-update)
* New Feature: Support for set a custom static Port to ASP.NET Backend [\#155](https://github.com/ElectronNET/Electron.NET/issues/155)
* Fixed bug: Electron tray icon TypeError ([Electron original issue](https://github.com/electron/electron/issues/7657)) (thanks [Tum4ik](https://github.com/Tum4ik))
* Fixed bug: Wrong tray icon path in the application built via `electronize build` command (thanks [Tum4ik](https://github.com/Tum4ik))

View File

@@ -1939,6 +1939,14 @@ namespace ElectronNET.API
});
}
/// <summary>
/// Remove the window's menu bar.
/// </summary>
public void RemoveMenu()
{
BridgeConnector.Socket.Emit("browserWindowRemoveMenu", Id);
}
/// <summary>
/// Sets progress value in progress bar. Valid range is [0, 1.0]. Remove progress
/// bar when progress smaler as 0; Change to indeterminate mode when progress bigger as 1. On Linux

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageOutputPath>..\artifacts</PackageOutputPath>
<PackageId>ElectronNET.API</PackageId>
@@ -17,8 +17,8 @@ This package contains the API to access the "native" electron API.</Description>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<PackageTags>electron aspnetcore</PackageTags>
<PackageReleaseNotes>Changelog: https://github.com/ElectronNET/Electron.NET/blob/master/Changelog.md</PackageReleaseNotes>
<PackageIconUrl>https://raw.githubusercontent.com/ElectronNET/Electron.NET/master/assets/images/electron.net-logo-square.png</PackageIconUrl>
<Version>1.0.0.0</Version>
<PackageIcon>PackageIcon.png</PackageIcon>
<Version>99.0.0.0</Version>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@@ -26,14 +26,18 @@ This package contains the API to access the "native" electron API.</Description>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>bin\Release\netcoreapp2.0\ElectronNET.API.xml</DocumentationFile>
<DocumentationFile>bin\Release\netcoreapp3.0\ElectronNET.API.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>bin\Debug\netcoreapp2.0\ElectronNET.API.xml</DocumentationFile>
<DocumentationFile>bin\Debug\netcoreapp3.0\ElectronNET.API.xml</DocumentationFile>
<Optimize>true</Optimize>
</PropertyGroup>
<ItemGroup>
<None Include="PackageIcon.png" Pack="true" PackagePath="\" />
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(OS)' == 'Windows_NT'">
<Exec Command="$(ProjectDir)devCleanup.cmd" IgnoreExitCode="true" />
</Target>
@@ -41,8 +45,10 @@ This package contains the API to access the "native" electron API.</Description>
<Exec Command="$(ProjectDir)devCleanup.sh" IgnoreExitCode="true" />
</Target>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="2.1.1" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-18618-05">
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-19367-01">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

View File

@@ -72,9 +72,8 @@ namespace ElectronNET.CLI.Commands
ProcessHelper.CmdExecute("npm install", targetFilePath);
// run typescript compiler
string tscPath = Path.Combine(targetFilePath, "node_modules", ".bin");
// ToDo: Not sure if this runs under linux/macos
ProcessHelper.CmdExecute(@"tsc -p ../../", tscPath);
ProcessHelper.CmdExecute(@"npx tsc -p ../../", targetFilePath);
// search .csproj
Console.WriteLine($"Search your .csproj to add configure CopyToPublishDirectory to 'Never'");

View File

@@ -105,21 +105,6 @@ namespace ElectronNET.CLI.Commands
Console.WriteLine("Start npm install...");
ProcessHelper.CmdExecute("npm install --production", tempPath);
Console.WriteLine("Start npm install electron-builder...");
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
// Works proper on Windows...
ProcessHelper.CmdExecute("npm install electron-builder --global", tempPath);
}
else
{
// ToDo: find another solution or document it proper
// GH Issue https://github.com/electron-userland/electron-prebuilt/issues/48
Console.WriteLine("Electron Builder - make sure you invoke 'sudo npm install electron-builder --global' at " + tempPath + " manually. Sry.");
}
Console.WriteLine("ElectronHostHook handling started...");
string electronhosthookDir = Path.Combine(Directory.GetCurrentDirectory(), "ElectronHostHook");
@@ -130,13 +115,10 @@ namespace ElectronNET.CLI.Commands
DirectoryCopy.Do(electronhosthookDir, hosthookDir, true, new List<string>() { "node_modules" });
Console.WriteLine("Start npm install for hosthooks...");
ProcessHelper.CmdExecute("npm install --production", hosthookDir);
ProcessHelper.CmdExecute("npm install", hosthookDir);
// ToDo: Global TypeScript installation is needed for ElectronHostHook
//string tscPath = Path.Combine(tempPath, "node_modules", ".bin");
// ToDo: Not sure if this runs under linux/macos
ProcessHelper.CmdExecute(@"tsc -p . --sourceMap false", hosthookDir);
ProcessHelper.CmdExecute(@"npx tsc -p . --sourceMap false", hosthookDir);
}
Console.WriteLine("Build Electron Desktop Application...");
@@ -171,7 +153,7 @@ namespace ElectronNET.CLI.Commands
ProcessHelper.CmdExecute($"node build-helper.js", tempPath);
Console.WriteLine($"Package Electron App for Platform {platformInfo.ElectronPackerPlatform}...");
ProcessHelper.CmdExecute($"electron-builder . --config=./bin/electron-builder.json --{platformInfo.ElectronPackerPlatform} --{electronArch} -c.electronVersion=5.0.8 {electronParams}", tempPath);
ProcessHelper.CmdExecute($"npx electron-builder . --config=./bin/electron-builder.json --{platformInfo.ElectronPackerPlatform} --{electronArch} -c.electronVersion=5.0.8 {electronParams}", tempPath);
Console.WriteLine("... done");

View File

@@ -76,12 +76,11 @@ namespace ElectronNET.CLI.Commands
string hosthookDir = Path.Combine(tempPath, "ElectronHostHook");
DirectoryCopy.Do(electronhosthookDir, hosthookDir, true, new List<string>() { "node_modules" });
Console.WriteLine("Start npm install for hosthooks...");
Console.WriteLine("Start npm install for typescript & hosthooks...");
ProcessHelper.CmdExecute("npm install", hosthookDir);
string tscPath = Path.Combine(tempPath, "node_modules", ".bin");
// ToDo: Not sure if this runs under linux/macos
ProcessHelper.CmdExecute(@"tsc -p ../../ElectronHostHook", tscPath);
ProcessHelper.CmdExecute(@"npx tsc -p ../../ElectronHostHook", tempPath);
}
string path = Path.Combine(tempPath, "node_modules", ".bin");

View File

@@ -2,14 +2,15 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<AssemblyName>electronize</AssemblyName>
<PackageType>DotnetCliTool</PackageType>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageOutputPath>..\artifacts</PackageOutputPath>
<PackageId>ElectronNET.CLI</PackageId>
<Version>1.0.0.0</Version>
<!-- Version 99 is just set for local development stuff to avoid a conflict with "real" packages on NuGet.org -->
<Version>99.0.0.0</Version>
<Authors>Gregor Biswanger, Robert Muehsig</Authors>
<Product>Electron.NET</Product>
<Company />
@@ -22,7 +23,7 @@ This package contains the dotnet tooling to electronize your application.</Descr
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<PackageTags>electron aspnetcore</PackageTags>
<PackageReleaseNotes>Changelog: https://github.com/ElectronNET/Electron.NET/blob/master/Changelog.md</PackageReleaseNotes>
<PackageIconUrl>https://raw.githubusercontent.com/ElectronNET/Electron.NET/master/assets/images/electron.net-logo-square.png</PackageIconUrl>
<PackageIcon>PackageIcon.png</PackageIcon>
<PackAsTool>true</PackAsTool>
</PropertyGroup>
@@ -38,7 +39,11 @@ This package contains the dotnet tooling to electronize your application.</Descr
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile></DocumentationFile>
</PropertyGroup>
<ItemGroup>
<None Include="PackageIcon.png" Pack="true" PackagePath="\"/>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="..\ElectronNET.Host\electron.manifest.json" Link="ElectronHost\electron.manifest.json" />
</ItemGroup>
@@ -96,7 +101,7 @@ This package contains the dotnet tooling to electronize your application.</Descr
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-18618-05">
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-19367-01">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

View File

@@ -440,6 +440,9 @@ module.exports = (socket, app) => {
}
getWindowById(id).setMenu(menu);
});
socket.on('browserWindowRemoveMenu', (id) => {
getWindowById(id).removeMenu();
});
function addMenuItemClickConnector(menuItems, callback) {
menuItems.forEach((item) => {
if (item.submenu && item.submenu.items.length > 0) {

View File

@@ -573,6 +573,10 @@ export = (socket: SocketIO.Socket, app: Electron.App) => {
getWindowById(id).setMenu(menu);
});
socket.on('browserWindowRemoveMenu', (id) => {
getWindowById(id).removeMenu();
});
function addMenuItemClickConnector(menuItems, callback) {
menuItems.forEach((item) => {
if (item.submenu && item.submenu.items.length > 0) {

View File

@@ -1047,9 +1047,9 @@
}
},
"lodash": {
"version": "4.17.11",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz",
"integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg=="
"version": "4.17.15",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A=="
},
"lodash.isequal": {
"version": "4.5.0",
@@ -1772,7 +1772,7 @@
},
"supports-color": {
"version": "2.0.0",
"resolved": "http://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
"integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
"dev": true
},

View File

@@ -8,9 +8,9 @@ namespace ElectronNET.WebApp.Controllers
{
public class TrayController : Controller
{
private readonly IHostingEnvironment _env;
private readonly IWebHostEnvironment _env;
public TrayController(IHostingEnvironment env)
public TrayController(IWebHostEnvironment env)
{
_env = env;
}

View File

@@ -1,9 +1,10 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};

View File

@@ -1 +1 @@
{"version":3,"file":"excelCreator.js","sourceRoot":"","sources":["excelCreator.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,iCAAiC;AAGjC,MAAa,YAAY;IACf,MAAM,CAAC,IAAY;;YACrB,MAAM,QAAQ,GAAa,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;YAChD,MAAM,SAAS,GAAc,QAAQ,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;YAC/D,SAAS,CAAC,OAAO,GAAG;gBAChB,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE;gBACtC,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE;gBAC1C,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,EAAE,YAAY,EAAE,CAAC,EAAE;aACtE,CAAC;YACF,SAAS,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;YAC9E,SAAS,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;YAE9E,MAAM,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,eAAe,CAAC,CAAC;YAEtD,OAAO,qBAAqB,CAAC;QACjC,CAAC;KAAA;CACJ;AAhBD,oCAgBC"}
{"version":3,"file":"excelCreator.js","sourceRoot":"","sources":["excelCreator.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,iCAAiC;AAGjC,MAAa,YAAY;IACf,MAAM,CAAC,IAAY;;YACrB,MAAM,QAAQ,GAAa,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;YAChD,MAAM,SAAS,GAAc,QAAQ,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;YAC/D,SAAS,CAAC,OAAO,GAAG;gBAChB,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE;gBACtC,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE;gBAC1C,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,EAAE,YAAY,EAAE,CAAC,EAAE;aACtE,CAAC;YACF,SAAS,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;YAC9E,SAAS,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;YAE9E,MAAM,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,eAAe,CAAC,CAAC;YAEtD,OAAO,qBAAqB,CAAC;QACjC,CAAC;KAAA;CACJ;AAhBD,oCAgBC"}

View File

@@ -1,9 +1,10 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};

View File

@@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;AAEA,2CAAwC;AACxC,iDAA8C;AAE9C,MAAa,WAAY,SAAQ,qBAAS;IACtC,YAAY,MAAuB,EAAS,GAAiB;QACzD,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QADqB,QAAG,GAAH,GAAG,CAAc;IAE7D,CAAC;IAED,WAAW;QACP,8CAA8C;QAC9C,IAAI,CAAC,EAAE,CAAC,mBAAmB,EAAE,CAAO,IAAI,EAAE,IAAI,EAAE,EAAE;YAC9C,MAAM,YAAY,GAAiB,IAAI,2BAAY,EAAE,CAAC;YACtD,MAAM,MAAM,GAAW,MAAM,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAEvD,IAAI,CAAC,MAAM,CAAC,CAAC;QACjB,CAAC,CAAA,CAAC,CAAC;IACP,CAAC;CACJ;AAdD,kCAcC"}
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;AAEA,2CAAwC;AACxC,iDAA8C;AAE9C,MAAa,WAAY,SAAQ,qBAAS;IACtC,YAAY,MAAuB,EAAS,GAAiB;QACzD,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QADqB,QAAG,GAAH,GAAG,CAAc;IAE7D,CAAC;IAED,WAAW;QACP,8CAA8C;QAC9C,IAAI,CAAC,EAAE,CAAC,mBAAmB,EAAE,CAAO,IAAI,EAAE,IAAI,EAAE,EAAE;YAC9C,MAAM,YAAY,GAAiB,IAAI,2BAAY,EAAE,CAAC;YACtD,MAAM,MAAM,GAAW,MAAM,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAEvD,IAAI,CAAC,MAAM,CAAC,CAAC;QACjB,CAAC,CAAA,CAAC,CAAC;IACP,CAAC;CACJ;AAdD,kCAcC"}

View File

@@ -1,8 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>
<AspNetCoreModuleName>AspNetCoreModule</AspNetCoreModuleName>
<RuntimeIdentifiers>win-x64</RuntimeIdentifiers>
<TypeScriptToolsVersion>3.1</TypeScriptToolsVersion>
<TypeScriptToolsVersion>3.6</TypeScriptToolsVersion>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Controllers\ManageWindowsController.cs" />
@@ -14,11 +16,7 @@
<Folder Include="wwwroot\assets\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="2.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ElectronNET.API\ElectronNET.API.csproj" />

View File

@@ -1,6 +1,7 @@
using ElectronNET.API;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Logging;
namespace ElectronNET.WebApp
{
@@ -14,6 +15,7 @@ namespace ElectronNET.WebApp
public static IWebHost BuildWebHost(string[] args)
{
return WebHost.CreateDefaultBuilder(args)
.ConfigureLogging((hostingContext, logging) => { logging.AddConsole(); })
.UseElectron(args)
.UseStartup<Startup>()
.Build();

View File

@@ -5,6 +5,7 @@ using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Hosting;
namespace ElectronNET.WebApp
{
@@ -25,10 +26,8 @@ namespace ElectronNET.WebApp
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
loggerFactory.AddConsole();
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
@@ -36,16 +35,14 @@ namespace ElectronNET.WebApp
app.UseStaticFiles();
app.UseMvc(routes =>
app.UseRouting();
app.UseEndpoints(endpoints =>
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
endpoints.MapControllerRoute("default", "{controller=Home}/{action=Index}/{id?}");
});
if(HybridSupport.IsElectronActive)
if (HybridSupport.IsElectronActive)
{
ElectronBootstrap();
}

View File

@@ -26,7 +26,11 @@ Well... there are lots of different approaches how to get a X-plat desktop app r
# Requirements to run:
The current Electron.NET CLI builds Windows/macOS/Linux binaries. Our API uses .NET Core 2.2, so our minimum base OS is the same as [.NET Core 2.2](https://github.com/dotnet/core/blob/master/release-notes/2.2/2.2-supported-os.md).
The current Electron.NET CLI builds Windows/macOS/Linux binaries. Our API uses .NET Core 3.0, so our minimum base OS is the same as [.NET Core 3.0](https://github.com/dotnet/core/blob/master/release-notes/3.0/3.0-supported-os.md).
Also you should have installed:
* npm
# Community
@@ -58,6 +62,11 @@ public static IWebHost BuildWebHost(string[] args)
Open the Electron Window in the Startup.cs file:
```csharp
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc(option => option.EnableEndpointRouting = false);
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
@@ -98,12 +107,6 @@ To start the application make sure you have installed the "[ElectronNET.CLI](htt
dotnet tool install ElectronNET.CLI -g
```
* Make sure you have __node.js v8.6.0__ and on __macOS/Linux__ the electron-builder installed!
```
sudo npm install electron-builder --global
```
At the first time, you need an Electron.NET project initialization. Type the following command in your ASP.NET Core folder:
```
@@ -156,16 +159,12 @@ electronize build /target custom win7-x86;win32 /electron-arch ia32
The end result should be an electron app under your __/bin/desktop__ folder.
## Starter kits
There is a React/Typescript/MobX starter kit at https://github.com/yoDon/Electron.NET-React-Typescript-MobX
### Note
> macOS builds can't be created on Windows machines because they require symlinks that aren't supported on Windows (per [this Electron issue](https://github.com/electron-userland/electron-packager/issues/71)). macOS builds can be produced on either Linux or macOS machines.
# Working with this Repo
This repository consists of the main parts (API & CLI) and it's own "playground" ASP.NET Core application. Both main parts produce local NuGet packages, that are versioned with 1.0.0. The first thing you will need is to run one of the buildAll scripts (.cmd for Windows, the other for macOS/Linux).
This repository consists of the main parts (API & CLI) and it's own "playground" ASP.NET Core application. Both main parts produce local NuGet packages, that are versioned with 99.0.0. The first thing you will need is to run one of the buildAll scripts (.cmd for Windows, the other for macOS/Linux).
If you look for pure __[demo projects](https://github.com/ElectronNET)__ checkout the other repositories.
@@ -242,7 +241,7 @@ In the Version 0.0.9 the CLI was not a global tool and needed to be registred li
</ItemGroup>
```
After you edited the .csproj-file, you need to restore your NuGet packages within your Project. Run the follwoing command in your ASP.NET Core folder:
After you edited the .csproj-file, you need to restore your NuGet packages within your Project. Run the following command in your ASP.NET Core folder:
```
dotnet restore

View File

@@ -1,5 +1,5 @@
version: 1.0.{build}
image: Visual Studio 2017
image: Visual Studio 2019
build_script:
- cmd: buildAll.cmd
pull_requests:

View File

@@ -1,4 +1,5 @@
echo "Start building Electron.NET dev stack..."
echo "Restore & Build API"
cd ElectronNet.API
dotnet restore
@@ -22,17 +23,14 @@ dotnet tool uninstall ElectronNET.CLI -g
dotnet tool install ElectronNET.CLI -g
echo "/target xxx (dev-build)"
electronize build /target custom win7-x86;win32 /dotnet-configuration Debug /electron-arch ia32 /electron-params "--prune=true "
electronize build /target custom win7-x86;win /dotnet-configuration Debug /electron-arch ia32 /electron-params "--publish never"
echo "/target win (dev-build)"
electronize build /target win
electronize build /target win /electron-params "--publish never"
echo "/target linux (dev-build)"
electronize build /target linux
echo "/target custom win7-x86;win32 (dev-build)"
electronize build /target custom win7-x86;win32
echo "/target custom win7-x86;win (dev-build)"
electronize build /target custom win7-x86;win /electron-params "--publish never"
:: Be aware, that for non-electronnet-dev environments the correct
:: invoke command would be dotnet electronize ...
@@ -40,3 +38,8 @@ electronize build /target custom win7-x86;win32
:: Not supported on Windows Systems, because of SymLinks...
:: echo "/target osx"
:: dotnet electronize build /target osx
:: Linux and Mac is not supported on with this buildAll.cmd test file, because the electron bundler does some strange stuff
:: Help welcome!
:: echo "/target linux (dev-build)"
:: electronize build /target linux /electron-params "--publish never"

View File

@@ -32,8 +32,8 @@ electronize build /target linux
echo "/target osx (dev-build)"
electronize build /target osx
echo "/target custom win7-x86;win32 (dev-build)"
electronize build /target custom "win7-x86;win32"
echo "/target custom win7-x86;win (dev-build)"
electronize build /target custom "win7-x86;win"
# Be aware, that for non-electronnet-dev environments the correct
# invoke command would be dotnet electronize ...

View File

@@ -1,4 +1,4 @@
set ENETVER=5.22.14
set ENETVER=5.30.0-beta
echo "Start building Electron.NET dev stack..."
echo "Restore & Build API"
cd ElectronNet.API