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/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 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/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/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/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/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/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/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/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/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 { 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/Utilities/Publish.ps1 b/Utilities/Publish.ps1 index 6a96cbe3..e4eb184a 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,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\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\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\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\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 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 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-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\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\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,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\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" 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\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" 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" +$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-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 b306cc12..ab9f9604 160000 --- a/submodules/Immense.RemoteControl +++ b/submodules/Immense.RemoteControl @@ -1 +1 @@ -Subproject commit b306cc12afcc8c7d758a92682d3a06d2519b9735 +Subproject commit ab9f9604be3d9ece45de0810e4826fe28ac5a932