From 933c0afbfa4573a07d33c67df809f2ced7e3eb4c Mon Sep 17 00:00:00 2001 From: Jared Goodwin Date: Tue, 15 Aug 2023 03:59:04 -0700 Subject: [PATCH 01/15] Send chat disconnected message when tech closes the window (was missing). --- Server/Components/Devices/ChatCard.razor.cs | 1 + Server/Hubs/CircuitConnection.cs | 6 +++--- submodules/Immense.RemoteControl | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Server/Components/Devices/ChatCard.razor.cs b/Server/Components/Devices/ChatCard.razor.cs index 370621f0..15fe47c6 100644 --- a/Server/Components/Devices/ChatCard.razor.cs +++ b/Server/Components/Devices/ChatCard.razor.cs @@ -85,6 +85,7 @@ public partial class ChatCard : AuthComponentBase, IAsyncDisposable private async Task CloseChatCard() { + await CircuitConnection.SendChat(string.Empty, $"{Session.DeviceId}", true); _ = ChatSessionStore.TryRemove($"{Session.DeviceId}", out _); var message = new ChatSessionsChangedMessage(); await Messenger.Send(message, CircuitConnection.ConnectionId); diff --git a/Server/Hubs/CircuitConnection.cs b/Server/Hubs/CircuitConnection.cs index 5c00c4f7..da55cb5b 100644 --- a/Server/Hubs/CircuitConnection.cs +++ b/Server/Hubs/CircuitConnection.cs @@ -45,7 +45,7 @@ public interface ICircuitConnection Task RunScript(IEnumerable deviceIds, Guid savedScriptId, int scriptRunId, ScriptInputType scriptInputType, bool runAsHostedService); - Task SendChat(string message, string deviceId); + Task SendChat(string message, string deviceId, bool isDisconnecting = false); Task TransferFileFromBrowserToAgent(string deviceId, string transferId, string[] fileIds); Task TriggerHeartbeat(string deviceId); @@ -360,7 +360,7 @@ public class CircuitConnection : CircuitHandler, ICircuitConnection } - public async Task SendChat(string message, string deviceId) + public async Task SendChat(string message, string deviceId, bool isDisconnecting = false) { if (!_dataService.DoesUserHaveAccessToDevice(deviceId, User)) { @@ -392,7 +392,7 @@ public class CircuitConnection : CircuitHandler, ICircuitConnection message, orgResult.Value, User.OrganizationID, - false, + isDisconnecting, ConnectionId); } diff --git a/submodules/Immense.RemoteControl b/submodules/Immense.RemoteControl index b306cc12..9abf3d89 160000 --- a/submodules/Immense.RemoteControl +++ b/submodules/Immense.RemoteControl @@ -1 +1 @@ -Subproject commit b306cc12afcc8c7d758a92682d3a06d2519b9735 +Subproject commit 9abf3d89436f17938f5d5029bf0016a050c4a4fe From ac6c9619507644394afd958091e57f8223aec51f Mon Sep 17 00:00:00 2001 From: Jared Goodwin Date: Wed, 16 Aug 2023 10:30:17 -0700 Subject: [PATCH 02/15] Get latest submodule changes working. --- Agent/Agent.csproj | 8 +- Agent/Services/AgentHubConnection.cs | 3 +- Agent/Services/Windows/AppLauncherWin.cs | 4 +- .../Windows/DeviceInfoGeneratorWin.cs | 3 +- Desktop.Linux/Desktop.Linux.csproj | 3 +- Desktop.Linux/Program.cs | 161 ++++++++++-------- Desktop.Win/Desktop.Win.csproj | 1 + Desktop.Win/Program.cs | 147 ++++++++-------- Remotely.sln | 75 ++++---- .../API/OrganizationManagementController.cs | 8 +- Server/Server.csproj | 18 +- Shared/Shared.csproj | 2 +- Tests/LoadTester/LoadTester.csproj | 1 + Tests/Server.Tests/Server.Tests.csproj | 6 +- Tests/Shared.Tests/Shared.Tests.csproj | 2 +- submodules/Immense.RemoteControl | 2 +- 16 files changed, 225 insertions(+), 219 deletions(-) diff --git a/Agent/Agent.csproj b/Agent/Agent.csproj index fdf64ab5..9aa04558 100644 --- a/Agent/Agent.csproj +++ b/Agent/Agent.csproj @@ -24,14 +24,14 @@ - - + + - + @@ -41,7 +41,7 @@ - + diff --git a/Agent/Services/AgentHubConnection.cs b/Agent/Services/AgentHubConnection.cs index 0a803f7e..3aec5884 100644 --- a/Agent/Services/AgentHubConnection.cs +++ b/Agent/Services/AgentHubConnection.cs @@ -1,4 +1,4 @@ -using Immense.RemoteControl.Desktop.Native.Windows; +using Immense.RemoteControl.Desktop.Shared.Native.Windows; using Microsoft.AspNetCore.SignalR.Client; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; @@ -11,7 +11,6 @@ using Remotely.Shared.Interfaces; using Remotely.Shared.Models; using Remotely.Shared.Services; using System; -using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; diff --git a/Agent/Services/Windows/AppLauncherWin.cs b/Agent/Services/Windows/AppLauncherWin.cs index cfef5df8..487df527 100644 --- a/Agent/Services/Windows/AppLauncherWin.cs +++ b/Agent/Services/Windows/AppLauncherWin.cs @@ -1,15 +1,13 @@ -using Immense.RemoteControl.Desktop.Native.Windows; +using Immense.RemoteControl.Desktop.Shared.Native.Windows; using Microsoft.AspNetCore.SignalR.Client; using Microsoft.Extensions.Logging; using Remotely.Agent.Interfaces; using Remotely.Shared.Models; using Remotely.Shared.Utilities; using System; -using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Runtime.Versioning; -using System.Security.Cryptography; using System.Security.Principal; using System.Threading.Tasks; diff --git a/Agent/Services/Windows/DeviceInfoGeneratorWin.cs b/Agent/Services/Windows/DeviceInfoGeneratorWin.cs index 65b4ecdf..39ae7a35 100644 --- a/Agent/Services/Windows/DeviceInfoGeneratorWin.cs +++ b/Agent/Services/Windows/DeviceInfoGeneratorWin.cs @@ -1,8 +1,7 @@ -using Immense.RemoteControl.Desktop.Native.Windows; +using Immense.RemoteControl.Desktop.Shared.Native.Windows; using Microsoft.Extensions.Logging; using Remotely.Agent.Interfaces; using Remotely.Shared.Dtos; -using Remotely.Shared.Models; using System; using System.Linq; using System.Threading.Tasks; diff --git a/Desktop.Linux/Desktop.Linux.csproj b/Desktop.Linux/Desktop.Linux.csproj index ae111208..f635e459 100644 --- a/Desktop.Linux/Desktop.Linux.csproj +++ b/Desktop.Linux/Desktop.Linux.csproj @@ -57,7 +57,8 @@ + - + diff --git a/Desktop.Linux/Program.cs b/Desktop.Linux/Program.cs index 8cfc727d..b3c15d2c 100644 --- a/Desktop.Linux/Program.cs +++ b/Desktop.Linux/Program.cs @@ -7,87 +7,102 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Remotely.Shared.Services; using Immense.RemoteControl.Desktop.Shared.Services; -using Immense.RemoteControl.Desktop.Services; using System.Diagnostics; -using Immense.RemoteControl.Desktop.Startup; using Remotely.Shared.Utilities; using Immense.RemoteControl.Desktop.Shared.Startup; using System.Linq; +using Immense.RemoteControl.Desktop.Linux.Startup; +using Immense.RemoteControl.Desktop.UI.Services; +using Avalonia; +using Immense.RemoteControl.Desktop.UI; -var version = AppVersionHelper.GetAppVersion(); -var logger = new FileLogger("Remotely_Desktop", version, "Program.cs"); -var filePath = Environment.ProcessPath ?? Environment.GetCommandLineArgs().First(); -var serverUrl = Debugger.IsAttached ? "http://localhost:5000" : string.Empty; -var getEmbeddedResult = await EmbeddedServerDataSearcher.Instance.TryGetEmbeddedData(filePath); -if (getEmbeddedResult.IsSuccess) +public class Program { - serverUrl = getEmbeddedResult.Value.ServerUrl.AbsoluteUri; -} -else -{ - logger.LogWarning(getEmbeddedResult.Exception, "Failed to extract embedded server data."); -} + // This is needed for the visual designer to work. + public static AppBuilder BuildAvaloniaApp() + => AppBuilder.Configure() + .UsePlatformDetect() + .WithInterFont() + .LogToTrace(); -var services = new ServiceCollection(); - -services.AddSingleton(); -services.AddSingleton(); - -services.AddRemoteControlLinux( - config => + public static async Task Main(string[] args) { - config.AddBrandingProvider(); - }); + var version = AppVersionHelper.GetAppVersion(); + var logger = new FileLogger("Remotely_Desktop", version, "Program.cs"); + var filePath = Environment.ProcessPath ?? Environment.GetCommandLineArgs().First(); + var serverUrl = Debugger.IsAttached ? "http://localhost:5000" : string.Empty; + var getEmbeddedResult = await EmbeddedServerDataSearcher.Instance.TryGetEmbeddedData(filePath); + if (getEmbeddedResult.IsSuccess) + { + serverUrl = getEmbeddedResult.Value.ServerUrl.AbsoluteUri; + } + else + { + logger.LogWarning(getEmbeddedResult.Exception, "Failed to extract embedded server data."); + } -services.AddLogging(builder => -{ - if (EnvironmentHelper.IsDebug) - { - builder.SetMinimumLevel(LogLevel.Debug); + var services = new ServiceCollection(); + + services.AddSingleton(); + services.AddSingleton(); + + services.AddRemoteControlLinux( + config => + { + config.AddBrandingProvider(); + }); + + services.AddLogging(builder => + { + if (EnvironmentHelper.IsDebug) + { + builder.SetMinimumLevel(LogLevel.Debug); + } + builder.AddProvider(new FileLoggerProvider("Remotely_Desktop", version)); + }); + + var provider = services.BuildServiceProvider(); + + var appState = provider.GetRequiredService(); + var orgIdProvider = provider.GetRequiredService(); + + if (getEmbeddedResult.IsSuccess) + { + orgIdProvider.OrganizationId = getEmbeddedResult.Value.OrganizationId; + appState.Host = getEmbeddedResult.Value.ServerUrl.AbsoluteUri; + } + + if (appState.ArgDict.TryGetValue("org-id", out var orgId)) + { + orgIdProvider.OrganizationId = orgId; + } + + var result = await provider.UseRemoteControlClient( + args, + "The remote control client for Remotely.", + serverUrl, + false); + + if (!result.IsSuccess) + { + logger.LogError(result.Exception, "Failed to start remote control client."); + Environment.Exit(1); + } + + + Console.WriteLine("Press Ctrl + C to exit."); + + var shutdownService = provider.GetRequiredService(); + Console.CancelKeyPress += async (s, e) => + { + await shutdownService.Shutdown(); + }; + + var dispatcher = provider.GetRequiredService(); + try + { + await Task.Delay(Timeout.InfiniteTimeSpan, dispatcher.ApplicationExitingToken); + } + catch (TaskCanceledException) { } } - builder.AddProvider(new FileLoggerProvider("Remotely_Desktop", version)); -}); - -var provider = services.BuildServiceProvider(); - -var appState = provider.GetRequiredService(); -var orgIdProvider = provider.GetRequiredService(); - -if (getEmbeddedResult.IsSuccess) -{ - orgIdProvider.OrganizationId = getEmbeddedResult.Value.OrganizationId; - appState.Host = getEmbeddedResult.Value.ServerUrl.AbsoluteUri; } - -if (appState.ArgDict.TryGetValue("org-id", out var orgId)) -{ - orgIdProvider.OrganizationId = orgId; -} - -var result = await provider.UseRemoteControlClient( - args, - "The remote control client for Remotely.", - serverUrl, - false); - -if (!result.IsSuccess) -{ - logger.LogError(result.Exception, "Failed to start remote control client."); - Environment.Exit(1); -} - - -Console.WriteLine("Press Ctrl + C to exit."); - -var shutdownService = provider.GetRequiredService(); -Console.CancelKeyPress += async (s, e) => -{ - await shutdownService.Shutdown(); -}; - -var dispatcher = provider.GetRequiredService(); -try -{ - await Task.Delay(Timeout.InfiniteTimeSpan, dispatcher.AppCancellationToken); -} -catch (TaskCanceledException) { } \ No newline at end of file diff --git a/Desktop.Win/Desktop.Win.csproj b/Desktop.Win/Desktop.Win.csproj index 3d404982..d34e6317 100644 --- a/Desktop.Win/Desktop.Win.csproj +++ b/Desktop.Win/Desktop.Win.csproj @@ -52,6 +52,7 @@ + diff --git a/Desktop.Win/Program.cs b/Desktop.Win/Program.cs index b18238f3..33e828da 100644 --- a/Desktop.Win/Program.cs +++ b/Desktop.Win/Program.cs @@ -1,9 +1,6 @@ -using Immense.RemoteControl.Desktop.Shared.Abstractions; -using Immense.RemoteControl.Desktop.UI.WPF.Services; -using System.Threading.Tasks; +using System.Threading.Tasks; using System.Threading; using System; -using Immense.RemoteControl.Desktop.Windows; using Remotely.Desktop.Shared.Services; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; @@ -11,75 +8,91 @@ using Remotely.Shared.Services; using Immense.RemoteControl.Desktop.Shared.Services; using System.Diagnostics; using Remotely.Shared.Utilities; -using Immense.RemoteControl.Desktop.Windows.Startup; using Immense.RemoteControl.Desktop.Shared.Startup; using System.Linq; +using Immense.RemoteControl.Immense.RemoteControl.Desktop.Windows.Startup; +using Immense.RemoteControl.Desktop.UI.Services; +using Avalonia; +using Immense.RemoteControl.Desktop.UI; -var version = AppVersionHelper.GetAppVersion(); -var logger = new FileLogger("Remotely_Desktop", version, "Program.cs"); -var filePath = Environment.ProcessPath ?? Environment.GetCommandLineArgs().First(); -var serverUrl = Debugger.IsAttached ? "https://localhost:5001" : string.Empty; -var getEmbeddedResult = await EmbeddedServerDataSearcher.Instance.TryGetEmbeddedData(filePath); -if (getEmbeddedResult.IsSuccess) +public class Program { - serverUrl = getEmbeddedResult.Value.ServerUrl.AbsoluteUri; -} -else -{ - logger.LogWarning(getEmbeddedResult.Exception, "Failed to extract embedded server data."); -} -var services = new ServiceCollection(); + // This is needed for the visual designer to work. + public static AppBuilder BuildAvaloniaApp() + => AppBuilder.Configure() + .UsePlatformDetect() + .WithInterFont() + .LogToTrace(); -services.AddSingleton(); -services.AddSingleton(EmbeddedServerDataSearcher.Instance); - -services.AddRemoteControlWindows( - config => + public static async Task Main(string[] args) { - config.AddBrandingProvider(); - }); + var version = AppVersionHelper.GetAppVersion(); + var logger = new FileLogger("Remotely_Desktop", version, "Program.cs"); + var filePath = Environment.ProcessPath ?? Environment.GetCommandLineArgs().First(); + var serverUrl = Debugger.IsAttached ? "https://localhost:5001" : string.Empty; + var getEmbeddedResult = await EmbeddedServerDataSearcher.Instance.TryGetEmbeddedData(filePath); + if (getEmbeddedResult.IsSuccess) + { + serverUrl = getEmbeddedResult.Value.ServerUrl.AbsoluteUri; + } + else + { + logger.LogWarning(getEmbeddedResult.Exception, "Failed to extract embedded server data."); + } + var services = new ServiceCollection(); -services.AddLogging(builder => -{ - if (EnvironmentHelper.IsDebug) - { - builder.SetMinimumLevel(LogLevel.Debug); + services.AddSingleton(); + services.AddSingleton(EmbeddedServerDataSearcher.Instance); + + services.AddRemoteControlWindows( + config => + { + config.AddBrandingProvider(); + }); + + services.AddLogging(builder => + { + if (EnvironmentHelper.IsDebug) + { + builder.SetMinimumLevel(LogLevel.Debug); + } + builder.AddProvider(new FileLoggerProvider("Remotely_Desktop", version)); + }); + + var provider = services.BuildServiceProvider(); + + var appState = provider.GetRequiredService(); + var orgIdProvider = provider.GetRequiredService(); + + if (getEmbeddedResult.IsSuccess) + { + orgIdProvider.OrganizationId = getEmbeddedResult.Value.OrganizationId; + appState.Host = getEmbeddedResult.Value.ServerUrl.AbsoluteUri; + } + + if (appState.ArgDict.TryGetValue("org-id", out var orgId)) + { + orgIdProvider.OrganizationId = orgId; + } + + var result = await provider.UseRemoteControlClient( + args, + "The remote control client for Remotely.", + serverUrl, + false); + + if (!result.IsSuccess) + { + logger.LogError(result.Exception, "Failed to start remote control client."); + Environment.Exit(1); + } + + var dispatcher = provider.GetRequiredService(); + + try + { + await Task.Delay(Timeout.InfiniteTimeSpan, dispatcher.ApplicationExitingToken); + } + catch (TaskCanceledException) { } } - builder.AddProvider(new FileLoggerProvider("Remotely_Desktop", version)); -}); - -var provider = services.BuildServiceProvider(); - -var appState = provider.GetRequiredService(); -var orgIdProvider = provider.GetRequiredService(); - -if (getEmbeddedResult.IsSuccess) -{ - orgIdProvider.OrganizationId = getEmbeddedResult.Value.OrganizationId; - appState.Host = getEmbeddedResult.Value.ServerUrl.AbsoluteUri; } - -if (appState.ArgDict.TryGetValue("org-id", out var orgId)) -{ - orgIdProvider.OrganizationId = orgId; -} - -var result = await provider.UseRemoteControlClient( - args, - "The remote control client for Remotely.", - serverUrl, - false); - -if (!result.IsSuccess) -{ - logger.LogError(result.Exception, "Failed to start remote control client."); - Environment.Exit(1); -} - -var dispatcher = provider.GetRequiredService(); - -try -{ - await Task.Delay(Timeout.InfiniteTimeSpan, dispatcher.ApplicationExitingToken); -} -catch (TaskCanceledException) { } \ No newline at end of file diff --git a/Remotely.sln b/Remotely.sln index bcaa2def..60c0b3ea 100644 --- a/Remotely.sln +++ b/Remotely.sln @@ -65,20 +65,18 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docker", "Docker", "{963B55 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Immense.RemoteControl.Desktop.Shared", "submodules\Immense.RemoteControl\Immense.RemoteControl.Desktop.Shared\Immense.RemoteControl.Desktop.Shared.csproj", "{3EB48B01-A672-4658-868B-8CA21FF73929}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Immense.RemoteControl.Desktop.UI.WPF", "submodules\Immense.RemoteControl\Immense.RemoteControl.Desktop.UI.WPF\Immense.RemoteControl.Desktop.UI.WPF.csproj", "{A6C36B1F-A5EA-4C9C-88E2-FAA05CE89D78}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Immense.RemoteControl.Desktop.Windows", "submodules\Immense.RemoteControl\Immense.RemoteControl.Desktop.Windows\Immense.RemoteControl.Desktop.Windows.csproj", "{7FA4456D-8695-4990-B20A-B897CF9DF0EF}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Immense.RemoteControl.Server", "submodules\Immense.RemoteControl\Immense.RemoteControl.Server\Immense.RemoteControl.Server.csproj", "{8CBED18D-64A8-44C0-8433-EE14E93B472A}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Immense.RemoteControl.Shared", "submodules\Immense.RemoteControl\Immense.RemoteControl.Shared\Immense.RemoteControl.Shared.csproj", "{FEF0D431-EB2F-4C08-A125-8DF59AFDA525}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Immense.RemoteControl.Desktop", "submodules\Immense.RemoteControl\Immense.RemoteControl.Desktop\Immense.RemoteControl.Desktop.csproj", "{034984DC-4B47-42E9-8648-F258C40C7926}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Immense.RemoteControl.Desktop.Native", "submodules\Immense.RemoteControl\Immense.RemoteControl.Desktop.Native\Immense.RemoteControl.Desktop.Native.csproj", "{7A8378BC-8169-4A33-93C6-47C699C5E74D}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{E4D83C37-8B98-44FB-898B-9AA1BB223C66}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Immense.RemoteControl.Desktop.Linux", "submodules\Immense.RemoteControl\Immense.RemoteControl.Desktop.Linux\Immense.RemoteControl.Desktop.Linux.csproj", "{2FF27827-1F43-474E-A0E3-DA76BC598BCC}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Immense.RemoteControl.Desktop.UI", "submodules\Immense.RemoteControl\Immense.RemoteControl.Desktop.UI\Immense.RemoteControl.Desktop.UI.csproj", "{3095BA44-D5E0-42B4-9161-7F7AB8E68A10}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -221,18 +219,6 @@ Global {3EB48B01-A672-4658-868B-8CA21FF73929}.Release|x64.Build.0 = Release|Any CPU {3EB48B01-A672-4658-868B-8CA21FF73929}.Release|x86.ActiveCfg = Release|Any CPU {3EB48B01-A672-4658-868B-8CA21FF73929}.Release|x86.Build.0 = Release|Any CPU - {A6C36B1F-A5EA-4C9C-88E2-FAA05CE89D78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A6C36B1F-A5EA-4C9C-88E2-FAA05CE89D78}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A6C36B1F-A5EA-4C9C-88E2-FAA05CE89D78}.Debug|x64.ActiveCfg = Debug|Any CPU - {A6C36B1F-A5EA-4C9C-88E2-FAA05CE89D78}.Debug|x64.Build.0 = Debug|Any CPU - {A6C36B1F-A5EA-4C9C-88E2-FAA05CE89D78}.Debug|x86.ActiveCfg = Debug|Any CPU - {A6C36B1F-A5EA-4C9C-88E2-FAA05CE89D78}.Debug|x86.Build.0 = Debug|Any CPU - {A6C36B1F-A5EA-4C9C-88E2-FAA05CE89D78}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A6C36B1F-A5EA-4C9C-88E2-FAA05CE89D78}.Release|Any CPU.Build.0 = Release|Any CPU - {A6C36B1F-A5EA-4C9C-88E2-FAA05CE89D78}.Release|x64.ActiveCfg = Release|Any CPU - {A6C36B1F-A5EA-4C9C-88E2-FAA05CE89D78}.Release|x64.Build.0 = Release|Any CPU - {A6C36B1F-A5EA-4C9C-88E2-FAA05CE89D78}.Release|x86.ActiveCfg = Release|Any CPU - {A6C36B1F-A5EA-4C9C-88E2-FAA05CE89D78}.Release|x86.Build.0 = Release|Any CPU {7FA4456D-8695-4990-B20A-B897CF9DF0EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7FA4456D-8695-4990-B20A-B897CF9DF0EF}.Debug|Any CPU.Build.0 = Debug|Any CPU {7FA4456D-8695-4990-B20A-B897CF9DF0EF}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -269,30 +255,30 @@ Global {FEF0D431-EB2F-4C08-A125-8DF59AFDA525}.Release|x64.Build.0 = Release|Any CPU {FEF0D431-EB2F-4C08-A125-8DF59AFDA525}.Release|x86.ActiveCfg = Release|Any CPU {FEF0D431-EB2F-4C08-A125-8DF59AFDA525}.Release|x86.Build.0 = Release|Any CPU - {034984DC-4B47-42E9-8648-F258C40C7926}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {034984DC-4B47-42E9-8648-F258C40C7926}.Debug|Any CPU.Build.0 = Debug|Any CPU - {034984DC-4B47-42E9-8648-F258C40C7926}.Debug|x64.ActiveCfg = Debug|Any CPU - {034984DC-4B47-42E9-8648-F258C40C7926}.Debug|x64.Build.0 = Debug|Any CPU - {034984DC-4B47-42E9-8648-F258C40C7926}.Debug|x86.ActiveCfg = Debug|Any CPU - {034984DC-4B47-42E9-8648-F258C40C7926}.Debug|x86.Build.0 = Debug|Any CPU - {034984DC-4B47-42E9-8648-F258C40C7926}.Release|Any CPU.ActiveCfg = Release|Any CPU - {034984DC-4B47-42E9-8648-F258C40C7926}.Release|Any CPU.Build.0 = Release|Any CPU - {034984DC-4B47-42E9-8648-F258C40C7926}.Release|x64.ActiveCfg = Release|Any CPU - {034984DC-4B47-42E9-8648-F258C40C7926}.Release|x64.Build.0 = Release|Any CPU - {034984DC-4B47-42E9-8648-F258C40C7926}.Release|x86.ActiveCfg = Release|Any CPU - {034984DC-4B47-42E9-8648-F258C40C7926}.Release|x86.Build.0 = Release|Any CPU - {7A8378BC-8169-4A33-93C6-47C699C5E74D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7A8378BC-8169-4A33-93C6-47C699C5E74D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7A8378BC-8169-4A33-93C6-47C699C5E74D}.Debug|x64.ActiveCfg = Debug|Any CPU - {7A8378BC-8169-4A33-93C6-47C699C5E74D}.Debug|x64.Build.0 = Debug|Any CPU - {7A8378BC-8169-4A33-93C6-47C699C5E74D}.Debug|x86.ActiveCfg = Debug|Any CPU - {7A8378BC-8169-4A33-93C6-47C699C5E74D}.Debug|x86.Build.0 = Debug|Any CPU - {7A8378BC-8169-4A33-93C6-47C699C5E74D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7A8378BC-8169-4A33-93C6-47C699C5E74D}.Release|Any CPU.Build.0 = Release|Any CPU - {7A8378BC-8169-4A33-93C6-47C699C5E74D}.Release|x64.ActiveCfg = Release|Any CPU - {7A8378BC-8169-4A33-93C6-47C699C5E74D}.Release|x64.Build.0 = Release|Any CPU - {7A8378BC-8169-4A33-93C6-47C699C5E74D}.Release|x86.ActiveCfg = Release|Any CPU - {7A8378BC-8169-4A33-93C6-47C699C5E74D}.Release|x86.Build.0 = Release|Any CPU + {2FF27827-1F43-474E-A0E3-DA76BC598BCC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2FF27827-1F43-474E-A0E3-DA76BC598BCC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2FF27827-1F43-474E-A0E3-DA76BC598BCC}.Debug|x64.ActiveCfg = Debug|Any CPU + {2FF27827-1F43-474E-A0E3-DA76BC598BCC}.Debug|x64.Build.0 = Debug|Any CPU + {2FF27827-1F43-474E-A0E3-DA76BC598BCC}.Debug|x86.ActiveCfg = Debug|Any CPU + {2FF27827-1F43-474E-A0E3-DA76BC598BCC}.Debug|x86.Build.0 = Debug|Any CPU + {2FF27827-1F43-474E-A0E3-DA76BC598BCC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2FF27827-1F43-474E-A0E3-DA76BC598BCC}.Release|Any CPU.Build.0 = Release|Any CPU + {2FF27827-1F43-474E-A0E3-DA76BC598BCC}.Release|x64.ActiveCfg = Release|Any CPU + {2FF27827-1F43-474E-A0E3-DA76BC598BCC}.Release|x64.Build.0 = Release|Any CPU + {2FF27827-1F43-474E-A0E3-DA76BC598BCC}.Release|x86.ActiveCfg = Release|Any CPU + {2FF27827-1F43-474E-A0E3-DA76BC598BCC}.Release|x86.Build.0 = Release|Any CPU + {3095BA44-D5E0-42B4-9161-7F7AB8E68A10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3095BA44-D5E0-42B4-9161-7F7AB8E68A10}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3095BA44-D5E0-42B4-9161-7F7AB8E68A10}.Debug|x64.ActiveCfg = Debug|Any CPU + {3095BA44-D5E0-42B4-9161-7F7AB8E68A10}.Debug|x64.Build.0 = Debug|Any CPU + {3095BA44-D5E0-42B4-9161-7F7AB8E68A10}.Debug|x86.ActiveCfg = Debug|Any CPU + {3095BA44-D5E0-42B4-9161-7F7AB8E68A10}.Debug|x86.Build.0 = Debug|Any CPU + {3095BA44-D5E0-42B4-9161-7F7AB8E68A10}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3095BA44-D5E0-42B4-9161-7F7AB8E68A10}.Release|Any CPU.Build.0 = Release|Any CPU + {3095BA44-D5E0-42B4-9161-7F7AB8E68A10}.Release|x64.ActiveCfg = Release|Any CPU + {3095BA44-D5E0-42B4-9161-7F7AB8E68A10}.Release|x64.Build.0 = Release|Any CPU + {3095BA44-D5E0-42B4-9161-7F7AB8E68A10}.Release|x86.ActiveCfg = Release|Any CPU + {3095BA44-D5E0-42B4-9161-7F7AB8E68A10}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -303,13 +289,12 @@ Global {B6C1030D-1F74-4143-BB70-FC79C0274653} = {0754E195-7080-4AAC-B5A3-A9923B1283CE} {963B5555-30AE-428E-9686-59C4B6FEC052} = {2176596E-12DA-4766-96E1-4D23EA7DBEC8} {3EB48B01-A672-4658-868B-8CA21FF73929} = {48C738FB-359E-43DB-B338-FD7CB1CCF6A8} - {A6C36B1F-A5EA-4C9C-88E2-FAA05CE89D78} = {48C738FB-359E-43DB-B338-FD7CB1CCF6A8} {7FA4456D-8695-4990-B20A-B897CF9DF0EF} = {48C738FB-359E-43DB-B338-FD7CB1CCF6A8} {8CBED18D-64A8-44C0-8433-EE14E93B472A} = {48C738FB-359E-43DB-B338-FD7CB1CCF6A8} {FEF0D431-EB2F-4C08-A125-8DF59AFDA525} = {48C738FB-359E-43DB-B338-FD7CB1CCF6A8} - {034984DC-4B47-42E9-8648-F258C40C7926} = {48C738FB-359E-43DB-B338-FD7CB1CCF6A8} - {7A8378BC-8169-4A33-93C6-47C699C5E74D} = {48C738FB-359E-43DB-B338-FD7CB1CCF6A8} {E4D83C37-8B98-44FB-898B-9AA1BB223C66} = {48C738FB-359E-43DB-B338-FD7CB1CCF6A8} + {2FF27827-1F43-474E-A0E3-DA76BC598BCC} = {48C738FB-359E-43DB-B338-FD7CB1CCF6A8} + {3095BA44-D5E0-42B4-9161-7F7AB8E68A10} = {48C738FB-359E-43DB-B338-FD7CB1CCF6A8} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {EAE10B28-119B-437C-9E68-06F0EE3F968A} diff --git a/Server/API/OrganizationManagementController.cs b/Server/API/OrganizationManagementController.cs index be275cfe..bc3eff0d 100644 --- a/Server/API/OrganizationManagementController.cs +++ b/Server/API/OrganizationManagementController.cs @@ -1,19 +1,13 @@ -using Immense.RemoteControl.Desktop.Native.Windows; -using Immense.RemoteControl.Shared; -using Immense.RemoteControl.Shared.Extensions; -using MailKit; +using Immense.RemoteControl.Shared.Extensions; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.WebUtilities; -using Microsoft.Build.Framework; using Microsoft.Extensions.Logging; -using Org.BouncyCastle.Crypto.Agreement; using Remotely.Server.Auth; using Remotely.Server.Extensions; using Remotely.Server.Services; using Remotely.Shared.Entities; using Remotely.Shared.ViewModels; -using System; using System.Text; using System.Text.Encodings.Web; using System.Threading.Tasks; diff --git a/Server/Server.csproj b/Server/Server.csproj index fe8b43c6..4662072b 100644 --- a/Server/Server.csproj +++ b/Server/Server.csproj @@ -18,20 +18,20 @@ - - - - - - - + + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/Shared/Shared.csproj b/Shared/Shared.csproj index b64fd111..46b73e28 100644 --- a/Shared/Shared.csproj +++ b/Shared/Shared.csproj @@ -10,7 +10,7 @@ - + diff --git a/Tests/LoadTester/LoadTester.csproj b/Tests/LoadTester/LoadTester.csproj index 06ce147a..bc75761e 100644 --- a/Tests/LoadTester/LoadTester.csproj +++ b/Tests/LoadTester/LoadTester.csproj @@ -8,6 +8,7 @@ + diff --git a/Tests/Server.Tests/Server.Tests.csproj b/Tests/Server.Tests/Server.Tests.csproj index 98d009e7..751e78b2 100644 --- a/Tests/Server.Tests/Server.Tests.csproj +++ b/Tests/Server.Tests/Server.Tests.csproj @@ -13,9 +13,9 @@ - - - + + + diff --git a/Tests/Shared.Tests/Shared.Tests.csproj b/Tests/Shared.Tests/Shared.Tests.csproj index 1bb09131..1fc69e5d 100644 --- a/Tests/Shared.Tests/Shared.Tests.csproj +++ b/Tests/Shared.Tests/Shared.Tests.csproj @@ -13,7 +13,7 @@ - + diff --git a/submodules/Immense.RemoteControl b/submodules/Immense.RemoteControl index 9abf3d89..b0a5b24b 160000 --- a/submodules/Immense.RemoteControl +++ b/submodules/Immense.RemoteControl @@ -1 +1 @@ -Subproject commit 9abf3d89436f17938f5d5029bf0016a050c4a4fe +Subproject commit b0a5b24b2b812c5535c25501c6101051a9b0faa3 From 2cb819617ea88646301b5177734c4422b24c07c7 Mon Sep 17 00:00:00 2001 From: Jared Goodwin Date: Wed, 16 Aug 2023 15:57:53 -0700 Subject: [PATCH 03/15] Update Immense.RemoteControl --- submodules/Immense.RemoteControl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/Immense.RemoteControl b/submodules/Immense.RemoteControl index b0a5b24b..208254be 160000 --- a/submodules/Immense.RemoteControl +++ b/submodules/Immense.RemoteControl @@ -1 +1 @@ -Subproject commit b0a5b24b2b812c5535c25501c6101051a9b0faa3 +Subproject commit 208254be7864b8b4e35bf4793bbbde9e83246952 From 1628af62f813a86ddf96b5c987951e77d43f17e9 Mon Sep 17 00:00:00 2001 From: Jared Goodwin Date: Thu, 17 Aug 2023 06:48:58 -0700 Subject: [PATCH 04/15] Fix namespace-folder match. --- Agent/Services/AgentHubConnection.cs | 1 - Agent/Services/FileLogsManager.cs | 3 ++- Desktop.Linux/Program.cs | 2 +- Desktop.Shared/Services/BrandingProvider.cs | 6 +++--- Desktop.Shared/Services/OrganizationIdProvider.cs | 3 +-- Desktop.Win/Program.cs | 2 +- Tests/Server.Tests/AgentHubTests.cs | 1 - Tests/Server.Tests/CircuitConnectionTests.cs | 1 - Tests/Server.Tests/DataServiceTests.cs | 11 ++++++----- Tests/Server.Tests/IoCActivator.cs | 2 +- Tests/Server.Tests/ScriptScheduleDispatcherTests.cs | 8 ++++---- Tests/Server.Tests/TestData.cs | 2 +- 12 files changed, 20 insertions(+), 22 deletions(-) diff --git a/Agent/Services/AgentHubConnection.cs b/Agent/Services/AgentHubConnection.cs index 3aec5884..1dba8f54 100644 --- a/Agent/Services/AgentHubConnection.cs +++ b/Agent/Services/AgentHubConnection.cs @@ -9,7 +9,6 @@ using Remotely.Shared; using Remotely.Shared.Enums; using Remotely.Shared.Interfaces; using Remotely.Shared.Models; -using Remotely.Shared.Services; using System; using System.Diagnostics.CodeAnalysis; using System.IO; diff --git a/Agent/Services/FileLogsManager.cs b/Agent/Services/FileLogsManager.cs index 665ad7d8..a545166e 100644 --- a/Agent/Services/FileLogsManager.cs +++ b/Agent/Services/FileLogsManager.cs @@ -1,4 +1,5 @@ using Microsoft.Extensions.Logging; +using Remotely.Shared.Services; using System; using System.Collections.Generic; using System.IO; @@ -9,7 +10,7 @@ using System.Text; using System.Threading; using System.Threading.Tasks; -namespace Remotely.Shared.Services; +namespace Remotely.Agent.Services; public interface IFileLogsManager { diff --git a/Desktop.Linux/Program.cs b/Desktop.Linux/Program.cs index b3c15d2c..76b4e1d0 100644 --- a/Desktop.Linux/Program.cs +++ b/Desktop.Linux/Program.cs @@ -2,7 +2,6 @@ using System.Threading.Tasks; using System.Threading; using System; -using Remotely.Desktop.Shared.Services; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Remotely.Shared.Services; @@ -15,6 +14,7 @@ using Immense.RemoteControl.Desktop.Linux.Startup; using Immense.RemoteControl.Desktop.UI.Services; using Avalonia; using Immense.RemoteControl.Desktop.UI; +using Desktop.Shared.Services; public class Program { diff --git a/Desktop.Shared/Services/BrandingProvider.cs b/Desktop.Shared/Services/BrandingProvider.cs index 48586940..7aed7b42 100644 --- a/Desktop.Shared/Services/BrandingProvider.cs +++ b/Desktop.Shared/Services/BrandingProvider.cs @@ -18,7 +18,7 @@ using System.Net.Http.Json; using System.Text; using System.Threading.Tasks; -namespace Remotely.Desktop.Shared.Services; +namespace Desktop.Shared.Services; public class BrandingProvider : IBrandingProvider { @@ -32,8 +32,8 @@ public class BrandingProvider : IBrandingProvider }; public BrandingProvider( - IAppState appState, - IOrganizationIdProvider orgIdProvider, + IAppState appState, + IOrganizationIdProvider orgIdProvider, IEmbeddedServerDataSearcher embeddedServerDataSearcher, ILogger logger) { diff --git a/Desktop.Shared/Services/OrganizationIdProvider.cs b/Desktop.Shared/Services/OrganizationIdProvider.cs index bd7fc5fe..408824a1 100644 --- a/Desktop.Shared/Services/OrganizationIdProvider.cs +++ b/Desktop.Shared/Services/OrganizationIdProvider.cs @@ -1,5 +1,4 @@ - -namespace Remotely.Desktop.Shared.Services; +namespace Desktop.Shared.Services; public interface IOrganizationIdProvider { diff --git a/Desktop.Win/Program.cs b/Desktop.Win/Program.cs index 33e828da..ea8d1bd5 100644 --- a/Desktop.Win/Program.cs +++ b/Desktop.Win/Program.cs @@ -1,7 +1,6 @@ using System.Threading.Tasks; using System.Threading; using System; -using Remotely.Desktop.Shared.Services; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Remotely.Shared.Services; @@ -14,6 +13,7 @@ using Immense.RemoteControl.Immense.RemoteControl.Desktop.Windows.Startup; using Immense.RemoteControl.Desktop.UI.Services; using Avalonia; using Immense.RemoteControl.Desktop.UI; +using Desktop.Shared.Services; public class Program { diff --git a/Tests/Server.Tests/AgentHubTests.cs b/Tests/Server.Tests/AgentHubTests.cs index 9b59783c..3f8da9ca 100644 --- a/Tests/Server.Tests/AgentHubTests.cs +++ b/Tests/Server.Tests/AgentHubTests.cs @@ -14,7 +14,6 @@ using System.Threading; using System.Threading.Tasks; using Remotely.Shared.Interfaces; using Immense.SimpleMessenger; -using Remotely.Tests; namespace Remotely.Server.Tests; diff --git a/Tests/Server.Tests/CircuitConnectionTests.cs b/Tests/Server.Tests/CircuitConnectionTests.cs index ed0ec588..a462a3a1 100644 --- a/Tests/Server.Tests/CircuitConnectionTests.cs +++ b/Tests/Server.Tests/CircuitConnectionTests.cs @@ -11,7 +11,6 @@ using Remotely.Server.Services.Stores; using Remotely.Server.Tests.Mocks; using Remotely.Shared.Extensions; using Remotely.Shared.Interfaces; -using Remotely.Tests; using System.Threading.Tasks; namespace Remotely.Server.Tests; diff --git a/Tests/Server.Tests/DataServiceTests.cs b/Tests/Server.Tests/DataServiceTests.cs index 724b8fcc..72697b21 100644 --- a/Tests/Server.Tests/DataServiceTests.cs +++ b/Tests/Server.Tests/DataServiceTests.cs @@ -4,6 +4,7 @@ using Moq; using Remotely.Server.Services; using Remotely.Shared.Dtos; using Remotely.Shared.Entities; +using Remotely.Shared.Enums; using Remotely.Shared.Models; using Remotely.Shared.Utilities; using System; @@ -11,7 +12,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -namespace Remotely.Tests; +namespace Remotely.Server.Tests; [TestClass] public class DataServiceTests @@ -132,7 +133,7 @@ public class DataServiceTests Name = "GCI", Organization = _testData.Org1Admin1.Organization, OrganizationID = _testData.Org1Id, - Shell = Shared.Enums.ScriptingShell.PSCore + Shell = ScriptingShell.PSCore }; await _dataService.AddOrUpdateSavedScript(savedScript, _testData.Org1Admin1.Id); @@ -140,7 +141,7 @@ public class DataServiceTests var scriptRun = new ScriptRun() { Devices = new() { _testData.Org1Device1 }, - InputType = Shared.Enums.ScriptInputType.ScheduledScript, + InputType = ScriptInputType.ScheduledScript, SavedScriptId = savedScript.Id, Initiator = _testData.Org1Admin1.UserName, RunAt = now, @@ -166,10 +167,10 @@ public class DataServiceTests var dto = new ScriptResultDto() { DeviceID = _testData.Org1Device1.ID, - InputType = Shared.Enums.ScriptInputType.ScheduledScript, + InputType = ScriptInputType.ScheduledScript, SavedScriptId = savedScript.Id, ScriptRunId = scriptRun.Id, - Shell = Shared.Enums.ScriptingShell.PSCore, + Shell = ScriptingShell.PSCore, ScriptInput = "echo test" }; diff --git a/Tests/Server.Tests/IoCActivator.cs b/Tests/Server.Tests/IoCActivator.cs index 41c67c6f..864a6c05 100644 --- a/Tests/Server.Tests/IoCActivator.cs +++ b/Tests/Server.Tests/IoCActivator.cs @@ -16,7 +16,7 @@ using System; using System.Collections.Generic; using System.Configuration; -namespace Remotely.Tests; +namespace Remotely.Server.Tests; [TestClass] public class IoCActivator diff --git a/Tests/Server.Tests/ScriptScheduleDispatcherTests.cs b/Tests/Server.Tests/ScriptScheduleDispatcherTests.cs index 227cb027..237f4d33 100644 --- a/Tests/Server.Tests/ScriptScheduleDispatcherTests.cs +++ b/Tests/Server.Tests/ScriptScheduleDispatcherTests.cs @@ -14,7 +14,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Remotely.Tests; +namespace Remotely.Server.Tests; [TestClass] public class ScriptScheduleDispatcherTests @@ -68,7 +68,7 @@ public class ScriptScheduleDispatcherTests }; var scriptSchedules = new List() - { + { _schedule1 }; @@ -108,9 +108,9 @@ public class ScriptScheduleDispatcherTests _dataService.Verify(x => x.GetScriptSchedulesDue(), Times.Once); _dataService.Verify(x => x.AddOrUpdateScriptSchedule(_schedule1), Times.Once); - _dataService.Verify(x => x.GetDevices(It.Is>(x => + _dataService.Verify(x => x.GetDevices(It.Is>(x => x.Contains(_schedule1.Devices.First().ID)))); - _dataService.Verify(x => x.AddScriptRun(It.Is(x => + _dataService.Verify(x => x.AddScriptRun(It.Is(x => x.ScheduleId == _schedule1.Id && x.Devices!.Exists(d => d.ID == _testData.Org1Device1.ID) && x.Devices!.Exists(d => d.ID == _testData.Org1Device2.ID)))); diff --git a/Tests/Server.Tests/TestData.cs b/Tests/Server.Tests/TestData.cs index 32014e74..77697f80 100644 --- a/Tests/Server.Tests/TestData.cs +++ b/Tests/Server.Tests/TestData.cs @@ -13,7 +13,7 @@ using System.Linq; using System.Net.Http; using System.Threading.Tasks; -namespace Remotely.Tests; +namespace Remotely.Server.Tests; public class TestData { From aba4a3a5505677a354ecb10e83eebf20f2c33bff Mon Sep 17 00:00:00 2001 From: Jared Goodwin Date: Thu, 17 Aug 2023 07:05:30 -0700 Subject: [PATCH 05/15] Allow BrandingProvider to private cache branding info. --- Desktop.Shared/Services/BrandingProvider.cs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/Desktop.Shared/Services/BrandingProvider.cs b/Desktop.Shared/Services/BrandingProvider.cs index 7aed7b42..83232572 100644 --- a/Desktop.Shared/Services/BrandingProvider.cs +++ b/Desktop.Shared/Services/BrandingProvider.cs @@ -23,13 +23,11 @@ namespace Desktop.Shared.Services; public class BrandingProvider : IBrandingProvider { private readonly IAppState _appState; - private readonly IOrganizationIdProvider _orgIdProvider; private readonly IEmbeddedServerDataSearcher _embeddedDataSearcher; private readonly ILogger _logger; - private BrandingInfoBase _brandingInfo = new() - { - Product = "Remote Control" - }; + private readonly IOrganizationIdProvider _orgIdProvider; + private BrandingInfoBase? _brandingInfo; + public BrandingProvider( IAppState appState, @@ -45,6 +43,11 @@ public class BrandingProvider : IBrandingProvider public async Task GetBrandingInfo() { + if (_brandingInfo is not null) + { + return _brandingInfo; + } + var result = await TryGetBrandingInfo(); if (result.IsSuccess) @@ -54,9 +57,13 @@ public class BrandingProvider : IBrandingProvider else { _logger.LogWarning(result.Exception, "Failed to extract embedded service data."); + _brandingInfo = new() + { + Product = "Remote Control" + }; } - if (!_brandingInfo.Icon.Any()) + if (_brandingInfo.Icon?.Any() != true) { using var mrs = typeof(BrandingProvider).Assembly.GetManifestResourceStream("Desktop.Shared.Assets.Remotely_Icon.png"); using var ms = new MemoryStream(); From a41ac65e9ee8192b6104c59b363c7d3ec2e9debf Mon Sep 17 00:00:00 2001 From: Jared Goodwin Date: Thu, 17 Aug 2023 11:11:09 -0700 Subject: [PATCH 06/15] Fix TargetFramework. --- .../Properties/PublishProfiles/desktop-linux-x64.pubxml | 2 +- .../Properties/PublishProfiles/packaged-linux-x64.pubxml | 2 +- Desktop.Win/Desktop.Win.csproj | 1 - Desktop.Win/Properties/PublishProfiles/desktop-win-x64.pubxml | 2 +- Desktop.Win/Properties/PublishProfiles/desktop-win-x86.pubxml | 2 +- Desktop.Win/Properties/PublishProfiles/install-folder.pubxml | 2 +- .../Properties/PublishProfiles/packaged-win-x64-debug.pubxml | 2 +- Desktop.Win/Properties/PublishProfiles/packaged-win-x64.pubxml | 2 +- Desktop.Win/Properties/PublishProfiles/packaged-win-x86.pubxml | 2 +- Desktop.Win/Properties/PublishProfiles/wrapper-x64.pubxml | 2 +- Desktop.Win/Properties/PublishProfiles/wrapper-x86.pubxml | 2 +- 11 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Desktop.Linux/Properties/PublishProfiles/desktop-linux-x64.pubxml b/Desktop.Linux/Properties/PublishProfiles/desktop-linux-x64.pubxml index 16aadded..ff0079b2 100644 --- a/Desktop.Linux/Properties/PublishProfiles/desktop-linux-x64.pubxml +++ b/Desktop.Linux/Properties/PublishProfiles/desktop-linux-x64.pubxml @@ -7,7 +7,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. FileSystem Release x64 - .net7.0 + net7.0 ..\Server\wwwroot\Content\Linux-x64\ linux-x64 true diff --git a/Desktop.Linux/Properties/PublishProfiles/packaged-linux-x64.pubxml b/Desktop.Linux/Properties/PublishProfiles/packaged-linux-x64.pubxml index 6e103b52..19c75459 100644 --- a/Desktop.Linux/Properties/PublishProfiles/packaged-linux-x64.pubxml +++ b/Desktop.Linux/Properties/PublishProfiles/packaged-linux-x64.pubxml @@ -7,7 +7,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. FileSystem Release x64 - .net7.0 + net7.0 ..\Agent\bin\Release\net7.0\linux-x64\publish\Desktop linux-x64 true diff --git a/Desktop.Win/Desktop.Win.csproj b/Desktop.Win/Desktop.Win.csproj index d34e6317..c8877b1a 100644 --- a/Desktop.Win/Desktop.Win.csproj +++ b/Desktop.Win/Desktop.Win.csproj @@ -3,7 +3,6 @@ WinExe net7.0-windows - true true Remotely_Desktop Remotely.Desktop.Win diff --git a/Desktop.Win/Properties/PublishProfiles/desktop-win-x64.pubxml b/Desktop.Win/Properties/PublishProfiles/desktop-win-x64.pubxml index e3b9d3e3..db620aa6 100644 --- a/Desktop.Win/Properties/PublishProfiles/desktop-win-x64.pubxml +++ b/Desktop.Win/Properties/PublishProfiles/desktop-win-x64.pubxml @@ -7,7 +7,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. FileSystem Release x64 - .net7.0-windows + net7.0-windows ..\Server\wwwroot\Content\Win-x64\ win10-x64 true diff --git a/Desktop.Win/Properties/PublishProfiles/desktop-win-x86.pubxml b/Desktop.Win/Properties/PublishProfiles/desktop-win-x86.pubxml index 84a4bd17..87287c48 100644 --- a/Desktop.Win/Properties/PublishProfiles/desktop-win-x86.pubxml +++ b/Desktop.Win/Properties/PublishProfiles/desktop-win-x86.pubxml @@ -7,7 +7,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. FileSystem Release x86 - .net7.0-windows + net7.0-windows ..\Server\wwwroot\Content\Win-x86\ win10-x86 true diff --git a/Desktop.Win/Properties/PublishProfiles/install-folder.pubxml b/Desktop.Win/Properties/PublishProfiles/install-folder.pubxml index 9b50279e..727b1e19 100644 --- a/Desktop.Win/Properties/PublishProfiles/install-folder.pubxml +++ b/Desktop.Win/Properties/PublishProfiles/install-folder.pubxml @@ -8,7 +8,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. x64 C:\Program Files\Remotely\Desktop FileSystem - .net7.0-windows + net7.0-windows win-x64 true False diff --git a/Desktop.Win/Properties/PublishProfiles/packaged-win-x64-debug.pubxml b/Desktop.Win/Properties/PublishProfiles/packaged-win-x64-debug.pubxml index d91a042e..87065d15 100644 --- a/Desktop.Win/Properties/PublishProfiles/packaged-win-x64-debug.pubxml +++ b/Desktop.Win/Properties/PublishProfiles/packaged-win-x64-debug.pubxml @@ -7,7 +7,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. FileSystem Debug x64 - .net7.0-windows + net7.0-windows ..\Agent\bin\Release\net7.0\win10-x64\publish\Desktop true win10-x64 diff --git a/Desktop.Win/Properties/PublishProfiles/packaged-win-x64.pubxml b/Desktop.Win/Properties/PublishProfiles/packaged-win-x64.pubxml index afec5a03..ffbad961 100644 --- a/Desktop.Win/Properties/PublishProfiles/packaged-win-x64.pubxml +++ b/Desktop.Win/Properties/PublishProfiles/packaged-win-x64.pubxml @@ -7,7 +7,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. FileSystem Release x64 - .net7.0-windows + net7.0-windows ..\Agent\bin\Release\net7.0\win10-x64\publish\Desktop true win10-x64 diff --git a/Desktop.Win/Properties/PublishProfiles/packaged-win-x86.pubxml b/Desktop.Win/Properties/PublishProfiles/packaged-win-x86.pubxml index b0c4447f..0a32039b 100644 --- a/Desktop.Win/Properties/PublishProfiles/packaged-win-x86.pubxml +++ b/Desktop.Win/Properties/PublishProfiles/packaged-win-x86.pubxml @@ -7,7 +7,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. FileSystem Release x86 - .net7.0-windows + net7.0-windows ..\Agent\bin\Release\net7.0\win10-x86\publish\Desktop win10-x86 true diff --git a/Desktop.Win/Properties/PublishProfiles/wrapper-x64.pubxml b/Desktop.Win/Properties/PublishProfiles/wrapper-x64.pubxml index f810efbb..6cf8c3cc 100644 --- a/Desktop.Win/Properties/PublishProfiles/wrapper-x64.pubxml +++ b/Desktop.Win/Properties/PublishProfiles/wrapper-x64.pubxml @@ -7,7 +7,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. FileSystem Release x64 - .net7.0-windows + net7.0-windows bin\Release\win-x64\publish\ true win10-x64 diff --git a/Desktop.Win/Properties/PublishProfiles/wrapper-x86.pubxml b/Desktop.Win/Properties/PublishProfiles/wrapper-x86.pubxml index 351581e2..6f080112 100644 --- a/Desktop.Win/Properties/PublishProfiles/wrapper-x86.pubxml +++ b/Desktop.Win/Properties/PublishProfiles/wrapper-x86.pubxml @@ -7,7 +7,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. FileSystem Release x86 - .net7.0-windows + net7.0-windows bin\Release\win-x86\publish\ true win10-x86 From dff5830d0c50b6e7ee67e9854e0a795f83349c3f Mon Sep 17 00:00:00 2001 From: Jared Goodwin Date: Thu, 17 Aug 2023 12:47:37 -0700 Subject: [PATCH 07/15] Implement BrandingProvider changes. --- Desktop.Shared/Services/BrandingProvider.cs | 18 +++++------------- Desktop.Win/Desktop.Win.csproj | 1 - submodules/Immense.RemoteControl | 2 +- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/Desktop.Shared/Services/BrandingProvider.cs b/Desktop.Shared/Services/BrandingProvider.cs index 83232572..1e128a96 100644 --- a/Desktop.Shared/Services/BrandingProvider.cs +++ b/Desktop.Shared/Services/BrandingProvider.cs @@ -3,20 +3,10 @@ using Immense.RemoteControl.Desktop.Shared.Services; using Immense.RemoteControl.Shared; using Immense.RemoteControl.Shared.Models; using Microsoft.Extensions.Logging; -using Remotely.Shared; using Remotely.Shared.Entities; -using Remotely.Shared.Enums; using Remotely.Shared.Services; -using Remotely.Shared.Utilities; -using System; -using System.Collections.Generic; using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Net.Http; using System.Net.Http.Json; -using System.Text; -using System.Threading.Tasks; namespace Desktop.Shared.Services; @@ -41,11 +31,14 @@ public class BrandingProvider : IBrandingProvider _logger = logger; } - public async Task GetBrandingInfo() + public BrandingInfoBase CurrentBranding => _brandingInfo ?? + throw new InvalidOperationException("Branding info has not been set or initialized."); + + public async Task Initialize() { if (_brandingInfo is not null) { - return _brandingInfo; + return; } var result = await TryGetBrandingInfo(); @@ -71,7 +64,6 @@ public class BrandingProvider : IBrandingProvider _brandingInfo.Icon = ms.ToArray(); } - return _brandingInfo; } public void SetBrandingInfo(BrandingInfoBase brandingInfo) diff --git a/Desktop.Win/Desktop.Win.csproj b/Desktop.Win/Desktop.Win.csproj index c8877b1a..8cfb5259 100644 --- a/Desktop.Win/Desktop.Win.csproj +++ b/Desktop.Win/Desktop.Win.csproj @@ -3,7 +3,6 @@ WinExe net7.0-windows - true Remotely_Desktop Remotely.Desktop.Win Assets\favicon.ico diff --git a/submodules/Immense.RemoteControl b/submodules/Immense.RemoteControl index 208254be..709fbaf2 160000 --- a/submodules/Immense.RemoteControl +++ b/submodules/Immense.RemoteControl @@ -1 +1 @@ -Subproject commit 208254be7864b8b4e35bf4793bbbde9e83246952 +Subproject commit 709fbaf2e29e6066327696540bec08fac225ae89 From 6fc0d98dd049bc4065f2f66bfbca56d39f5065f3 Mon Sep 17 00:00:00 2001 From: Jared Goodwin Date: Fri, 18 Aug 2023 11:14:23 -0700 Subject: [PATCH 08/15] Update target frameworks. --- .../Services/InstallerService.cs | 4 +- Agent/Services/Windows/UpdaterWin.cs | 2 +- Desktop.Win/Desktop.Win.csproj | 2 +- .../PublishProfiles/desktop-win-x64.pubxml | 12 +++--- .../PublishProfiles/desktop-win-x86.pubxml | 4 +- .../PublishProfiles/install-folder.pubxml | 2 +- .../packaged-win-x64-debug.pubxml | 6 +-- .../PublishProfiles/packaged-win-x64.pubxml | 12 +++--- .../PublishProfiles/packaged-win-x86.pubxml | 6 +-- .../PublishProfiles/wrapper-x64.pubxml | 2 +- .../PublishProfiles/wrapper-x86.pubxml | 4 +- Server/API/AgentUpdateController.cs | 4 +- Server/Pages/Downloads.razor | 6 +-- .../{Install-Win10.ps1 => Install-Win.ps1} | 12 +++--- Utilities/Publish.ps1 | 42 +++++++++---------- submodules/Immense.RemoteControl | 2 +- 16 files changed, 61 insertions(+), 61 deletions(-) rename Server/wwwroot/Content/{Install-Win10.ps1 => Install-Win.ps1} (90%) diff --git a/Agent.Installer.Win/Services/InstallerService.cs b/Agent.Installer.Win/Services/InstallerService.cs index 3ac20966..356123d0 100644 --- a/Agent.Installer.Win/Services/InstallerService.cs +++ b/Agent.Installer.Win/Services/InstallerService.cs @@ -271,7 +271,7 @@ public class InstallerService ProgressValueChanged?.Invoke(this, args.ProgressPercentage); }; - await client.DownloadFileTaskAsync($"{serverUrl}/Content/Remotely-Win10-{_platform}.zip", targetFile); + await client.DownloadFileTaskAsync($"{serverUrl}/Content/Remotely-Win-{_platform}.zip", targetFile); } } @@ -290,7 +290,7 @@ public class InstallerService await Task.Delay(10); } - var wr = WebRequest.CreateHttp($"{serverUrl}/Content/Remotely-Win10-{_platform}.zip"); + var wr = WebRequest.CreateHttp($"{serverUrl}/Content/Remotely-Win-{_platform}.zip"); wr.Method = "Head"; using (var response = (HttpWebResponse)await wr.GetResponseAsync()) { diff --git a/Agent/Services/Windows/UpdaterWin.cs b/Agent/Services/Windows/UpdaterWin.cs index c6205a45..cef17151 100644 --- a/Agent/Services/Windows/UpdaterWin.cs +++ b/Agent/Services/Windows/UpdaterWin.cs @@ -74,7 +74,7 @@ public class UpdaterWin : IUpdater var serverUrl = _configService.GetConnectionInfo().Host; var platform = Environment.Is64BitOperatingSystem ? "x64" : "x86"; - var fileUrl = serverUrl + $"/Content/Remotely-Win10-{platform}.zip"; + var fileUrl = serverUrl + $"/Content/Remotely-Win-{platform}.zip"; using var httpClient = _httpClientFactory.CreateClient(); using var request = new HttpRequestMessage(HttpMethod.Head, fileUrl); diff --git a/Desktop.Win/Desktop.Win.csproj b/Desktop.Win/Desktop.Win.csproj index 8cfb5259..9f80b301 100644 --- a/Desktop.Win/Desktop.Win.csproj +++ b/Desktop.Win/Desktop.Win.csproj @@ -2,7 +2,7 @@ WinExe - net7.0-windows + net7.0 Remotely_Desktop Remotely.Desktop.Win Assets\favicon.ico diff --git a/Desktop.Win/Properties/PublishProfiles/desktop-win-x64.pubxml b/Desktop.Win/Properties/PublishProfiles/desktop-win-x64.pubxml index db620aa6..c6a148f0 100644 --- a/Desktop.Win/Properties/PublishProfiles/desktop-win-x64.pubxml +++ b/Desktop.Win/Properties/PublishProfiles/desktop-win-x64.pubxml @@ -7,14 +7,14 @@ https://go.microsoft.com/fwlink/?LinkID=208121. FileSystem Release x64 - net7.0-windows + net7.0 ..\Server\wwwroot\Content\Win-x64\ - win10-x64 + win-x64 true - True - False - False + true + false + false true - true + true \ No newline at end of file diff --git a/Desktop.Win/Properties/PublishProfiles/desktop-win-x86.pubxml b/Desktop.Win/Properties/PublishProfiles/desktop-win-x86.pubxml index 87287c48..09365bbc 100644 --- a/Desktop.Win/Properties/PublishProfiles/desktop-win-x86.pubxml +++ b/Desktop.Win/Properties/PublishProfiles/desktop-win-x86.pubxml @@ -7,9 +7,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121. FileSystem Release x86 - net7.0-windows + net7.0 ..\Server\wwwroot\Content\Win-x86\ - win10-x86 + win-x86 true True False diff --git a/Desktop.Win/Properties/PublishProfiles/install-folder.pubxml b/Desktop.Win/Properties/PublishProfiles/install-folder.pubxml index 727b1e19..04b388ca 100644 --- a/Desktop.Win/Properties/PublishProfiles/install-folder.pubxml +++ b/Desktop.Win/Properties/PublishProfiles/install-folder.pubxml @@ -8,7 +8,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. x64 C:\Program Files\Remotely\Desktop FileSystem - net7.0-windows + net7.0 win-x64 true False diff --git a/Desktop.Win/Properties/PublishProfiles/packaged-win-x64-debug.pubxml b/Desktop.Win/Properties/PublishProfiles/packaged-win-x64-debug.pubxml index 87065d15..846519dc 100644 --- a/Desktop.Win/Properties/PublishProfiles/packaged-win-x64-debug.pubxml +++ b/Desktop.Win/Properties/PublishProfiles/packaged-win-x64-debug.pubxml @@ -7,10 +7,10 @@ https://go.microsoft.com/fwlink/?LinkID=208121. FileSystem Debug x64 - net7.0-windows - ..\Agent\bin\Release\net7.0\win10-x64\publish\Desktop + net7.0 + ..\Agent\bin\Release\net7.0\win-x64\publish\Desktop true - win10-x64 + win-x64 True False False diff --git a/Desktop.Win/Properties/PublishProfiles/packaged-win-x64.pubxml b/Desktop.Win/Properties/PublishProfiles/packaged-win-x64.pubxml index ffbad961..525132a4 100644 --- a/Desktop.Win/Properties/PublishProfiles/packaged-win-x64.pubxml +++ b/Desktop.Win/Properties/PublishProfiles/packaged-win-x64.pubxml @@ -7,12 +7,12 @@ https://go.microsoft.com/fwlink/?LinkID=208121. FileSystem Release x64 - net7.0-windows - ..\Agent\bin\Release\net7.0\win10-x64\publish\Desktop + net7.0 + ..\Agent\bin\Release\net7.0\win-x64\publish\Desktop true - win10-x64 - False - False - False + win-x64 + false + false + false \ No newline at end of file diff --git a/Desktop.Win/Properties/PublishProfiles/packaged-win-x86.pubxml b/Desktop.Win/Properties/PublishProfiles/packaged-win-x86.pubxml index 0a32039b..0f1e16fe 100644 --- a/Desktop.Win/Properties/PublishProfiles/packaged-win-x86.pubxml +++ b/Desktop.Win/Properties/PublishProfiles/packaged-win-x86.pubxml @@ -7,9 +7,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121. FileSystem Release x86 - net7.0-windows - ..\Agent\bin\Release\net7.0\win10-x86\publish\Desktop - win10-x86 + net7.0 + ..\Agent\bin\Release\net7.0\win-x86\publish\Desktop + win-x86 true False False diff --git a/Desktop.Win/Properties/PublishProfiles/wrapper-x64.pubxml b/Desktop.Win/Properties/PublishProfiles/wrapper-x64.pubxml index 6cf8c3cc..56eb1c86 100644 --- a/Desktop.Win/Properties/PublishProfiles/wrapper-x64.pubxml +++ b/Desktop.Win/Properties/PublishProfiles/wrapper-x64.pubxml @@ -10,7 +10,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. net7.0-windows bin\Release\win-x64\publish\ true - win10-x64 + win-x64 False False True diff --git a/Desktop.Win/Properties/PublishProfiles/wrapper-x86.pubxml b/Desktop.Win/Properties/PublishProfiles/wrapper-x86.pubxml index 6f080112..2144ba58 100644 --- a/Desktop.Win/Properties/PublishProfiles/wrapper-x86.pubxml +++ b/Desktop.Win/Properties/PublishProfiles/wrapper-x86.pubxml @@ -7,10 +7,10 @@ https://go.microsoft.com/fwlink/?LinkID=208121. FileSystem Release x86 - net7.0-windows + net7.0 bin\Release\win-x86\publish\ true - win10-x86 + win-x86 False False True diff --git a/Server/API/AgentUpdateController.cs b/Server/API/AgentUpdateController.cs index ce47d82a..38c39355 100644 --- a/Server/API/AgentUpdateController.cs +++ b/Server/API/AgentUpdateController.cs @@ -56,10 +56,10 @@ public class AgentUpdateController : ControllerBase switch (platform.ToLower()) { case "win-x64": - filePath = Path.Combine(_hostEnv.WebRootPath, "Content", "Remotely-Win10-x64.zip"); + filePath = Path.Combine(_hostEnv.WebRootPath, "Content", "Remotely-Win-x64.zip"); break; case "win-x86": - filePath = Path.Combine(_hostEnv.WebRootPath, "Content", "Remotely-Win10-x86.zip"); + filePath = Path.Combine(_hostEnv.WebRootPath, "Content", "Remotely-Win-x86.zip"); break; case "linux": filePath = Path.Combine(_hostEnv.WebRootPath, "Content", "Remotely-Linux.zip"); diff --git a/Server/Pages/Downloads.razor b/Server/Pages/Downloads.razor index a48d3e12..de04c3ca 100644 --- a/Server/Pages/Downloads.razor +++ b/Server/Pages/Downloads.razor @@ -65,9 +65,9 @@

Windows Installer (x64/x86)
- Windows x64 Files Only + Windows x64 Files Only
- Windows x86 Files Only + Windows x86 Files Only

@@ -95,7 +95,7 @@ -quiet -organizationid "0b3d706b-9c5d-41e6-8ae9-5720d16324e6" -serverurl "https://remotely.mytechshop.com" - -path "[path]\Remotely-Win10-x64.zip" + -path "[path]\Remotely-Win-x64.zip"

diff --git a/Server/wwwroot/Content/Install-Win10.ps1 b/Server/wwwroot/Content/Install-Win.ps1 similarity index 90% rename from Server/wwwroot/Content/Install-Win10.ps1 rename to Server/wwwroot/Content/Install-Win.ps1 index 5c434b95..1011e055 100644 --- a/Server/wwwroot/Content/Install-Win10.ps1 +++ b/Server/wwwroot/Content/Install-Win.ps1 @@ -4,8 +4,8 @@ .DESCRIPTION Do not modify this script. It was generated specifically for your account. .EXAMPLE - powershell.exe -f Install-Win10.ps1 - powershell.exe -f Install-Win10.ps1 -DeviceAlias "My Super Computer" -DeviceGroup "My Stuff" + powershell.exe -f Install-Win.ps1 + powershell.exe -f Install-Win.ps1 -DeviceAlias "My Super Computer" -DeviceGroup "My Stuff" #> param ( @@ -102,17 +102,17 @@ function Install-Remotely { if ($Path) { Write-Log "Copying install files..." - Copy-Item -Path $Path -Destination "$env:TEMP\Remotely-Win10-$Platform.zip" + Copy-Item -Path $Path -Destination "$env:TEMP\Remotely-Win-$Platform.zip" } else { $ProgressPreference = 'SilentlyContinue' Write-Log "Downloading client..." - Invoke-WebRequest -Uri "$HostName/Content/Remotely-Win10-$Platform.zip" -OutFile "$env:TEMP\Remotely-Win10-$Platform.zip" + Invoke-WebRequest -Uri "$HostName/Content/Remotely-Win-$Platform.zip" -OutFile "$env:TEMP\Remotely-Win-$Platform.zip" $ProgressPreference = 'Continue' } - if (!(Test-Path -Path "$env:TEMP\Remotely-Win10-$Platform.zip")) { + if (!(Test-Path -Path "$env:TEMP\Remotely-Win-$Platform.zip")) { Write-Log "Client files failed to download." Do-Exit } @@ -120,7 +120,7 @@ function Install-Remotely { Stop-Remotely Get-ChildItem -Path "C:\Program Files\Remotely" | Where-Object {$_.Name -notlike "ConnectionInfo.json"} | Remove-Item -Recurse -Force - Expand-Archive -Path "$env:TEMP\Remotely-Win10-$Platform.zip" -DestinationPath "$InstallPath" -Force + Expand-Archive -Path "$env:TEMP\Remotely-Win-$Platform.zip" -DestinationPath "$InstallPath" -Force New-Item -ItemType File -Path "$InstallPath\ConnectionInfo.json" -Value (ConvertTo-Json -InputObject $ConnectionInfo) -Force diff --git a/Utilities/Publish.ps1 b/Utilities/Publish.ps1 index 6a96cbe3..ddb607fd 100644 --- a/Utilities/Publish.ps1 +++ b/Utilities/Publish.ps1 @@ -3,12 +3,12 @@ Publishes the Remotely clients. .DESCRIPTION Publishes the Remotely clients. - To deploy the server, supply the following arguments: -rid win10-x64 -outdir path\to\dir -hostname https://mysite.mydomain.com + To deploy the server, supply the following arguments: -rid win-x64 -outdir path\to\dir -hostname https://mysite.mydomain.com .COPYRIGHT Copyright 2023 Immense Networks. All rights reserved. .EXAMPLE Run it from the Utilities folder (located in the solution directory). - Or run "powershell -f Publish.ps1 -rid win10-x64 -outdir path\to\dir -hostname https://mysite.mydomain.com + Or run "powershell -f Publish.ps1 -rid win-x64 -outdir path\to\dir -hostname https://mysite.mydomain.com #> param ( @@ -92,11 +92,11 @@ if ([string]::IsNullOrWhiteSpace($MSBuildPath) -or !(Test-Path -Path $MSBuildPat # Clear publish folders. -if ((Test-Path -Path "$Root\Agent\bin\Release\net7.0\win10-x64\publish") -eq $true) { - Get-ChildItem -Path "$Root\Agent\bin\Release\net7.0\win10-x64\publish" | Remove-Item -Force -Recurse +if ((Test-Path -Path "$Root\Agent\bin\Release\net7.0\win-x64\publish") -eq $true) { + Get-ChildItem -Path "$Root\Agent\bin\Release\net7.0\win-x64\publish" | Remove-Item -Force -Recurse } -if ((Test-Path -Path "$Root\Agent\bin\Release\net7.0\win10-x86\publish" ) -eq $true) { - Get-ChildItem -Path "$Root\Agent\bin\Release\net7.0\win10-x86\publish" | Remove-Item -Force -Recurse +if ((Test-Path -Path "$Root\Agent\bin\Release\net7.0\win-x86\publish" ) -eq $true) { + Get-ChildItem -Path "$Root\Agent\bin\Release\net7.0\win-x86\publish" | Remove-Item -Force -Recurse } if ((Test-Path -Path "$Root\Agent\bin\Release\net7.0\linux-x64\publish") -eq $true) { Get-ChildItem -Path "$Root\Agent\bin\Release\net7.0\linux-x64\publish" | Remove-Item -Force -Recurse @@ -104,12 +104,12 @@ if ((Test-Path -Path "$Root\Agent\bin\Release\net7.0\linux-x64\publish") -eq $tr # Publish Core clients. -dotnet publish /p:Version=$CurrentVersion /p:FileVersion=$CurrentVersion --runtime win10-x64 --self-contained --configuration Release --output "$Root\Agent\bin\Release\net7.0\win10-x64\publish" "$Root\Agent" +dotnet publish /p:Version=$CurrentVersion /p:FileVersion=$CurrentVersion --runtime win-x64 --self-contained --configuration Release --output "$Root\Agent\bin\Release\net7.0\win-x64\publish" "$Root\Agent" dotnet publish /p:Version=$CurrentVersion /p:FileVersion=$CurrentVersion --runtime linux-x64 --self-contained --configuration Release --output "$Root\Agent\bin\Release\net7.0\linux-x64\publish" "$Root\Agent" -dotnet publish /p:Version=$CurrentVersion /p:FileVersion=$CurrentVersion --runtime win10-x86 --self-contained --configuration Release --output "$Root\Agent\bin\Release\net7.0\win10-x86\publish" "$Root\Agent" +dotnet publish /p:Version=$CurrentVersion /p:FileVersion=$CurrentVersion --runtime win-x86 --self-contained --configuration Release --output "$Root\Agent\bin\Release\net7.0\win-x86\publish" "$Root\Agent" -New-Item -Path "$Root\Agent\bin\Release\net7.0\win10-x64\publish\Desktop\" -ItemType Directory -Force -New-Item -Path "$Root\Agent\bin\Release\net7.0\win10-x86\publish\Desktop\" -ItemType Directory -Force +New-Item -Path "$Root\Agent\bin\Release\net7.0\win-x64\publish\Desktop\" -ItemType Directory -Force +New-Item -Path "$Root\Agent\bin\Release\net7.0\win-x86\publish\Desktop\" -ItemType Directory -Force New-Item -Path "$Root\Agent\bin\Release\net7.0\linux-x64\publish\Desktop\" -ItemType Directory -Force @@ -155,26 +155,26 @@ if ($SignAssemblies) { } # Compress Core clients. -$PublishDir = "$Root\Agent\bin\Release\net7.0\win10-x64\publish" -Compress-Archive -Path "$PublishDir\*" -DestinationPath "$PublishDir\Remotely-Win10-x64.zip" -Force -while ((Test-Path -Path "$PublishDir\Remotely-Win10-x64.zip") -eq $false){ - Write-Host "Waiting for archive to finish: $PublishDir\Remotely-Win10-x64.zip" +$PublishDir = "$Root\Agent\bin\Release\net7.0\win-x64\publish" +Compress-Archive -Path "$PublishDir\*" -DestinationPath "$PublishDir\Remotely-Win-x64.zip" -Force +while ((Test-Path -Path "$PublishDir\Remotely-Win-x64.zip") -eq $false){ + Write-Host "Waiting for archive to finish: $PublishDir\Remotely-Win-x64.zip" Start-Sleep -Seconds 3 } -Move-Item -Path "$PublishDir\Remotely-Win10-x64.zip" -Destination "$Root\Server\wwwroot\Content\Remotely-Win10-x64.zip" -Force +Move-Item -Path "$PublishDir\Remotely-Win-x64.zip" -Destination "$Root\Server\wwwroot\Content\Remotely-Win-x64.zip" -Force -$PublishDir = "$Root\Agent\bin\Release\net7.0\win10-x86\publish" -Compress-Archive -Path "$PublishDir\*" -DestinationPath "$PublishDir\Remotely-Win10-x86.zip" -Force -while ((Test-Path -Path "$PublishDir\Remotely-Win10-x86.zip") -eq $false){ - Write-Host "Waiting for archive to finish: $PublishDir\Remotely-Win10-x86.zip" +$PublishDir = "$Root\Agent\bin\Release\net7.0\win-x86\publish" +Compress-Archive -Path "$PublishDir\*" -DestinationPath "$PublishDir\Remotely-Win-x86.zip" -Force +while ((Test-Path -Path "$PublishDir\Remotely-Win-x86.zip") -eq $false){ + Write-Host "Waiting for archive to finish: $PublishDir\Remotely-Win-x86.zip" Start-Sleep -Seconds 3 } -Move-Item -Path "$PublishDir\Remotely-Win10-x86.zip" -Destination "$Root\Server\wwwroot\Content\Remotely-Win10-x86.zip" -Force +Move-Item -Path "$PublishDir\Remotely-Win-x86.zip" -Destination "$Root\Server\wwwroot\Content\Remotely-Win-x86.zip" -Force $PublishDir = "$Root\Agent\bin\Release\net7.0\linux-x64\publish" Compress-Archive -Path "$PublishDir\*" -DestinationPath "$PublishDir\Remotely-Linux.zip" -Force while ((Test-Path -Path "$PublishDir\Remotely-Linux.zip") -eq $false){ - Write-Host "Waiting for archive to finish: $PublishDir\Remotely-Win10-x86.zip" + Write-Host "Waiting for archive to finish: $PublishDir\Remotely-Win-x86.zip" Start-Sleep -Seconds 3 } Move-Item -Path "$PublishDir\Remotely-Linux.zip" -Destination "$Root\Server\wwwroot\Content\Remotely-Linux.zip" -Force diff --git a/submodules/Immense.RemoteControl b/submodules/Immense.RemoteControl index 709fbaf2..7b16798d 160000 --- a/submodules/Immense.RemoteControl +++ b/submodules/Immense.RemoteControl @@ -1 +1 @@ -Subproject commit 709fbaf2e29e6066327696540bec08fac225ae89 +Subproject commit 7b16798dd39d3fd8e2877a380cc50d7c4e55eb4d From 3f28faba3913d242de16d5c8aa8eef921e869613 Mon Sep 17 00:00:00 2001 From: Jared Goodwin Date: Fri, 18 Aug 2023 15:04:03 -0700 Subject: [PATCH 09/15] Add namespaces to Program.cs. Make publish locations runtime-agnostic. --- Desktop.Linux/Program.cs | 4 ++- .../PublishProfiles/packaged-linux-x64.pubxml | 2 +- Desktop.Win/Program.cs | 4 ++- .../packaged-win-x64-debug.pubxml | 2 +- .../PublishProfiles/packaged-win-x64.pubxml | 2 +- .../PublishProfiles/packaged-win-x86.pubxml | 2 +- .../PublishProfiles/wrapper-x64.pubxml | 18 ----------- .../PublishProfiles/wrapper-x86.pubxml | 18 ----------- Utilities/Publish.ps1 | 30 +++++++++---------- submodules/Immense.RemoteControl | 2 +- 10 files changed, 26 insertions(+), 58 deletions(-) delete mode 100644 Desktop.Win/Properties/PublishProfiles/wrapper-x64.pubxml delete mode 100644 Desktop.Win/Properties/PublishProfiles/wrapper-x86.pubxml diff --git a/Desktop.Linux/Program.cs b/Desktop.Linux/Program.cs index 76b4e1d0..10972d16 100644 --- a/Desktop.Linux/Program.cs +++ b/Desktop.Linux/Program.cs @@ -16,6 +16,8 @@ using Avalonia; using Immense.RemoteControl.Desktop.UI; using Desktop.Shared.Services; +namespace Remotely.Desktop.XPlat; + public class Program { // This is needed for the visual designer to work. @@ -105,4 +107,4 @@ public class Program } catch (TaskCanceledException) { } } -} +} \ No newline at end of file diff --git a/Desktop.Linux/Properties/PublishProfiles/packaged-linux-x64.pubxml b/Desktop.Linux/Properties/PublishProfiles/packaged-linux-x64.pubxml index 19c75459..3528e3f6 100644 --- a/Desktop.Linux/Properties/PublishProfiles/packaged-linux-x64.pubxml +++ b/Desktop.Linux/Properties/PublishProfiles/packaged-linux-x64.pubxml @@ -8,7 +8,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release x64 net7.0 - ..\Agent\bin\Release\net7.0\linux-x64\publish\Desktop + ..\Agent\bin\publish\linux-x64\Desktop linux-x64 true False diff --git a/Desktop.Win/Program.cs b/Desktop.Win/Program.cs index ea8d1bd5..64a932a8 100644 --- a/Desktop.Win/Program.cs +++ b/Desktop.Win/Program.cs @@ -15,6 +15,8 @@ using Avalonia; using Immense.RemoteControl.Desktop.UI; using Desktop.Shared.Services; +namespace Remotely.Desktop.Win; + public class Program { // This is needed for the visual designer to work. @@ -95,4 +97,4 @@ public class Program } catch (TaskCanceledException) { } } -} +} \ No newline at end of file diff --git a/Desktop.Win/Properties/PublishProfiles/packaged-win-x64-debug.pubxml b/Desktop.Win/Properties/PublishProfiles/packaged-win-x64-debug.pubxml index 846519dc..4389db11 100644 --- a/Desktop.Win/Properties/PublishProfiles/packaged-win-x64-debug.pubxml +++ b/Desktop.Win/Properties/PublishProfiles/packaged-win-x64-debug.pubxml @@ -8,7 +8,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Debug x64 net7.0 - ..\Agent\bin\Release\net7.0\win-x64\publish\Desktop + ..\Agent\bin\publish\win-x64\Desktop true win-x64 True diff --git a/Desktop.Win/Properties/PublishProfiles/packaged-win-x64.pubxml b/Desktop.Win/Properties/PublishProfiles/packaged-win-x64.pubxml index 525132a4..524005f6 100644 --- a/Desktop.Win/Properties/PublishProfiles/packaged-win-x64.pubxml +++ b/Desktop.Win/Properties/PublishProfiles/packaged-win-x64.pubxml @@ -8,7 +8,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release x64 net7.0 - ..\Agent\bin\Release\net7.0\win-x64\publish\Desktop + ..\Agent\bin\publish\win-x64\Desktop true win-x64 false diff --git a/Desktop.Win/Properties/PublishProfiles/packaged-win-x86.pubxml b/Desktop.Win/Properties/PublishProfiles/packaged-win-x86.pubxml index 0f1e16fe..0d321d1a 100644 --- a/Desktop.Win/Properties/PublishProfiles/packaged-win-x86.pubxml +++ b/Desktop.Win/Properties/PublishProfiles/packaged-win-x86.pubxml @@ -8,7 +8,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release x86 net7.0 - ..\Agent\bin\Release\net7.0\win-x86\publish\Desktop + ..\Agent\bin\publish\win-x86\Desktop win-x86 true False diff --git a/Desktop.Win/Properties/PublishProfiles/wrapper-x64.pubxml b/Desktop.Win/Properties/PublishProfiles/wrapper-x64.pubxml deleted file mode 100644 index 56eb1c86..00000000 --- a/Desktop.Win/Properties/PublishProfiles/wrapper-x64.pubxml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - FileSystem - Release - x64 - net7.0-windows - bin\Release\win-x64\publish\ - true - win-x64 - False - False - True - - \ No newline at end of file diff --git a/Desktop.Win/Properties/PublishProfiles/wrapper-x86.pubxml b/Desktop.Win/Properties/PublishProfiles/wrapper-x86.pubxml deleted file mode 100644 index 2144ba58..00000000 --- a/Desktop.Win/Properties/PublishProfiles/wrapper-x86.pubxml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - FileSystem - Release - x86 - net7.0 - bin\Release\win-x86\publish\ - true - win-x86 - False - False - True - - \ No newline at end of file diff --git a/Utilities/Publish.ps1 b/Utilities/Publish.ps1 index ddb607fd..e4eb184a 100644 --- a/Utilities/Publish.ps1 +++ b/Utilities/Publish.ps1 @@ -92,25 +92,25 @@ if ([string]::IsNullOrWhiteSpace($MSBuildPath) -or !(Test-Path -Path $MSBuildPat # Clear publish folders. -if ((Test-Path -Path "$Root\Agent\bin\Release\net7.0\win-x64\publish") -eq $true) { - Get-ChildItem -Path "$Root\Agent\bin\Release\net7.0\win-x64\publish" | Remove-Item -Force -Recurse +if ((Test-Path -Path "$Root\Agent\bin\publish\win-x64") -eq $true) { + Get-ChildItem -Path "$Root\Agent\bin\publish\win-x64" | Remove-Item -Force -Recurse } -if ((Test-Path -Path "$Root\Agent\bin\Release\net7.0\win-x86\publish" ) -eq $true) { - Get-ChildItem -Path "$Root\Agent\bin\Release\net7.0\win-x86\publish" | Remove-Item -Force -Recurse +if ((Test-Path -Path "$Root\Agent\bin\publish\win-x86" ) -eq $true) { + Get-ChildItem -Path "$Root\Agent\bin\publish\win-x86" | Remove-Item -Force -Recurse } -if ((Test-Path -Path "$Root\Agent\bin\Release\net7.0\linux-x64\publish") -eq $true) { - Get-ChildItem -Path "$Root\Agent\bin\Release\net7.0\linux-x64\publish" | Remove-Item -Force -Recurse +if ((Test-Path -Path "$Root\Agent\bin\publish\linux-x64") -eq $true) { + Get-ChildItem -Path "$Root\Agent\bin\publish\linux-x64" | Remove-Item -Force -Recurse } # Publish Core clients. -dotnet publish /p:Version=$CurrentVersion /p:FileVersion=$CurrentVersion --runtime win-x64 --self-contained --configuration Release --output "$Root\Agent\bin\Release\net7.0\win-x64\publish" "$Root\Agent" -dotnet publish /p:Version=$CurrentVersion /p:FileVersion=$CurrentVersion --runtime linux-x64 --self-contained --configuration Release --output "$Root\Agent\bin\Release\net7.0\linux-x64\publish" "$Root\Agent" -dotnet publish /p:Version=$CurrentVersion /p:FileVersion=$CurrentVersion --runtime win-x86 --self-contained --configuration Release --output "$Root\Agent\bin\Release\net7.0\win-x86\publish" "$Root\Agent" +dotnet publish /p:Version=$CurrentVersion /p:FileVersion=$CurrentVersion --runtime win-x64 --self-contained --configuration Release --output "$Root\Agent\bin\publish\win-x64" "$Root\Agent" +dotnet publish /p:Version=$CurrentVersion /p:FileVersion=$CurrentVersion --runtime linux-x64 --self-contained --configuration Release --output "$Root\Agent\bin\publish\linux-x64" "$Root\Agent" +dotnet publish /p:Version=$CurrentVersion /p:FileVersion=$CurrentVersion --runtime win-x86 --self-contained --configuration Release --output "$Root\Agent\bin\publish\win-x86" "$Root\Agent" -New-Item -Path "$Root\Agent\bin\Release\net7.0\win-x64\publish\Desktop\" -ItemType Directory -Force -New-Item -Path "$Root\Agent\bin\Release\net7.0\win-x86\publish\Desktop\" -ItemType Directory -Force -New-Item -Path "$Root\Agent\bin\Release\net7.0\linux-x64\publish\Desktop\" -ItemType Directory -Force +New-Item -Path "$Root\Agent\bin\publish\win-x64\Desktop\" -ItemType Directory -Force +New-Item -Path "$Root\Agent\bin\publish\win-x86\Desktop\" -ItemType Directory -Force +New-Item -Path "$Root\Agent\bin\publish\linux-x64\Desktop\" -ItemType Directory -Force # Publish Linux ScreenCaster @@ -155,7 +155,7 @@ if ($SignAssemblies) { } # Compress Core clients. -$PublishDir = "$Root\Agent\bin\Release\net7.0\win-x64\publish" +$PublishDir = "$Root\Agent\bin\publish\win-x64" Compress-Archive -Path "$PublishDir\*" -DestinationPath "$PublishDir\Remotely-Win-x64.zip" -Force while ((Test-Path -Path "$PublishDir\Remotely-Win-x64.zip") -eq $false){ Write-Host "Waiting for archive to finish: $PublishDir\Remotely-Win-x64.zip" @@ -163,7 +163,7 @@ while ((Test-Path -Path "$PublishDir\Remotely-Win-x64.zip") -eq $false){ } Move-Item -Path "$PublishDir\Remotely-Win-x64.zip" -Destination "$Root\Server\wwwroot\Content\Remotely-Win-x64.zip" -Force -$PublishDir = "$Root\Agent\bin\Release\net7.0\win-x86\publish" +$PublishDir = "$Root\Agent\bin\publish\win-x86" Compress-Archive -Path "$PublishDir\*" -DestinationPath "$PublishDir\Remotely-Win-x86.zip" -Force while ((Test-Path -Path "$PublishDir\Remotely-Win-x86.zip") -eq $false){ Write-Host "Waiting for archive to finish: $PublishDir\Remotely-Win-x86.zip" @@ -171,7 +171,7 @@ while ((Test-Path -Path "$PublishDir\Remotely-Win-x86.zip") -eq $false){ } Move-Item -Path "$PublishDir\Remotely-Win-x86.zip" -Destination "$Root\Server\wwwroot\Content\Remotely-Win-x86.zip" -Force -$PublishDir = "$Root\Agent\bin\Release\net7.0\linux-x64\publish" +$PublishDir = "$Root\Agent\bin\publish\linux-x64" Compress-Archive -Path "$PublishDir\*" -DestinationPath "$PublishDir\Remotely-Linux.zip" -Force while ((Test-Path -Path "$PublishDir\Remotely-Linux.zip") -eq $false){ Write-Host "Waiting for archive to finish: $PublishDir\Remotely-Win-x86.zip" diff --git a/submodules/Immense.RemoteControl b/submodules/Immense.RemoteControl index 7b16798d..9395713c 160000 --- a/submodules/Immense.RemoteControl +++ b/submodules/Immense.RemoteControl @@ -1 +1 @@ -Subproject commit 7b16798dd39d3fd8e2877a380cc50d7c4e55eb4d +Subproject commit 9395713ca70430b8b473cccb6fd63f888aeb6aa9 From 219518a5b7ab24fed576cf4612b26a61bd3a58fc Mon Sep 17 00:00:00 2001 From: Jared Goodwin Date: Mon, 21 Aug 2023 08:26:15 -0700 Subject: [PATCH 10/15] Don't start with hidden window flags. --- Agent/Services/Windows/AppLauncherWin.cs | 2 +- submodules/Immense.RemoteControl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Agent/Services/Windows/AppLauncherWin.cs b/Agent/Services/Windows/AppLauncherWin.cs index 487df527..4647a318 100644 --- a/Agent/Services/Windows/AppLauncherWin.cs +++ b/Agent/Services/Windows/AppLauncherWin.cs @@ -124,7 +124,7 @@ public class AppLauncherWin : IAppLauncher targetSessionId: targetSessionId, forceConsoleSession: Shlwapi.IsOS(OsType.OS_ANYSERVER) && targetSessionId == -1, desktopName: "default", - hiddenWindow: true, + hiddenWindow: false, out _); if (!result) { diff --git a/submodules/Immense.RemoteControl b/submodules/Immense.RemoteControl index 9395713c..8d542429 160000 --- a/submodules/Immense.RemoteControl +++ b/submodules/Immense.RemoteControl @@ -1 +1 @@ -Subproject commit 9395713ca70430b8b473cccb6fd63f888aeb6aa9 +Subproject commit 8d542429b749d462903c15d4668ef932777370c8 From 583c870d3b52300f7c8c4a6270d66c0c0df6f0f5 Mon Sep 17 00:00:00 2001 From: Jared Goodwin Date: Mon, 21 Aug 2023 08:26:57 -0700 Subject: [PATCH 11/15] Don't restart screencaster with hidden window flags. --- Agent/Services/Windows/AppLauncherWin.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Agent/Services/Windows/AppLauncherWin.cs b/Agent/Services/Windows/AppLauncherWin.cs index 4647a318..7714a799 100644 --- a/Agent/Services/Windows/AppLauncherWin.cs +++ b/Agent/Services/Windows/AppLauncherWin.cs @@ -182,7 +182,7 @@ public class AppLauncherWin : IAppLauncher targetSessionId: targetSessionID, forceConsoleSession: Shlwapi.IsOS(OsType.OS_ANYSERVER) && targetSessionID == -1, desktopName: "default", - hiddenWindow: true, + hiddenWindow: false, out _); if (!result) From 137db6af40a293b077e3faf973ff8bc1d659252e Mon Sep 17 00:00:00 2001 From: Jared Goodwin Date: Mon, 21 Aug 2023 12:05:29 -0700 Subject: [PATCH 12/15] Remove branding properties that no longer exist. --- Agent.Installer.Win/MainWindow.xaml | 19 +- Agent.Installer.Win/Models/BrandingInfo.cs | 18 - .../ViewModels/MainWindowViewModel.cs | 22 - ...821190450_Remove_TitleBranding.Designer.cs | 1201 ++++++++++++++++ .../20230821190450_Remove_TitleBranding.cs | 117 ++ .../PostgreSqlDbContextModelSnapshot.cs | 29 +- ...821190440_Remove_TitleBranding.Designer.cs | 1204 +++++++++++++++++ .../20230821190440_Remove_TitleBranding.cs | 117 ++ .../SqlServerDbContextModelSnapshot.cs | 29 +- ...821190428_Remove_TitleBranding.Designer.cs | 1197 ++++++++++++++++ .../20230821190428_Remove_TitleBranding.cs | 117 ++ .../Sqlite/SqliteDbContextModelSnapshot.cs | 29 +- Server/Pages/Branding.razor | 65 +- Server/Services/DataService.cs | 24 +- submodules/Immense.RemoteControl | 2 +- 15 files changed, 3976 insertions(+), 214 deletions(-) create mode 100644 Server/Migrations/PostgreSql/20230821190450_Remove_TitleBranding.Designer.cs create mode 100644 Server/Migrations/PostgreSql/20230821190450_Remove_TitleBranding.cs create mode 100644 Server/Migrations/SqlServer/20230821190440_Remove_TitleBranding.Designer.cs create mode 100644 Server/Migrations/SqlServer/20230821190440_Remove_TitleBranding.cs create mode 100644 Server/Migrations/Sqlite/20230821190428_Remove_TitleBranding.Designer.cs create mode 100644 Server/Migrations/Sqlite/20230821190428_Remove_TitleBranding.cs diff --git a/Agent.Installer.Win/MainWindow.xaml b/Agent.Installer.Win/MainWindow.xaml index 3f1b4520..fcd6eb9d 100644 --- a/Agent.Installer.Win/MainWindow.xaml +++ b/Agent.Installer.Win/MainWindow.xaml @@ -6,7 +6,6 @@ xmlns:ViewModels="clr-namespace:Remotely.Agent.Installer.Win.ViewModels" xmlns:local="clr-namespace:Remotely.Agent.Installer.Win" mc:Ignorable="d" - WindowStyle="None" ResizeMode="CanResizeWithGrip" AllowsTransparency="True" MouseLeftButtonDown="Window_MouseLeftButtonDown" @@ -21,25 +20,11 @@ - - - - - - - - - - - @@ -76,10 +58,6 @@ [Display(Name = "Product Name")] public string ProductName { get; set; } = string.Empty; - public ColorPickerModel TitleForegroundColor { get; set; } = new(); - public ColorPickerModel TitleBackgroundColor { get; set; } = new(); - public ColorPickerModel TitleButtonColor { get; set; } = new(); - public byte[] IconBytes { get; set; } = Array.Empty(); } @@ -97,10 +75,7 @@ await DataService.UpdateBrandingInfo( User.OrganizationID, _inputModel.ProductName, - _inputModel.IconBytes, - _inputModel.TitleForegroundColor, - _inputModel.TitleBackgroundColor, - _inputModel.TitleButtonColor); + _inputModel.IconBytes); if (_inputModel?.IconBytes?.Any() == true) { @@ -139,7 +114,7 @@ return; } - var brandingResult= await DataService.GetBrandingInfo(orgResult.Value.ID); + var brandingResult = await DataService.GetBrandingInfo(orgResult.Value.ID); if (!brandingResult.IsSuccess) { @@ -154,18 +129,6 @@ { _base64Icon = Convert.ToBase64String(brandingInfo.Icon); } - - _inputModel.TitleForegroundColor.Red = brandingInfo.TitleForegroundRed; - _inputModel.TitleForegroundColor.Green = brandingInfo.TitleForegroundGreen; - _inputModel.TitleForegroundColor.Blue = brandingInfo.TitleForegroundBlue; - - _inputModel.TitleBackgroundColor.Red = brandingInfo.TitleBackgroundRed; - _inputModel.TitleBackgroundColor.Green = brandingInfo.TitleBackgroundGreen; - _inputModel.TitleBackgroundColor.Blue = brandingInfo.TitleBackgroundBlue; - - _inputModel.TitleButtonColor.Red = brandingInfo.ButtonForegroundRed; - _inputModel.TitleButtonColor.Green = brandingInfo.ButtonForegroundGreen; - _inputModel.TitleButtonColor.Blue = brandingInfo.ButtonForegroundBlue; } private async Task ResetBranding() diff --git a/Server/Services/DataService.cs b/Server/Services/DataService.cs index d2d7c35b..1ad7d7c7 100644 --- a/Server/Services/DataService.cs +++ b/Server/Services/DataService.cs @@ -206,12 +206,9 @@ public interface IDataService Task TempPasswordSignIn(string email, string password); Task UpdateBrandingInfo( - string organizationId, + string organizationId, string productName, - byte[] iconBytes, - ColorPickerModel titleForeground, - ColorPickerModel titleBackground, - ColorPickerModel titleButtonForeground); + byte[] iconBytes); Task> UpdateDevice(DeviceSetupOptions deviceOptions, string organizationId); @@ -2043,10 +2040,7 @@ public class DataService : IDataService public async Task UpdateBrandingInfo( string organizationId, string productName, - byte[] iconBytes, - ColorPickerModel titleForeground, - ColorPickerModel titleBackground, - ColorPickerModel titleButtonForeground) + byte[] iconBytes) { using var dbContext = _appDbFactory.GetContext(); @@ -2068,18 +2062,6 @@ public class DataService : IDataService organization.BrandingInfo.Icon = iconBytes; } - organization.BrandingInfo.TitleBackgroundRed = titleBackground.Red; - organization.BrandingInfo.TitleBackgroundGreen = titleBackground.Green; - organization.BrandingInfo.TitleBackgroundBlue = titleBackground.Blue; - - organization.BrandingInfo.TitleForegroundRed = titleForeground.Red; - organization.BrandingInfo.TitleForegroundGreen = titleForeground.Green; - organization.BrandingInfo.TitleForegroundBlue = titleForeground.Blue; - - organization.BrandingInfo.ButtonForegroundRed = titleButtonForeground.Red; - organization.BrandingInfo.ButtonForegroundGreen = titleButtonForeground.Green; - organization.BrandingInfo.ButtonForegroundBlue = titleButtonForeground.Blue; - await dbContext.SaveChangesAsync(); } diff --git a/submodules/Immense.RemoteControl b/submodules/Immense.RemoteControl index 8d542429..ea0b95b5 160000 --- a/submodules/Immense.RemoteControl +++ b/submodules/Immense.RemoteControl @@ -1 +1 @@ -Subproject commit 8d542429b749d462903c15d4668ef932777370c8 +Subproject commit ea0b95b5dba6ed39b5aaa3087c07b635c64b7ea2 From 9292ea35d42b61e4fe229d7ca47611cd9d02946f Mon Sep 17 00:00:00 2001 From: Jared Goodwin Date: Mon, 21 Aug 2023 13:16:31 -0700 Subject: [PATCH 13/15] Limit icon size on branding page. --- Server/Pages/Branding.razor | 4 ++-- Server/Pages/Branding.razor.css | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 Server/Pages/Branding.razor.css diff --git a/Server/Pages/Branding.razor b/Server/Pages/Branding.razor index d866add0..2a42258d 100644 --- a/Server/Pages/Branding.razor +++ b/Server/Pages/Branding.razor @@ -27,11 +27,11 @@
@if (!string.IsNullOrWhiteSpace(_base64Icon)) { - + } else { - + } diff --git a/Server/Pages/Branding.razor.css b/Server/Pages/Branding.razor.css new file mode 100644 index 00000000..7a5dc4d4 --- /dev/null +++ b/Server/Pages/Branding.razor.css @@ -0,0 +1,4 @@ +.branding-icon { + max-width: 8rem; + height: auto; +} \ No newline at end of file From 03486df7392d1241ec7cdd4d43bcd952090a23c9 Mon Sep 17 00:00:00 2001 From: Jared Goodwin Date: Mon, 21 Aug 2023 14:09:50 -0700 Subject: [PATCH 14/15] Fix namespace. --- Desktop.Win/Program.cs | 2 +- submodules/Immense.RemoteControl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Desktop.Win/Program.cs b/Desktop.Win/Program.cs index 64a932a8..ca1ced52 100644 --- a/Desktop.Win/Program.cs +++ b/Desktop.Win/Program.cs @@ -9,7 +9,7 @@ using System.Diagnostics; using Remotely.Shared.Utilities; using Immense.RemoteControl.Desktop.Shared.Startup; using System.Linq; -using Immense.RemoteControl.Immense.RemoteControl.Desktop.Windows.Startup; +using Immense.RemoteControl.Desktop.Windows.Startup; using Immense.RemoteControl.Desktop.UI.Services; using Avalonia; using Immense.RemoteControl.Desktop.UI; diff --git a/submodules/Immense.RemoteControl b/submodules/Immense.RemoteControl index ea0b95b5..52e237dc 160000 --- a/submodules/Immense.RemoteControl +++ b/submodules/Immense.RemoteControl @@ -1 +1 @@ -Subproject commit ea0b95b5dba6ed39b5aaa3087c07b635c64b7ea2 +Subproject commit 52e237dcc48717ceb31b8f9fddaab46c68c50074 From 3440bbe4dc2b3b7f4f6a28ef5cb3529d55ecc2cf Mon Sep 17 00:00:00 2001 From: Jared Goodwin Date: Tue, 22 Aug 2023 08:22:16 -0700 Subject: [PATCH 15/15] Don't restart if consent wasn't granted on the first request. --- Server/Services/RcImplementations/HubEventHandler.cs | 12 ++++++++++++ submodules/Immense.RemoteControl | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Server/Services/RcImplementations/HubEventHandler.cs b/Server/Services/RcImplementations/HubEventHandler.cs index 499cdcd3..588c40da 100644 --- a/Server/Services/RcImplementations/HubEventHandler.cs +++ b/Server/Services/RcImplementations/HubEventHandler.cs @@ -97,6 +97,12 @@ public class HubEventHandler : IHubEventHandler return Task.CompletedTask; } + if (ex.RequireConsent) + { + // Don't restart if consent wasn't granted on the first request. + return Task.CompletedTask; + } + _logger.LogDebug("Windows session changed during remote control. " + "Reason: {reason}. " + "Current Session ID: {sessionId}. " + @@ -126,6 +132,12 @@ public class HubEventHandler : IHubEventHandler return Task.CompletedTask; } + if (ex.RequireConsent) + { + // Don't restart if consent wasn't granted on the first request. + return Task.CompletedTask; + } + return _serviceHub.Clients .Client(ex.AgentConnectionId) .RestartScreenCaster( diff --git a/submodules/Immense.RemoteControl b/submodules/Immense.RemoteControl index 52e237dc..ab9f9604 160000 --- a/submodules/Immense.RemoteControl +++ b/submodules/Immense.RemoteControl @@ -1 +1 @@ -Subproject commit 52e237dcc48717ceb31b8f9fddaab46c68c50074 +Subproject commit ab9f9604be3d9ece45de0810e4826fe28ac5a932