Skip to content

Commit 1365918

Browse files
Merge pull request #749 from ElectronNET/feature/readme
README Improvements
2 parents a2514ed + e909de5 commit 1365918

File tree

7 files changed

+67
-72
lines changed

7 files changed

+67
-72
lines changed

.github/FUNDING.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# These are supported funding model platforms
22

3-
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
3+
github: [GregorBiswanger, FlorianRappl]
44
patreon: # Replace with a single Patreon username
55
open_collective: # Replace with a single Open Collective username
66
ko_fi: # Replace with a single Ko-fi username

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ dlldata.c
4444
project.lock.json
4545
project.fragment.lock.json
4646
artifacts/
47-
!/artifacts/readme.md
47+
!/artifacts/.gitkeep
4848

4949
*_i.c
5050
*_p.c

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2017 Gregor Biswanger, Robert Mühsig
3+
Copyright (c) 2017-2023 Gregor Biswanger, Robert Mühsig
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+64-65
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
1-
[![Electron.NET Logo](https://github.com/ElectronNET/Electron.NET/blob/master/assets/images/electron.net-logo.png)](https://github.com/ElectronNET/Electron.NET)
1+
[![Electron.NET Logo](https://github.com/ElectronNET/Electron.NET/raw/main/assets/images/electron.net-logo.png)](https://github.com/ElectronNET/Electron.NET)
22

3-
[![donate](https://img.shields.io/badge/Donate-Donorbox-green.svg)](https://donorbox.org/electron-net)
4-
5-
6-
AppVeyor (Win/Linux): [![Build status](https://ci.appveyor.com/api/projects/status/q95h4xt14papwi05/branch/master?svg=true)](https://ci.appveyor.com/project/robertmuehsig/electron-net/branch/master)
7-
8-
* Checkout AppVeyor Artifacts: Contains the WebApp sample built for Windows & Linux!
9-
10-
Travis-CI (Win/macOS/Linux): [![Build Status](https://travis-ci.org/ElectronNET/Electron.NET.svg?branch=master)](https://travis-ci.org/ElectronNET/Electron.NET)
3+
[![donate](https://img.shields.io/badge/Donate-Donorbox-green.svg)](https://donorbox.org/electron-net) [![Gitter](https://badges.gitter.im/ElectronNET/community.svg)](https://gitter.im/ElectronNET/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![Build status](https://ci.appveyor.com/api/projects/status/q95h4xt14papwi05/branch/main?svg=true)](https://ci.appveyor.com/project/robertmuehsig/electron-net/branch/main)
114

125
Build cross platform desktop apps with .NET 6 and Blazor, ASP.NET Core (Razor Pages, MVC).
136

@@ -19,12 +12,11 @@ The CLI extensions hosts our toolset to build and start Electron.NET application
1912

2013
Well... there are lots of different approaches how to get a X-plat desktop app running. We thought it would be nice for .NET devs to use the ASP.NET Core environment and just embed it inside a pretty robust X-plat enviroment called Electron. Porting Electron to .NET is not a goal of this project, at least we don't have any clue how to do it. We just combine ASP.NET Core & Electron.
2114

22-
## 📦 NuGet:
15+
## 📦 NuGet
2316

24-
* API [![NuGet](https://img.shields.io/nuget/v/ElectronNET.API.svg?style=flat-square)](https://www.nuget.org/packages/ElectronNET.API/)
25-
* CLI [![NuGet](https://img.shields.io/nuget/v/ElectronNET.CLI.svg?style=flat-square)](https://www.nuget.org/packages/ElectronNET.CLI/)
17+
[![NuGet](https://img.shields.io/nuget/v/ElectronNET.API.svg?style=flat-square) ElectronNET.API ](https://www.nuget.org/packages/ElectronNET.API/) | [![NuGet](https://img.shields.io/nuget/v/ElectronNET.CLI.svg?style=flat-square) ElectronNET.CLI](https://www.nuget.org/packages/ElectronNET.CLI/)
2618

27-
## 🛠 Requirements to run:
19+
## 🛠 Requirements to Run
2820

2921
The current Electron.NET CLI builds Windows/macOS/Linux binaries. Our API uses .NET 6, so our minimum base OS is the same as [.NET 6](https://github.com/dotnet/core/blob/main/release-notes/6.0/supported-os.md).
3022

@@ -36,22 +28,20 @@ Also you should have installed:
3628

3729
[![Gitter](https://badges.gitter.im/ElectronNET/community.svg)](https://gitter.im/ElectronNET/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
3830

39-
## 🙏 Donate
40-
41-
We do this open source work in our free time. If you'd like us to invest more time on it, please [donate](https://donorbox.org/electron-net). Donation can be used to increase some issue priority. Thank you!
42-
43-
[![donate](https://img.shields.io/badge/Donate-Donorbox-green.svg)](https://donorbox.org/electron-net)
31+
Besides the chat on Gitter and the issues [discussed here](https://github.com/ElectronNET/Electron.NET/issues) you can also use [StackOverflow](https://stackoverflow.com/questions/tagged/electron.net) with the tag `electron.net`.
4432

4533
## 👩‍🏫 Usage
4634

4735
To activate and communicate with the "native" (sort of native...) Electron API include the [ElectronNET.API NuGet package](https://www.nuget.org/packages/ElectronNET.API/) in your ASP.NET Core app.
4836

49-
````
37+
```
5038
PM> Install-Package ElectronNET.API
51-
````
39+
```
40+
41+
## Setup Using Minimal-API
42+
43+
You start Electron.NET up with an `UseElectron` WebHostBuilder-Extension and open the Electron Window:
5244

53-
## Minimal-API
54-
You start Electron.NET up with an `UseElectron` WebHostBuilder-Extension and open the Electron Window:
5545
### Program.cs
5646

5747
```csharp
@@ -71,12 +61,12 @@ var app = builder.Build();
7161
await app.StartAsync();
7262

7363
// Open the Electron-Window here
74-
Task.Run(async () => await Electron.WindowManager.CreateWindowAsync());
64+
await Electron.WindowManager.CreateWindowAsync();
7565

7666
app.WaitForShutdown();
7767
```
7868

79-
## Conventional
69+
## Setup using Normal-API
8070

8171
### Program.cs
8272

@@ -94,76 +84,76 @@ public static IHostBuilder CreateHostBuilder(string[] args) =>
9484

9585
### Startup.cs
9686

97-
Open the Electron Window in the Startup.cs file:
87+
Open the Electron Window in the *Startup.cs* file:
9888

9989
```csharp
10090
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
10191
{
102-
...
92+
//...
10393
104-
// Open the Electron-Window here
105-
Task.Run(async () => await Electron.WindowManager.CreateWindowAsync());
94+
Electron.WindowManager.CreateWindowAsync();
10695
}
10796
```
10897

109-
## 🚀 Start the Application
98+
## 🚀 Starting the Application
11099

111100
To start the application make sure you have installed the "[ElectronNET.CLI](https://www.nuget.org/packages/ElectronNET.CLI/)" packages as global tool:
112101

113-
```
102+
```sh
114103
dotnet tool install ElectronNET.CLI -g
115104
```
116105

117106
At the first time, you need an Electron.NET project initialization. Type the following command in your ASP.NET Core folder:
118107

119-
```
108+
```sh
120109
electronize init
121110
```
122111

123112
* Now a electronnet.manifest.json should appear in your ASP.NET Core project
124113
* Now run the following:
125114

126-
```
115+
```sh
127116
electronize start
128117
```
129118

130119
### Note
131-
> Only the first electronize start is slow. The next will go on faster.
120+
121+
> Only the first `electronize start` is slow. The next will go on faster.
132122
133123
## 🔭 Develop Electron.NET apps using a file watcher
134124

135125
The file watcher is included with version 8.31.1 of Electron.NET. For example, a file change can trigger compilation, test execution, or deployment. The Electron.NET window will automatically refresh and new code changes will be visible more quickly. The following Electron.NET CLI command is required:
136126

137-
```
127+
```sh
138128
electronize start /watch
139129
```
140130

141131
### Note
142-
> Only the first electronize start is slow. The next will go on faster.
143132

144-
## 🐞 Debug
133+
> Only the first `electronize start` is slow. The next will go on faster.
145134
146-
Start your Electron.NET application with the Electron.NET CLI command. In Visual Studio attach to your running application instance. Go in the __Debug__ Menu and click on __Attach to Process...__. Sort by your projectname on the right and select it on the list.
135+
## 🐞 Debugging the Application
147136

137+
Start your Electron.NET application with the Electron.NET CLI command. In Visual Studio attach to your running application instance. Go in the __Debug__ Menu and click on __Attach to Process...__. Sort by your projectname on the right and select it on the list.
148138

149-
## 📔 Usage of the Electron-API
139+
## 📔 Usage of the Electron API
150140

151141
A complete documentation will follow. Until then take a look in the source code of the sample application:
152142
[Electron.NET API Demos](https://github.com/ElectronNET/electron.net-api-demos)
153143

154144
In this YouTube video, we show you how you can create a new project, use the Electron.NET API, debug a application and build an executable desktop app for Windows: [Electron.NET - Getting Started](https://www.youtube.com/watch?v=nuM6AojRFHk)
155145

156-
## Build
146+
## Building Release Artifacts
157147

158148
Here you need the Electron.NET CLI as well. Type the following command in your ASP.NET Core folder:
159149

160-
```
150+
```sh
161151
electronize build /target win
162152
```
163153

164154
There are additional platforms available:
165155

166-
```
156+
```sh
167157
electronize build /target win
168158
electronize build /target osx
169159
electronize build /target linux
@@ -173,33 +163,34 @@ Those three "default" targets will produce x64 packages for those platforms.
173163

174164
For certain NuGet packages or certain scenarios you may want to build a pure x86 application. To support those things you can define the desired [.NET Core runtime](https://docs.microsoft.com/en-us/dotnet/core/rid-catalog), the [electron platform](https://github.com/electron-userland/electron-packager/blob/master/docs/api.md#platform) and [electron architecture](https://github.com/electron-userland/electron-packager/blob/master/docs/api.md#arch) like this:
175165

176-
```
166+
```sh
177167
electronize build /target custom "win7-x86;win32" /electron-arch ia32
178168
```
179169

180170
The end result should be an electron app under your __/bin/desktop__ folder.
181171

182172
### Note
173+
183174
> 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.
184175
185176
## 🔄 Update
186177

187178
After an update to the latest Electron.API package, an update to the latest Electron.CLI is always required. In addition, always update the CLI via NuGet:
188179

189-
```
180+
```sh
190181
dotnet tool update ElectronNET.CLI -g
191182
```
192183

193184
## 👨‍💻 Authors
194185

195-
* **Gregor Biswanger** - (Microsoft MVP, Intel Black Belt and Intel Software Innovator) is a freelance lecturer, consultant, trainer, author and speaker. He is a consultant for large and medium-sized companies, organizations and agencies for software architecture, web- and cross-platform development. You can find Gregor often on the road attending or speaking at international conferences. - [Cross-Platform-Blog](http://www.cross-platform-blog.com) - Twitter [@BFreakout](https://www.twitter.com/BFreakout)
196-
* **Dr. Florian Rappl** - Software Developer - from Munich, Germany. Microsoft MVP & Web Geek. - [Florian Rappl](https://florianrappl.de) - Twitter [@florianrappl](https://twitter.com/florianrappl)
197-
* **Robert Muehsig** - Software Developer - from Dresden, Germany, now living & working in Switzerland. Microsoft MVP & Web Geek. - [codeinside Blog](https://blog.codeinside.eu) - Twitter [@robert0muehsig](https://twitter.com/robert0muehsig)
186+
* **[Gregor Biswanger](https://github.com/GregorBiswanger)** - (Microsoft MVP, Intel Black Belt and Intel Software Innovator) is a freelance lecturer, consultant, trainer, author and speaker. He is a consultant for large and medium-sized companies, organizations and agencies for software architecture, web- and cross-platform development. You can find Gregor often on the road attending or speaking at international conferences. - [Cross-Platform-Blog](http://www.cross-platform-blog.com) - Twitter [@BFreakout](https://www.twitter.com/BFreakout)
187+
* **[Dr. Florian Rappl](https://github.com/FlorianRappl)** - Software Developer - from Munich, Germany. Microsoft MVP & Web Geek. - [The Art of Micro Frontends](https://microfrontends.art) - [Homepage](https://florian-rappl.de) - Twitter [@florianrappl](https://twitter.com/florianrappl)
188+
* **[Robert Muehsig](https://github.com/robertmuehsig)** - Software Developer - from Dresden, Germany, now living & working in Switzerland. Microsoft MVP & Web Geek. - [codeinside Blog](https://blog.codeinside.eu) - Twitter [@robert0muehsig](https://twitter.com/robert0muehsig)
198189

199190
See also the list of [contributors](https://github.com/ElectronNET/Electron.NET/graphs/contributors) who participated in this project.
200191

201-
202192
## 🙋‍♀️🙋‍♂ Contributing
193+
203194
Feel free to submit a pull request if you find any bugs (to see a list of active issues, visit the [Issues section](https://github.com/ElectronNET/Electron.NET/issues).
204195
Please make sure all commits are properly documented.
205196

@@ -219,26 +210,34 @@ We do this open source work in our free time. If you'd like us to invest more ti
219210

220211
[![donate](https://img.shields.io/badge/Donate-Donorbox-green.svg)](https://donorbox.org/electron-net)
221212

213+
Alternatively, consider using a GitHub sponsorship for the core maintainers:
214+
215+
- [Gregor Biswanger](https://github.com/sponsors/GregorBiswanger)
216+
- [Florian Rappl](https://github.com/sponsors/FlorianRappl)
217+
218+
Any support appreciated! 🍻
219+
222220
## 🎉 License
223-
MIT-licensed
221+
222+
MIT-licensed. See [LICENSE](./LICENSE) for details.
224223

225224
**Enjoy!**
226-
227-
228225

229226
## 📝 Important notes
230227

231228
### ElectronNET.API & ElectronNET.CLI Version 9.31.2
232229

233230
Make sure you also have the new Electron.NET API & CLI 9.31.2 version.
234231

235-
```
232+
```sh
236233
dotnet tool update ElectronNET.CLI -g
237234
```
238235

239-
This now uses [electron-builder](https://www.electron.build/configuration/configuration) and the necessary configuration to build is made in the **electron.manifest.json** file (on the build part). In addition, own Electron.NET configurations are stored (on the root). Please make sure that your **electron.manifest.json** file has the following new structure:
236+
This now uses [electron-builder](https://www.electron.build/configuration/configuration) and the necessary configuration to build is made in the **electron.manifest.json** file (on the build part). In addition, own Electron.NET configurations are stored (on the root).
240237

241-
```
238+
Please make sure that your **electron.manifest.json** file has the following new structure:
239+
240+
```json
242241
{
243242
"executable": "{{executable}}",
244243
"splashscreen": {
@@ -277,49 +276,49 @@ dotnet tool update ElectronNET.CLI -g
277276

278277
### ElectronNET.CLI Version 0.0.9
279278

280-
In the Version 0.0.9 the CLI was not a global tool and needed to be registred like this in the .csproj:
279+
In the Version 0.0.9 the CLI was not a global tool and needed to be registered like this in the *.csproj*:
281280

282-
```
281+
```xml
283282
<ItemGroup>
284-
<DotNetCliToolReference Include="ElectronNET.CLI" Version="0.0.9" />
283+
<DotNetCliToolReference Include="ElectronNET.CLI" Version="0.0.9" />
285284
</ItemGroup>
286285
```
287286

288-
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:
287+
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:
289288

290-
```
289+
```sh
291290
dotnet restore
292291
```
293292

294-
295293
If you still use this version you will need to invoke it like this:
296294

297-
```
295+
```sh
298296
electronize ...
299297
```
300298

301-
### Node Integration
302-
Electron.NET requires Node Integration to be enabled for IPC to function. If you are not using the IPC functionality you can disable Node Integration like so:
299+
### Node.js Integration
300+
301+
Electron.NET requires Node.js integration to be enabled for IPC to function. If you are not using the IPC functionality you can disable Node.js integration like so:
303302

304303
```csharp
305304
WebPreferences wp = new WebPreferences();
306305
wp.NodeIntegration = false;
307306
BrowserWindowOptions browserWindowOptions = new BrowserWindowOptions
308307
{
309308
WebPreferences = wp
310-
}
309+
};
311310

312311
```
313312

314313
### Dependency Injection
315314

316-
ElectronNET.Api can be added to your DI container within the Startup class. All of the modules available in Electron will be added as Singletons.
315+
ElectronNET.API can be added to your DI container within the `Startup` class. All of the modules available in Electron will be added as Singletons.
317316

318317
```csharp
319318
using ElectronNET.API;
320319

321320
public void ConfigureServices(IServiceCollection services)
322321
{
323-
services.AddElectron()
322+
services.AddElectron();
324323
}
325324
```

artifacts/.gitkeep

Whitespace-only changes.

artifacts/readme.md

-1
This file was deleted.

package-lock.json

-3
This file was deleted.

0 commit comments

Comments
 (0)