Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement remote control submodule changes. #715

Merged
merged 15 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 2 additions & 17 deletions Agent.Installer.Win/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -21,25 +20,11 @@
</Window.DataContext>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>

<Border Height="50" Background="{Binding TitleBackgroundColor}">
<DockPanel Margin="10,0,0,0">
<DockPanel>
<Image Height="50" Width="50" Margin="0,0,10,0" Source="{Binding Icon}"></Image>
<TextBlock Foreground="{Binding TitleForegroundColor}" FontWeight="Bold" FontSize="20" VerticalAlignment="Center">
<Run Text="{Binding ProductName}"></Run>
<Run Text="Installer"></Run>
</TextBlock>
</DockPanel>
<Button Style="{StaticResource TitlebarButton}" Click="CloseButton_Click" Content="X" Foreground="{Binding TitleButtonForegroundColor}" Background="{Binding TitleBackgroundColor}" />
<Button Style="{StaticResource TitlebarButton}" Click="MinimizeButton_Click" Content="____" Foreground="{Binding TitleButtonForegroundColor}" Background="{Binding TitleBackgroundColor}"/>
</DockPanel>
</Border>
<Grid Grid.Row="1" Margin="10,15,10,0">
<Grid Grid.Row="0" Margin="10,15,10,0">

<StackPanel>
<TextBlock Style="{StaticResource SectionHeader}" Text="{Binding HeaderMessage}" Margin="0,0,0,10"></TextBlock>
Expand Down Expand Up @@ -122,7 +107,7 @@

</Grid>

<DockPanel Margin="10" Grid.Row="2">
<DockPanel Margin="10" Grid.Row="1">
<Button DockPanel.Dock="Left"
HorizontalAlignment="Left"
Style="{StaticResource NormalButton}"
Expand Down
18 changes: 0 additions & 18 deletions Agent.Installer.Win/Models/BrandingInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,4 @@ public class BrandingInfo
public string Product { get; set; } = "Remotely";

public string? Icon { get; set; }

public byte TitleForegroundRed { get; set; } = 29;

public byte TitleForegroundGreen { get; set; } = 144;

public byte TitleForegroundBlue { get; set; } = 241;

public byte TitleBackgroundRed { get; set; } = 70;

public byte TitleBackgroundGreen { get; set; } = 70;

public byte TitleBackgroundBlue { get; set; } = 70;

public byte ButtonForegroundRed { get; set; } = 255;

public byte ButtonForegroundGreen { get; set; } = 255;

public byte ButtonForegroundBlue { get; set; } = 255;
}
4 changes: 2 additions & 2 deletions Agent.Installer.Win/Services/InstallerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ private async Task DownloadRemotelyAgent(string serverUrl)
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);
}
}

Expand All @@ -290,7 +290,7 @@ private async Task DownloadRemotelyAgent(string serverUrl)
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())
{
Expand Down
22 changes: 0 additions & 22 deletions Agent.Installer.Win/ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,6 @@ public string? StatusMessage
}
}

public SolidColorBrush? TitleBackgroundColor { get; set; }
public SolidColorBrush? TitleButtonForegroundColor { get; set; }
public SolidColorBrush? TitleForegroundColor { get; set; }
public ICommand UninstallCommand => new RelayCommand(async (param) => { await Uninstall(); });
private string? DeviceAlias { get; set; }
private string? DeviceGroup { get; set; }
Expand Down Expand Up @@ -280,25 +277,6 @@ private void ApplyBranding(BrandingInfo? brandingInfo)
ProductName = brandingInfo.Product;
}

TitleBackgroundColor = new SolidColorBrush(Color.FromRgb(
brandingInfo?.TitleBackgroundRed ?? 70,
brandingInfo?.TitleBackgroundGreen ?? 70,
brandingInfo?.TitleBackgroundBlue ?? 70));

TitleForegroundColor = new SolidColorBrush(Color.FromRgb(
brandingInfo?.TitleForegroundRed ?? 29,
brandingInfo?.TitleForegroundGreen ?? 144,
brandingInfo?.TitleForegroundBlue ?? 241));

TitleButtonForegroundColor = new SolidColorBrush(Color.FromRgb(
brandingInfo?.ButtonForegroundRed ?? 255,
brandingInfo?.ButtonForegroundGreen ?? 255,
brandingInfo?.ButtonForegroundBlue ?? 255));

TitleBackgroundColor.Freeze();
TitleForegroundColor.Freeze();
TitleButtonForegroundColor.Freeze();

Icon = GetBitmapImageIcon(brandingInfo);
}
catch (Exception ex)
Expand Down
8 changes: 4 additions & 4 deletions Agent/Agent.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Hosting.WindowsServices" Version="7.0.9" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" Version="7.0.9" />
<PackageReference Include="Microsoft.AspNetCore.Hosting.WindowsServices" Version="7.0.10" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" Version="7.0.10" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="7.0.1" />
<PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.EventLog" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="7.0.9" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="7.0.10" />
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.3.6" />
<PackageReference Include="Microsoft.WSMan.Management" Version="7.3.6" />
<PackageReference Include="Microsoft.WSMan.Runtime" Version="7.3.6" />
Expand All @@ -41,7 +41,7 @@

<ItemGroup>
<ProjectReference Include="..\Shared\Shared.csproj" />
<ProjectReference Include="..\submodules\Immense.RemoteControl\Immense.RemoteControl.Desktop.Native\Immense.RemoteControl.Desktop.Native.csproj" />
<ProjectReference Include="..\submodules\Immense.RemoteControl\Immense.RemoteControl.Desktop.Shared\Immense.RemoteControl.Desktop.Shared.csproj" />
</ItemGroup>


Expand Down
4 changes: 1 addition & 3 deletions Agent/Services/AgentHubConnection.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -9,9 +9,7 @@
using Remotely.Shared.Enums;
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;
Expand Down
3 changes: 2 additions & 1 deletion Agent/Services/FileLogsManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.Extensions.Logging;
using Remotely.Shared.Services;
using System;
using System.Collections.Generic;
using System.IO;
Expand All @@ -9,7 +10,7 @@
using System.Threading;
using System.Threading.Tasks;

namespace Remotely.Shared.Services;
namespace Remotely.Agent.Services;

public interface IFileLogsManager
{
Expand Down
8 changes: 3 additions & 5 deletions Agent/Services/Windows/AppLauncherWin.cs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down Expand Up @@ -126,7 +124,7 @@ await hubConnection.SendAsync("DisplayMessage",
targetSessionId: targetSessionId,
forceConsoleSession: Shlwapi.IsOS(OsType.OS_ANYSERVER) && targetSessionId == -1,
desktopName: "default",
hiddenWindow: true,
hiddenWindow: false,
out _);
if (!result)
{
Expand Down Expand Up @@ -184,7 +182,7 @@ public async Task RestartScreenCaster(string[] viewerIds, string sessionId, stri
targetSessionId: targetSessionID,
forceConsoleSession: Shlwapi.IsOS(OsType.OS_ANYSERVER) && targetSessionID == -1,
desktopName: "default",
hiddenWindow: true,
hiddenWindow: false,
out _);

if (!result)
Expand Down
3 changes: 1 addition & 2 deletions Agent/Services/Windows/DeviceInfoGeneratorWin.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Agent/Services/Windows/UpdaterWin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public async Task CheckForUpdates()
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);
Expand Down
3 changes: 2 additions & 1 deletion Desktop.Linux/Desktop.Linux.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Desktop.Shared\Desktop.Shared.csproj" />
<ProjectReference Include="..\submodules\Immense.RemoteControl\Immense.RemoteControl.Desktop.Linux\Immense.RemoteControl.Desktop.Linux.csproj" />
<ProjectReference Include="..\submodules\Immense.RemoteControl\Immense.RemoteControl.Desktop.Shared\Immense.RemoteControl.Desktop.Shared.csproj" />
<ProjectReference Include="..\submodules\Immense.RemoteControl\Immense.RemoteControl.Desktop\Immense.RemoteControl.Desktop.csproj" />
<ProjectReference Include="..\submodules\Immense.RemoteControl\Immense.RemoteControl.Desktop.UI\Immense.RemoteControl.Desktop.UI.csproj" />
</ItemGroup>
</Project>
Loading