Skip to content

Commit 0fac6ae

Browse files
2 parents 24d1f6f + 73f7e5a commit 0fac6ae

File tree

6 files changed

+25
-18
lines changed

6 files changed

+25
-18
lines changed

ElectronNET.API/BrowserWindow.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1929,7 +1929,7 @@ public void Reload()
19291929
public void SetMenu(MenuItem[] menuItems)
19301930
{
19311931
menuItems.AddMenuItemsId();
1932-
BridgeConnector.Socket.Emit("browserWindowSetMenu", JArray.FromObject(menuItems, _jsonSerializer));
1932+
BridgeConnector.Socket.Emit("browserWindowSetMenu", Id, JArray.FromObject(menuItems, _jsonSerializer));
19331933
_items.AddRange(menuItems);
19341934

19351935
BridgeConnector.Socket.Off("windowMenuItemClicked");
@@ -1950,7 +1950,7 @@ public void SetMenu(MenuItem[] menuItems)
19501950
/// assumed.
19511951
/// </summary>
19521952
/// <param name="progress"></param>
1953-
public void SetProgressBar(int progress)
1953+
public void SetProgressBar(double progress)
19541954
{
19551955
BridgeConnector.Socket.Emit("browserWindowSetProgressBar", Id, progress);
19561956
}
@@ -1967,7 +1967,7 @@ public void SetProgressBar(int progress)
19671967
/// </summary>
19681968
/// <param name="progress"></param>
19691969
/// <param name="progressBarOptions"></param>
1970-
public void SetProgressBar(int progress, ProgressBarOptions progressBarOptions)
1970+
public void SetProgressBar(double progress, ProgressBarOptions progressBarOptions)
19711971
{
19721972
BridgeConnector.Socket.Emit("browserWindowSetProgressBar", Id, progress, JObject.FromObject(progressBarOptions, _jsonSerializer));
19731973
}

ElectronNET.CLI/Commands/InitCommand.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,16 @@ private static void EditLaunchSettings(string currentDirectory)
100100

101101
string launchSettingText = File.ReadAllText(launchSettingFile);
102102

103-
if (launchSettingText.Contains("electronize start") == false)
103+
if (launchSettingText.Contains("\"executablePath\": \"electronize\"") == false)
104104
{
105105
StringBuilder debugProfileBuilder = new StringBuilder();
106106
debugProfileBuilder.AppendLine("profiles\": {");
107-
debugProfileBuilder.AppendLine("\"Electron.NET App\": {");
108-
debugProfileBuilder.AppendLine("\"commandName\": \"Executable\",");
109-
debugProfileBuilder.AppendLine("\"executablePath\": \"C:\\\\Program Files\\\\dotnet\\\\dotnet.exe\",");
110-
debugProfileBuilder.AppendLine("\"commandLineArgs\": \"electronize start\"");
111-
debugProfileBuilder.AppendLine("},");
107+
debugProfileBuilder.AppendLine(" \"Electron.NET App\": {");
108+
debugProfileBuilder.AppendLine(" \"commandName\": \"Executable\",");
109+
debugProfileBuilder.AppendLine(" \"executablePath\": \"electronize\",");
110+
debugProfileBuilder.AppendLine(" \"commandLineArgs\": \"start\",");
111+
debugProfileBuilder.AppendLine(" \"workingDirectory\": \".\"");
112+
debugProfileBuilder.AppendLine(" },");
112113

113114
launchSettingText = launchSettingText.Replace("profiles\": {", debugProfileBuilder.ToString());
114115
File.WriteAllText(launchSettingFile, launchSettingText);

ElectronNET.CLI/ProcessHelper.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
using System;
22
using System.Diagnostics;
33
using System.Runtime.InteropServices;
4+
using System.Text.RegularExpressions;
45

56
namespace ElectronNET.CLI
67
{
78
public class ProcessHelper
89
{
10+
private readonly static Regex ErrorRegex = new Regex(@"\berror\b", RegexOptions.IgnoreCase | RegexOptions.Compiled);
11+
912
public static int CmdExecute(string command, string workingDirectoryPath, bool output = true, bool waitForExit = true)
1013
{
1114
using (Process cmd = new Process())
@@ -44,7 +47,7 @@ public static int CmdExecute(string command, string workingDirectoryPath, bool o
4447
// 1 if something fails
4548
if (e != null && string.IsNullOrWhiteSpace(e.Data) == false)
4649
{
47-
if (e.Data.ToLowerInvariant().Contains("error"))
50+
if (ErrorRegex.IsMatch(e.Data))
4851
{
4952
returnCode = 1;
5053
}
@@ -63,7 +66,7 @@ public static int CmdExecute(string command, string workingDirectoryPath, bool o
6366
// 1 if something fails
6467
if (e != null && string.IsNullOrWhiteSpace(e.Data) == false)
6568
{
66-
if (e.Data.ToLowerInvariant().Contains("error"))
69+
if (ErrorRegex.IsMatch(e.Data))
6770
{
6871
returnCode = 1;
6972
}

ElectronNET.Host/api/browserWindows.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ElectronNET.WebApp/Properties/launchSettings.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88
}
99
},
1010
"profiles": {
11+
"Electron.NET App": {
12+
"commandName": "Executable",
13+
"executablePath": "electronize",
14+
"commandLineArgs": "start",
15+
"workingDirectory": "."
16+
},
17+
1118
"IIS Express": {
1219
"commandName": "IISExpress",
1320
"environmentVariables": {
@@ -22,10 +29,5 @@
2229
},
2330
"applicationUrl": "http://localhost:50395/"
2431
},
25-
"Electron.NET App": {
26-
"commandName": "Executable",
27-
"executablePath": "C:\\Program Files\\dotnet\\dotnet.exe",
28-
"commandLineArgs": "electronize start"
29-
}
3032
}
3133
}

buildReleaseNuGetPackages.cmd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ cd ElectronNet.CLI
1010
dotnet restore
1111
dotnet build --configuration Release --force /property:Version=0.0.11
1212
dotnet pack /p:Version=0.0.11 --configuration Release --force --output "%~dp0artifacts"
13+
cd ..

0 commit comments

Comments
 (0)