From 699b779b41b76bf0f7f15ee5762c9169cf71539a Mon Sep 17 00:00:00 2001 From: Jared Goodwin Date: Tue, 16 Jul 2024 09:12:34 -0700 Subject: [PATCH] Remove now-unused installer project. --- .../Agent.Installer.Win.csproj | 210 ------- Agent.Installer.Win/App.config | 6 - Agent.Installer.Win/App.xaml | 31 -- Agent.Installer.Win/App.xaml.cs | 11 - Agent.Installer.Win/Assets/Remotely_Icon.png | Bin 4480 -> 0 bytes Agent.Installer.Win/Assets/favicon.ico | Bin 105261 -> 0 bytes Agent.Installer.Win/MainWindow.xaml | 144 ----- Agent.Installer.Win/MainWindow.xaml.cs | 76 --- Agent.Installer.Win/Models/BrandingInfo.cs | 10 - .../Models/EmbeddedServerData.cs | 28 - .../Properties/AssemblyInfo.cs | 53 -- .../Properties/Resources.Designer.cs | 63 --- Agent.Installer.Win/Properties/Resources.resx | 117 ---- .../Properties/Settings.Designer.cs | 26 - .../Properties/Settings.settings | 7 - .../Services/EmbeddedServerDataReader.cs | 55 -- .../Services/InstallerService.cs | 455 ---------------- Agent.Installer.Win/Services/RelayCommand.cs | 39 -- .../Utilities/CommandLineParser.cs | 78 --- Agent.Installer.Win/Utilities/Logger.cs | 82 --- Agent.Installer.Win/Utilities/MessageBoxEx.cs | 15 - Agent.Installer.Win/Utilities/ProcessEx.cs | 18 - .../ViewModels/MainWindowViewModel.cs | 512 ------------------ .../ViewModels/ViewModelBase.cs | 16 - Agent.Installer.Win/app.manifest | 76 --- Remotely.sln | 14 - 26 files changed, 2142 deletions(-) delete mode 100644 Agent.Installer.Win/Agent.Installer.Win.csproj delete mode 100644 Agent.Installer.Win/App.config delete mode 100644 Agent.Installer.Win/App.xaml delete mode 100644 Agent.Installer.Win/App.xaml.cs delete mode 100644 Agent.Installer.Win/Assets/Remotely_Icon.png delete mode 100644 Agent.Installer.Win/Assets/favicon.ico delete mode 100644 Agent.Installer.Win/MainWindow.xaml delete mode 100644 Agent.Installer.Win/MainWindow.xaml.cs delete mode 100644 Agent.Installer.Win/Models/BrandingInfo.cs delete mode 100644 Agent.Installer.Win/Models/EmbeddedServerData.cs delete mode 100644 Agent.Installer.Win/Properties/AssemblyInfo.cs delete mode 100644 Agent.Installer.Win/Properties/Resources.Designer.cs delete mode 100644 Agent.Installer.Win/Properties/Resources.resx delete mode 100644 Agent.Installer.Win/Properties/Settings.Designer.cs delete mode 100644 Agent.Installer.Win/Properties/Settings.settings delete mode 100644 Agent.Installer.Win/Services/EmbeddedServerDataReader.cs delete mode 100644 Agent.Installer.Win/Services/InstallerService.cs delete mode 100644 Agent.Installer.Win/Services/RelayCommand.cs delete mode 100644 Agent.Installer.Win/Utilities/CommandLineParser.cs delete mode 100644 Agent.Installer.Win/Utilities/Logger.cs delete mode 100644 Agent.Installer.Win/Utilities/MessageBoxEx.cs delete mode 100644 Agent.Installer.Win/Utilities/ProcessEx.cs delete mode 100644 Agent.Installer.Win/ViewModels/MainWindowViewModel.cs delete mode 100644 Agent.Installer.Win/ViewModels/ViewModelBase.cs delete mode 100644 Agent.Installer.Win/app.manifest diff --git a/Agent.Installer.Win/Agent.Installer.Win.csproj b/Agent.Installer.Win/Agent.Installer.Win.csproj deleted file mode 100644 index 42b0ce37..00000000 --- a/Agent.Installer.Win/Agent.Installer.Win.csproj +++ /dev/null @@ -1,210 +0,0 @@ - - - - - Debug - AnyCPU - {A3D0368C-0850-4614-B5B5-41B9D5135AA9} - WinExe - Remotely.Agent.Installer.Win - Remotely_Installer - v4.8 - 512 - {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 4 - true - true - - 10 - enable - - - win;win-x64;win10-x64;win-x64;win10-x86; - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - Assets\favicon.ico - - - app.manifest - - - true - bin\x64\Debug\ - DEBUG;TRACE - full - x64 - 7.3 - prompt - MinimumRecommendedRules.ruleset - true - - - bin\x64\Release\ - TRACE - true - pdbonly - x64 - 7.3 - prompt - MinimumRecommendedRules.ruleset - true - - - true - bin\x86\Debug\ - DEBUG;TRACE - full - x86 - 7.3 - prompt - MinimumRecommendedRules.ruleset - true - - - bin\x86\Release\ - TRACE - true - pdbonly - x86 - 7.3 - prompt - MinimumRecommendedRules.ruleset - true - - - - - - - - - - - - - - C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.2\System.Runtime.Serialization.dll - - - - - - - - - - - 4.0 - - - - - - - - MSBuild:Compile - Designer - - - AppConstants.cs - - - Models\ConnectionInfo.cs - - - Models\DeviceSetupOptions.cs - - - - - - - - - - - - - - MSBuild:Compile - Designer - - - App.xaml - Code - - - MainWindow.xaml - Code - - - - - Code - - - True - True - Resources.resx - - - True - Settings.settings - True - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - - - - - - - - - - - - {F935DC20-1CF0-11D0-ADB9-00C04FD58A0B} - 1 - 0 - 0 - tlbimp - False - True - - - - - - - - \ No newline at end of file diff --git a/Agent.Installer.Win/App.config b/Agent.Installer.Win/App.config deleted file mode 100644 index 4bfa0056..00000000 --- a/Agent.Installer.Win/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/Agent.Installer.Win/App.xaml b/Agent.Installer.Win/App.xaml deleted file mode 100644 index aa4b0db2..00000000 --- a/Agent.Installer.Win/App.xaml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - diff --git a/Agent.Installer.Win/App.xaml.cs b/Agent.Installer.Win/App.xaml.cs deleted file mode 100644 index 82a1a9d3..00000000 --- a/Agent.Installer.Win/App.xaml.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Windows; - -namespace Remotely.Agent.Installer.Win; - -/// -/// Interaction logic for App.xaml -/// -public partial class App : Application -{ - -} diff --git a/Agent.Installer.Win/Assets/Remotely_Icon.png b/Agent.Installer.Win/Assets/Remotely_Icon.png deleted file mode 100644 index 987309020b03df48f3234728cfbac5073788fb3b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4480 zcmeHK3s)1@7LI{P0|GTd;sZei!Yc+4ksv5lR9-R28+01N!`dn!GhjtQYCuID1W8n4 zO`#NdDBh4@)ub9pz)>Co_IBB+LMsdb+9C*eBNP?x$-Vs*ZD*~SoVCwB`@Ht|eLH7% z@q)}vmz$DEB=eBqZIL9>0-53czzA68-DvgT$9UhCom)sGMXA}lBnpXSMB2rT-VW?5 z&rgEyKhHlW@HaexxA2+A04SvFNM6+Z-}@m&O`AA^6rg4XCuEUG7A=N%fwgn!abR4U zy*)lV>fk5Yhm(-Kq|BtxGP2njd$U)qXM3`}Q-k6G<188u*|sG*hd=h?*zFa*%eEyc z=TY0Xjm>ZfmDwvgu&_K@pr{U&Jy$EM$>_>f=!kl*$Su_4Sp+j~h~KwMh*iL{ zd;EaREmUT%Xml9^xHs@*->H?AWb|W8)zs0av!!WOP)siDN1?y1K!)@LLgT)1#Fwz^ zG{i?WkasTZL!q14W~txniTyOL#f6R-1;Zyw0PB45yNT{>rdAh>oP#|n^rHPk*Ksu0 zMb24YHrmz5z(oS2K3=w8t-MG^Q@m8aygdrLP??WJ2Tp{!$Y;LZE!(YDipi*DEuz-z ziBKAMvvYYvq&X_3_o@2a&7gnAZAWx@t#LU5&*T$Q{CYxqe%;x1qD>xIy zufg2Ck7LFg;M-^H!#QiUx^;z+*Nb!Fl{QB;NnjOY!>(_JIM1|Ip537ys&PLAmZK?w zHefl0fwGatM=ExSISiI#-m7vwwyDHCGxK;Mjhi8F)Boo^$6KRaVBsoPrUb-QxwlaUKl}v>78LWOR=|a;|yJzEhm%7)ZlAHageW*1ld3zPIItc&IQ3e8LY& zJzc#?8YzH#LS(LqB6~2fALJH*go%ZVT-ol3|9SvPK3%=i2Kf9CAzPCuUJ_`NJ_r)( zN*eN&o)DN6S;hAqy429d7E+mKbu!)cDaYCw-NxTAg@qx^m`7Y$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SET0+T8mNi zOi9l)4b`;(yaSZTA|2m+?~F8BS5l;(($#+71m4psWVM&|1^o1k{Xt1NdZsp!EhifX zPaTl5b&|Wtm%HYL^hl603{*ZNq5M)6GN#JfEQzCBTNP!`OL*mlD9Z=YJ8MNgWFhaH z^GzhOkVoxM*&c;)-AXL@vc1Uz73L!(Sb_l+aAc>#(Yk-KWYIlx` z^h(kp!xW@!uMf3DdbXzZ?scGrAbKZ2?T+w~*d!aOb)Fj80T~;V$RWAkv_qsVQBlTA z;-jh%avW92IxZ^%{C_JcL%39vEu$z7URnc@#ZNlEP_``ix2Y)8U$%_AIAqY;)jcJ$ zXl$uXWf4+;Gbp^aS5k&-KP69}Y#R8SRLIFcn-)B_AbOXO2%`2#cGI;qPSV#@2X$rj z$;QF6TZs&k*O$s5oGitM9r*ca-co7Ox+T}kiBHiV%2oyCD3S3DdHH8#AuJDC404yq z!*xZFvi&`@uC4GMf;?Z4#8!FXH|GKNYsM8MX$(Dug-&N?(Z+EigU1fN7Ax@Z6{T!3Y>nL5eu>46G9-8lM2L*uo%H-{l zE|0t)Ks1k&*iZJ7UV8SZ4l)L%fF${ZWzo5^xR!lJm@X~9(7uII - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Server URL: - - - - - - - - - Organization ID - - - - - - - - Support Shortcut - - - - - - - - - - - - - - - - - - - - - - diff --git a/Agent.Installer.Win/MainWindow.xaml.cs b/Agent.Installer.Win/MainWindow.xaml.cs deleted file mode 100644 index 9176cd2c..00000000 --- a/Agent.Installer.Win/MainWindow.xaml.cs +++ /dev/null @@ -1,76 +0,0 @@ -using Remotely.Agent.Installer.Win.Utilities; -using Remotely.Agent.Installer.Win.ViewModels; -using System; -using System.Windows; -using System.Windows.Documents; -using System.Windows.Input; - -namespace Remotely.Agent.Installer.Win; - -/// -/// Interaction logic for MainWindow.xaml -/// -public partial class MainWindow : Window -{ - public MainWindow() - { - if (CommandLineParser.CommandLineArgs.ContainsKey("quiet")) - { - Hide(); - ShowInTaskbar = false; - _ = new MainWindowViewModel().Init(); - } - InitializeComponent(); - } - - private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) - { - DragMove(); - } - - private async void Window_Loaded(object sender, RoutedEventArgs e) - { - if (DataContext is MainWindowViewModel viewModel) - { - await viewModel.Init(); - } - } - - private void CloseButton_Click(object sender, RoutedEventArgs e) - { - App.Current.Shutdown(); - } - - private void MinimizeButton_Click(object sender, RoutedEventArgs e) - { - this.WindowState = WindowState.Minimized; - } - - private void ShowServerUrlHelp(object sender, RoutedEventArgs e) - { - MessageBox.Show( - "This is the URL of the Remotely server that you're hosting. The device will connect to this URL.", - "Server URL", - MessageBoxButton.OK, - MessageBoxImage.Information); - } - - private void ShowOrganizationIdHelp(object sender, RoutedEventArgs e) - { - MessageBox.Show( - "This is your organization ID on the Remotely server. Since Remotely supports multi-tenancy, " + - "this ID needs to be provided to determine who should have access." - + Environment.NewLine + Environment.NewLine + - "You can find this ID on the Organization tab on the web app.", - "Organization ID", - MessageBoxButton.OK, - MessageBoxImage.Information); - } - private void ShowSupportShortcutHelp(object sender, RoutedEventArgs e) - { - MessageBox.Show("If selected, the installer will create a desktop shortcut to the Get Support page for this device.", - "Support Shortcut", - MessageBoxButton.OK, - MessageBoxImage.Information); - } -} diff --git a/Agent.Installer.Win/Models/BrandingInfo.cs b/Agent.Installer.Win/Models/BrandingInfo.cs deleted file mode 100644 index 3d9d077f..00000000 --- a/Agent.Installer.Win/Models/BrandingInfo.cs +++ /dev/null @@ -1,10 +0,0 @@ -#nullable enable - -namespace Remotely.Agent.Installer.Win.Models; - -public class BrandingInfo -{ - public string Product { get; set; } = "Remotely"; - - public string? Icon { get; set; } -} diff --git a/Agent.Installer.Win/Models/EmbeddedServerData.cs b/Agent.Installer.Win/Models/EmbeddedServerData.cs deleted file mode 100644 index e1eaaff4..00000000 --- a/Agent.Installer.Win/Models/EmbeddedServerData.cs +++ /dev/null @@ -1,28 +0,0 @@ -#nullable enable -using System; -using System.Runtime.Serialization; - -namespace Remotely.Agent.Installer.Models; - -[DataContract] -public class EmbeddedServerData -{ - /// - /// Parameterless constructor for JsonSerializer. - /// - public EmbeddedServerData() { } - - public EmbeddedServerData(Uri serverUrl, string organizationId) - { - ServerUrl = serverUrl; - OrganizationId = organizationId; - } - - public static EmbeddedServerData Empty { get; } = new EmbeddedServerData(); - - [DataMember] - public string OrganizationId { get; set; } = string.Empty; - - [DataMember] - public Uri? ServerUrl { get; set; } -} diff --git a/Agent.Installer.Win/Properties/AssemblyInfo.cs b/Agent.Installer.Win/Properties/AssemblyInfo.cs deleted file mode 100644 index 08bc29a9..00000000 --- a/Agent.Installer.Win/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; -using System.Windows; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Remotely Installer")] -[assembly: AssemblyDescription("An installer for the Remotely service, which provides unattended remote access and remote scripting.")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Immense Networks")] -[assembly: AssemblyProduct("Remotely Installer")] -[assembly: AssemblyCopyright("Copyright © 2020 Immense Networks")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -//In order to begin building localizable applications, set -//CultureYouAreCodingWith in your .csproj file -//inside a . For example, if you are using US english -//in your source files, set the to en-US. Then uncomment -//the NeutralResourceLanguage attribute below. Update the "en-US" in -//the line below to match the UICulture setting in the project file. - -//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] - - -[assembly: ThemeInfo( - ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located - //(used if a resource is not found in the page, - // or application resource dictionaries) - ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located - //(used if a resource is not found in the page, - // app, or any theme specific resource dictionaries) -)] - - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Agent.Installer.Win/Properties/Resources.Designer.cs b/Agent.Installer.Win/Properties/Resources.Designer.cs deleted file mode 100644 index fb5f7c6e..00000000 --- a/Agent.Installer.Win/Properties/Resources.Designer.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Remotely.Agent.Installer.Win.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Remotely.Agent.Installer.Win.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } -} diff --git a/Agent.Installer.Win/Properties/Resources.resx b/Agent.Installer.Win/Properties/Resources.resx deleted file mode 100644 index af7dbebb..00000000 --- a/Agent.Installer.Win/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/Agent.Installer.Win/Properties/Settings.Designer.cs b/Agent.Installer.Win/Properties/Settings.Designer.cs deleted file mode 100644 index 760c1573..00000000 --- a/Agent.Installer.Win/Properties/Settings.Designer.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Remotely.Agent.Installer.Win.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - } -} diff --git a/Agent.Installer.Win/Properties/Settings.settings b/Agent.Installer.Win/Properties/Settings.settings deleted file mode 100644 index 033d7a5e..00000000 --- a/Agent.Installer.Win/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/Agent.Installer.Win/Services/EmbeddedServerDataReader.cs b/Agent.Installer.Win/Services/EmbeddedServerDataReader.cs deleted file mode 100644 index 42f55db7..00000000 --- a/Agent.Installer.Win/Services/EmbeddedServerDataReader.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; -using System.IO; -using System.Text; -using System.Threading.Tasks; -using System.Web.Script.Serialization; -using Remotely.Agent.Installer.Models; -using Remotely.Agent.Installer.Win.Utilities; - -namespace Remotely.Agent.Installer.Win.Services; - -internal class EmbeddedServerDataReader -{ - private readonly JavaScriptSerializer _serializer = new JavaScriptSerializer(); - - public async Task TryGetEmbeddedData(string filePath) - { - try - { - if (!File.Exists(filePath)) - { - throw new Exception($"File path does not exist: {filePath}"); - } - - using var fs = File.Open(filePath, FileMode.Open, FileAccess.Read, FileShare.Read); - using var br = new BinaryReader(fs); - using var sr = new StreamReader(fs); - - fs.Seek(-4, SeekOrigin.End); - var dataSize = br.ReadInt32(); - fs.Seek(-dataSize - 4, SeekOrigin.End); - - if (dataSize == 0) - { - return EmbeddedServerData.Empty; - } - - var buffer = new byte[dataSize]; - await fs.ReadAsync(buffer, 0, dataSize); - var json = Encoding.UTF8.GetString(buffer); - - Logger.Write($"Extracted embedded data from EXE: {json}"); - - var embeddedData = _serializer.Deserialize(json); - if (embeddedData is not null) - { - return embeddedData; - } - } - catch (Exception ex) - { - Logger.Write(ex); - } - return EmbeddedServerData.Empty; - } -} diff --git a/Agent.Installer.Win/Services/InstallerService.cs b/Agent.Installer.Win/Services/InstallerService.cs deleted file mode 100644 index d05b1936..00000000 --- a/Agent.Installer.Win/Services/InstallerService.cs +++ /dev/null @@ -1,455 +0,0 @@ -#nullable enable -using IWshRuntimeLibrary; -using Microsoft.VisualBasic.FileIO; -using Microsoft.Win32; -using Remotely.Agent.Installer.Win.Utilities; -using Remotely.Shared.Models; -using System; -using System.Configuration.Install; -using System.Diagnostics; -using System.IO; -using System.IO.Compression; -using System.Linq; -using System.Net; -using System.Reflection; -using System.Security.Principal; -using System.ServiceProcess; -using System.Threading.Tasks; -using System.Web.Script.Serialization; -using System.Windows; -using FileIO = System.IO.File; - -namespace Remotely.Agent.Installer.Win.Services; - -public class InstallerService -{ - private readonly string _installPath = Path.Combine(Path.GetPathRoot(Environment.SystemDirectory), "Program Files", "Remotely"); - private readonly string _platform = Environment.Is64BitOperatingSystem ? "x64" : "x86"; - private readonly JavaScriptSerializer _serializer = new JavaScriptSerializer(); - - public event EventHandler? ProgressMessageChanged; - public event EventHandler? ProgressValueChanged; - - public async Task Install(string serverUrl, - string organizationId, - string? deviceGroup, - string? deviceAlias, - string? deviceUuid, - bool createSupportShortcut) - { - try - { - Logger.Write("Install started."); - if (!CheckIsAdministrator()) - { - return false; - } - - StopService(); - - await StopProcesses(); - - BackupDirectory(); - - var connectionInfo = GetConnectionInfo(organizationId, serverUrl, deviceUuid); - - ClearInstallDirectory(); - - await DownloadRemotelyAgent(serverUrl); - - FileIO.WriteAllText(Path.Combine(_installPath, "ConnectionInfo.json"), _serializer.Serialize(connectionInfo)); - - FileIO.Copy(Assembly.GetExecutingAssembly().Location, Path.Combine(_installPath, "Remotely_Installer.exe")); - - await CreateDeviceOnServer(connectionInfo.DeviceID, serverUrl, deviceGroup, deviceAlias, organizationId); - - AddFirewallRule(); - - InstallService(); - - CreateUninstallKey(); - - CreateSupportShortcut(serverUrl, connectionInfo.DeviceID, createSupportShortcut); - - return true; - } - catch (Exception ex) - { - Logger.Write(ex); - RestoreBackup(); - return false; - } - - } - - public async Task Uninstall() - { - try - { - if (!CheckIsAdministrator()) - { - return false; - } - - StopService(); - - ProcessEx.StartHidden("cmd.exe", "/c sc delete Remotely_Service").WaitForExit(); - - await StopProcesses(); - - ProgressMessageChanged?.Invoke(this, "Deleting files."); - ClearInstallDirectory(); - ProcessEx.StartHidden("cmd.exe", $"/c timeout 5 & rd /s /q \"{_installPath}\""); - - ProcessEx.StartHidden("netsh", "advfirewall firewall delete rule name=\"Remotely Desktop Unattended\"").WaitForExit(); - - GetRegistryBaseKey().DeleteSubKeyTree(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Remotely", false); - - return true; - } - catch (Exception ex) - { - Logger.Write(ex); - return false; - } - } - - private void AddFirewallRule() - { - var desktopExePath = Path.Combine(_installPath, "Desktop", "Remotely_Desktop.exe"); - ProcessEx.StartHidden("netsh", "advfirewall firewall delete rule name=\"Remotely Desktop Unattended\"").WaitForExit(); - ProcessEx.StartHidden("netsh", $"advfirewall firewall add rule name=\"Remotely Desktop Unattended\" program=\"{desktopExePath}\" protocol=any dir=in enable=yes action=allow description=\"The agent that allows screen sharing and remote control for Remotely.\"").WaitForExit(); - } - - private void BackupDirectory() - { - if (Directory.Exists(_installPath)) - { - Logger.Write("Backing up current installation."); - ProgressMessageChanged?.Invoke(this, "Backing up current installation."); - var backupPath = Path.Combine(Path.GetTempPath(), "Remotely_Backup.zip"); - if (FileIO.Exists(backupPath)) - { - FileIO.Delete(backupPath); - } - ZipFile.CreateFromDirectory(_installPath, backupPath, CompressionLevel.Fastest, false); - } - } - - private bool CheckIsAdministrator() - { - var identity = WindowsIdentity.GetCurrent(); - var principal = new WindowsPrincipal(identity); - var result = principal.IsInRole(WindowsBuiltInRole.Administrator); - if (!result) - { - MessageBoxEx.Show("Elevated privileges are required. Please restart the installer using 'Run as administrator'.", "Elevation Required", MessageBoxButton.OK, MessageBoxImage.Warning); - } - return result; - } - - private void ClearInstallDirectory() - { - if (Directory.Exists(_installPath)) - { - foreach (var entry in Directory.GetFileSystemEntries(_installPath)) - { - try - { - if (FileIO.Exists(entry)) - { - FileIO.Delete(entry); - } - else if (Directory.Exists(entry)) - { - Directory.Delete(entry, true); - } - } - catch (Exception ex) - { - Logger.Write(ex); - } - } - } - } - - private async Task CreateDeviceOnServer(string deviceUuid, - string serverUrl, - string? deviceGroup, - string? deviceAlias, - string organizationId) - { - try - { - if (!string.IsNullOrWhiteSpace(deviceGroup) || - !string.IsNullOrWhiteSpace(deviceAlias)) - { - var setupOptions = new DeviceSetupOptions() - { - DeviceID = deviceUuid, - DeviceGroupName = deviceGroup, - DeviceAlias = deviceAlias, - OrganizationID = organizationId - }; - - var wr = WebRequest.CreateHttp(serverUrl.TrimEnd('/') + "/api/devices"); - wr.Method = "POST"; - wr.ContentType = "application/json"; - using (var rs = await wr.GetRequestStreamAsync()) - using (var sw = new StreamWriter(rs)) - { - await sw.WriteAsync(_serializer.Serialize(setupOptions)); - } - using var response = await wr.GetResponseAsync(); - if (response is HttpWebResponse httpResponse) - { - Logger.Write($"Create device response: {httpResponse.StatusCode}"); - } - } - } - catch (WebException ex) when ((ex.Response is HttpWebResponse response) && response.StatusCode == HttpStatusCode.BadRequest) - { - Logger.Write("Bad request when creating device. The device ID may already be created."); - } - catch (Exception ex) - { - Logger.Write(ex); - } - - } - - private void CreateSupportShortcut(string serverUrl, string deviceUuid, bool createSupportShortcut) - { - var shell = new WshShell(); - var shortcutLocation = Path.Combine(_installPath, "Get Support.lnk"); - var shortcut = (IWshShortcut)shell.CreateShortcut(shortcutLocation); - shortcut.Description = "Get IT support"; - shortcut.IconLocation = Path.Combine(_installPath, "Remotely_Agent.exe"); - shortcut.TargetPath = serverUrl.TrimEnd('/') + $"/get-support?deviceID={deviceUuid}"; - shortcut.Save(); - - if (createSupportShortcut) - { - var systemRoot = Path.GetPathRoot(Environment.SystemDirectory); - var publicDesktop = Path.Combine(systemRoot, "Users", "Public", "Desktop", "Get Support.lnk"); - FileIO.Copy(shortcutLocation, publicDesktop, true); - } - } - private void CreateUninstallKey() - { - var version = FileVersionInfo.GetVersionInfo(Path.Combine(_installPath, "Remotely_Agent.exe")); - var baseKey = GetRegistryBaseKey(); - - var remotelyKey = baseKey.CreateSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Remotely", true); - remotelyKey.SetValue("DisplayIcon", Path.Combine(_installPath, "Remotely_Agent.exe")); - remotelyKey.SetValue("DisplayName", "Remotely"); - remotelyKey.SetValue("DisplayVersion", version.FileVersion); - remotelyKey.SetValue("InstallDate", DateTime.Now.ToShortDateString()); - remotelyKey.SetValue("Publisher", "Immense Networks"); - remotelyKey.SetValue("VersionMajor", version.FileMajorPart.ToString(), RegistryValueKind.DWord); - remotelyKey.SetValue("VersionMinor", version.FileMinorPart.ToString(), RegistryValueKind.DWord); - remotelyKey.SetValue("UninstallString", Path.Combine(_installPath, "Remotely_Installer.exe -uninstall -quiet")); - remotelyKey.SetValue("QuietUninstallString", Path.Combine(_installPath, "Remotely_Installer.exe -uninstall -quiet")); - } - - private async Task DownloadRemotelyAgent(string serverUrl) - { - var targetFile = Path.Combine(Path.GetTempPath(), $"Remotely-Agent.zip"); - - if (CommandLineParser.CommandLineArgs.TryGetValue("path", out var result) && - FileIO.Exists(result)) - { - targetFile = result; - } - else - { - ProgressMessageChanged?.Invoke(this, "Downloading Remotely agent."); - using (var client = new WebClient()) - { - client.DownloadProgressChanged += (sender, args) => - { - ProgressValueChanged?.Invoke(this, args.ProgressPercentage); - }; - - await client.DownloadFileTaskAsync($"{serverUrl}/Content/Remotely-Win-{_platform}.zip", targetFile); - } - } - - ProgressMessageChanged?.Invoke(this, "Extracting Remotely files."); - ProgressValueChanged?.Invoke(this, 0); - - var tempDir = Path.Combine(Path.GetTempPath(), "RemotelyUpdate"); - if (Directory.Exists(tempDir)) - { - Directory.Delete(tempDir, true); - } - - Directory.CreateDirectory(_installPath); - while (!Directory.Exists(_installPath)) - { - await Task.Delay(10); - } - - var wr = WebRequest.CreateHttp($"{serverUrl}/Content/Remotely-Win-{_platform}.zip"); - wr.Method = "Head"; - using (var response = (HttpWebResponse)await wr.GetResponseAsync()) - { - FileIO.WriteAllText(Path.Combine(_installPath, "etag.txt"), response.Headers["ETag"]); - } - - ZipFile.ExtractToDirectory(targetFile, tempDir); - var fileSystemEntries = Directory.GetFileSystemEntries(tempDir); - for (var i = 0; i < fileSystemEntries.Length; i++) - { - try - { - ProgressValueChanged?.Invoke(this, (int)((double)i / (double)fileSystemEntries.Length * 100d)); - var entry = fileSystemEntries[i]; - if (FileIO.Exists(entry)) - { - FileIO.Copy(entry, Path.Combine(_installPath, Path.GetFileName(entry)), true); - } - else if (Directory.Exists(entry)) - { - FileSystem.CopyDirectory(entry, Path.Combine(_installPath, new DirectoryInfo(entry).Name), true); - } - await Task.Delay(1); - } - catch (Exception ex) - { - Logger.Write(ex); - } - } - ProgressValueChanged?.Invoke(this, 0); - } - - private ConnectionInfo GetConnectionInfo(string organizationId, string serverUrl, string? deviceUuid) - { - ConnectionInfo connectionInfo; - var connectionInfoPath = Path.Combine(_installPath, "ConnectionInfo.json"); - if (FileIO.Exists(connectionInfoPath)) - { - connectionInfo = _serializer.Deserialize(FileIO.ReadAllText(connectionInfoPath)); - connectionInfo.ServerVerificationToken = null; - } - else - { - connectionInfo = new ConnectionInfo() - { - DeviceID = Guid.NewGuid().ToString() - }; - } - - if (!string.IsNullOrWhiteSpace(deviceUuid)) - { - // Clear the server verification token if we're installing this as a new device. - if (connectionInfo.DeviceID != deviceUuid) - { - connectionInfo.ServerVerificationToken = null; - } - connectionInfo.DeviceID = deviceUuid!; - } - connectionInfo.OrganizationID = organizationId; - connectionInfo.Host = serverUrl; - return connectionInfo; - } - - private RegistryKey GetRegistryBaseKey() - { - if (Environment.Is64BitOperatingSystem) - { - return RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64); - } - else - { - return RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32); - } - } - - private void InstallService() - { - Logger.Write("Installing service."); - ProgressMessageChanged?.Invoke(this, "Installing Remotely service."); - var serv = ServiceController.GetServices().FirstOrDefault(ser => ser.ServiceName == "Remotely_Service"); - if (serv == null) - { - var command = new string[] { "/assemblypath=" + Path.Combine(_installPath, "Remotely_Agent.exe") }; - var context = new InstallContext("", command); - var serviceInstaller = new ServiceInstaller() - { - Context = context, - DisplayName = "Remotely Service", - Description = "Background service that maintains a connection to the Remotely server. The service is used for remote support and maintenance by this computer's administrators.", - ServiceName = "Remotely_Service", - StartType = ServiceStartMode.Automatic, - Parent = new ServiceProcessInstaller() - }; - - var state = new System.Collections.Specialized.ListDictionary(); - serviceInstaller.Install(state); - Logger.Write("Service installed."); - serv = ServiceController.GetServices().FirstOrDefault(ser => ser.ServiceName == "Remotely_Service"); - - ProcessEx.StartHidden("cmd.exe", "/c sc.exe failure \"Remotely_Service\" reset= 5 actions= restart/5000"); - } - if (serv.Status != ServiceControllerStatus.Running) - { - serv.Start(); - } - Logger.Write("Service started."); - } - - private void RestoreBackup() - { - try - { - var backupPath = Path.Combine(Path.GetTempPath(), "Remotely_Backup.zip"); - if (FileIO.Exists(backupPath)) - { - Logger.Write("Restoring backup."); - ClearInstallDirectory(); - ZipFile.ExtractToDirectory(backupPath, _installPath); - var serv = ServiceController.GetServices().FirstOrDefault(ser => ser.ServiceName == "Remotely_Service"); - if (serv?.Status != ServiceControllerStatus.Running) - { - serv?.Start(); - } - } - } - catch (Exception ex) - { - Logger.Write(ex); - } - } - - private async Task StopProcesses() - { - ProgressMessageChanged?.Invoke(this, "Stopping Remotely processes."); - var procs = Process.GetProcessesByName("Remotely_Agent").Concat(Process.GetProcessesByName("Remotely_Desktop")); - - foreach (var proc in procs) - { - proc.Kill(); - } - - await Task.Delay(500); - } - private void StopService() - { - try - { - var remotelyService = ServiceController.GetServices().FirstOrDefault(x => x.ServiceName == "Remotely_Service"); - if (remotelyService != null) - { - Logger.Write("Stopping existing Remotely service."); - ProgressMessageChanged?.Invoke(this, "Stopping existing Remotely service."); - remotelyService.Stop(); - remotelyService.WaitForStatus(ServiceControllerStatus.Stopped); - } - } - catch (Exception ex) - { - Logger.Write(ex); - } - } -} diff --git a/Agent.Installer.Win/Services/RelayCommand.cs b/Agent.Installer.Win/Services/RelayCommand.cs deleted file mode 100644 index 112042d7..00000000 --- a/Agent.Installer.Win/Services/RelayCommand.cs +++ /dev/null @@ -1,39 +0,0 @@ -#nullable enable - -using System; -using System.Windows.Input; - -namespace Remotely.Agent.Installer.Win.Services; - -public class RelayCommand : ICommand -{ - private readonly Action _action; - - private readonly Predicate? _canExecute; - - public RelayCommand(Action action, Predicate? canExecute = null) - { - _action = action; - _canExecute = canExecute; - } - - public event EventHandler CanExecuteChanged - { - add { CommandManager.RequerySuggested += value; } - remove { CommandManager.RequerySuggested -= value; } - } - - public bool CanExecute(object parameter) - { - if (_canExecute is null) - { - return true; - } - return _canExecute.Invoke(parameter); - } - - public void Execute(object parameter) - { - _action?.Invoke(parameter); - } -} diff --git a/Agent.Installer.Win/Utilities/CommandLineParser.cs b/Agent.Installer.Win/Utilities/CommandLineParser.cs deleted file mode 100644 index a24e994d..00000000 --- a/Agent.Installer.Win/Utilities/CommandLineParser.cs +++ /dev/null @@ -1,78 +0,0 @@ -#nullable enable -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Windows; - -namespace Remotely.Agent.Installer.Win.Utilities; - -public class CommandLineParser -{ - private static Dictionary? commandLineArgs; - - private static bool _invalidArgumentFound; - - public static Dictionary CommandLineArgs - { - get - { - if (commandLineArgs is null) - { - commandLineArgs = new Dictionary(); - - var args = Environment.GetCommandLineArgs(); - - for (var i = 1; i < args.Length; i += 2) - { - try - { - var key = args[i]; - if (key != null) - { - if (!key.Contains("-")) - { - _invalidArgumentFound = true; - i -= 1; - continue; - } - key = key.Trim().Replace("-", "").ToLower(); - if (i + 1 == args.Length) - { - commandLineArgs.Add(key, "true"); - continue; - } - var value = args[i + 1]; - if (value != null) - { - if (value.StartsWith("-")) - { - commandLineArgs.Add(key, "true"); - i -= 1; - } - else - { - commandLineArgs.Add(key, args[i + 1].Trim()); - } - } - } - } - catch (Exception ex) - { - Logger.Write(ex); - } - - } - } - return commandLineArgs; - } - } - - internal static void VerifyArguments() - { - if (_invalidArgumentFound) - { - Logger.Write("Command line arguments are invalid."); - MessageBoxEx.Show("Command line arguments are invalid.", "Invalid Arguments", MessageBoxButton.OK, MessageBoxImage.Error); - } - } -} diff --git a/Agent.Installer.Win/Utilities/Logger.cs b/Agent.Installer.Win/Utilities/Logger.cs deleted file mode 100644 index e5320dd1..00000000 --- a/Agent.Installer.Win/Utilities/Logger.cs +++ /dev/null @@ -1,82 +0,0 @@ -using System; -using System.IO; -using System.Linq; - -namespace Remotely.Agent.Installer.Win.Utilities; - -public class Logger -{ - public static string LogsDir { get; } = Directory.CreateDirectory(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "Remotely", "Logs")).FullName; - public static string LogsPath { get; } = Path.Combine(LogsDir, "Installer.log"); - - private static readonly object _writeLock = new object(); - - public static void Debug(string message) - { - lock (_writeLock) - { -#if DEBUG - CheckLogFileExists(); - - File.AppendAllText(LogsPath, $"{DateTimeOffset.Now:yyyy-MM-dd HH:mm:ss.fff}\t[Debug]\t{message}{Environment.NewLine}"); - -#endif - System.Diagnostics.Debug.WriteLine(message); - } - - } - - public static void Write(string message) - { - try - { - lock (_writeLock) - { - CheckLogFileExists(); - File.AppendAllText(LogsPath, $"{DateTimeOffset.Now:yyyy-MM-dd HH:mm:ss.fff}\t[Info]\t{message}{Environment.NewLine}"); - Console.WriteLine(message); - } - } - catch { } - } - - public static void Write(Exception ex) - { - lock (_writeLock) - { - try - { - CheckLogFileExists(); - - var exception = ex; - - while (exception != null) - { - File.AppendAllText(LogsPath, $"{DateTimeOffset.Now:yyyy-MM-dd HH:mm:ss.fff}\t[Error]\t{exception.Message}\t{exception.StackTrace}\t{exception.Source}{Environment.NewLine}"); - Console.WriteLine(exception.Message); - exception = exception.InnerException; - } - } - catch { } - } - } - - private static void CheckLogFileExists() - { - if (!File.Exists(LogsPath)) - { - File.Create(LogsPath).Close(); - } - - if (File.Exists(LogsPath)) - { - var fi = new FileInfo(LogsPath); - while (fi.Length > 1000000) - { - var content = File.ReadAllLines(LogsPath); - File.WriteAllLines(LogsPath, content.Skip(10)); - fi = new FileInfo(LogsPath); - } - } - } -} diff --git a/Agent.Installer.Win/Utilities/MessageBoxEx.cs b/Agent.Installer.Win/Utilities/MessageBoxEx.cs deleted file mode 100644 index 65ff2e8a..00000000 --- a/Agent.Installer.Win/Utilities/MessageBoxEx.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Windows; - -namespace Remotely.Agent.Installer.Win.Utilities; - -public static class MessageBoxEx -{ - public static MessageBoxResult Show(string message, string caption, MessageBoxButton messageBoxButton, MessageBoxImage messageBoxImage) - { - if (!CommandLineParser.CommandLineArgs.ContainsKey("quiet")) - { - return MessageBox.Show(message, caption, messageBoxButton, messageBoxImage); - } - return MessageBoxResult.None; - } -} diff --git a/Agent.Installer.Win/Utilities/ProcessEx.cs b/Agent.Installer.Win/Utilities/ProcessEx.cs deleted file mode 100644 index 6515dfb6..00000000 --- a/Agent.Installer.Win/Utilities/ProcessEx.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Diagnostics; - -namespace Remotely.Agent.Installer.Win.Utilities; - -public static class ProcessEx -{ - public static Process StartHidden(string filePath, string arguments) - { - var psi = new ProcessStartInfo() - { - WindowStyle = ProcessWindowStyle.Hidden, - CreateNoWindow = true, - Arguments = arguments, - FileName = filePath - }; - return Process.Start(psi); - } -} diff --git a/Agent.Installer.Win/ViewModels/MainWindowViewModel.cs b/Agent.Installer.Win/ViewModels/MainWindowViewModel.cs deleted file mode 100644 index 86b4c1b8..00000000 --- a/Agent.Installer.Win/ViewModels/MainWindowViewModel.cs +++ /dev/null @@ -1,512 +0,0 @@ -#nullable enable -using Remotely.Agent.Installer.Win.Models; -using Remotely.Agent.Installer.Win.Services; -using Remotely.Agent.Installer.Win.Utilities; -using Remotely.Shared.Models; -using System; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Net.Http; -using System.Reflection; -using System.Security.Principal; -using System.ServiceProcess; -using System.Threading.Tasks; -using System.Web.Script.Serialization; -using System.Windows; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Net; -using Remotely.Shared; -using Remotely.Agent.Installer.Models; - -namespace Remotely.Agent.Installer.Win.ViewModels; - -public class MainWindowViewModel : ViewModelBase -{ - private readonly EmbeddedServerDataReader _embeddedDataReader; - private readonly InstallerService _installer; - private BrandingInfo? _brandingInfo; - private bool _createSupportShortcut; - private string _headerMessage = "Install the service."; - private bool _isReadyState = true; - private bool _isServiceInstalled; - - private string? _organizationID; - - private int _progress; - - private string _serverUrl = string.Empty; - - private string? _statusMessage; - - public MainWindowViewModel() - { - _installer = new InstallerService(); - _embeddedDataReader = new EmbeddedServerDataReader(); - - CopyCommandLineArgs(); - - ExtractEmbeddedServerData().Wait(); - - AddExistingConnectionInfo(); - } - - public bool CreateSupportShortcut - { - get - { - return _createSupportShortcut; - } - set - { - _createSupportShortcut = value; - FirePropertyChanged(); - } - } - - public string HeaderMessage - { - get - { - return _headerMessage; - } - set - { - _headerMessage = value; - FirePropertyChanged(); - } - } - - public BitmapImage? Icon { get; set; } - public string InstallButtonText => IsServiceMissing ? "Install" : "Reinstall"; - - public ICommand InstallCommand => new RelayCommand(async (param) => { await Install(); }); - - public bool IsProgressVisible => Progress > 0; - - public bool IsReadyState - { - get - { - return _isReadyState; - } - set - { - _isReadyState = value; - FirePropertyChanged(); - } - } - - public bool IsServiceInstalled - { - get - { - return _isServiceInstalled; - } - set - { - _isServiceInstalled = value; - FirePropertyChanged(); - FirePropertyChanged(nameof(IsServiceMissing)); - FirePropertyChanged(nameof(InstallButtonText)); - } - } - - public bool IsServiceMissing => !_isServiceInstalled; - - public ICommand OpenLogsCommand - { - get - { - return new RelayCommand(param => - { - - if (Directory.Exists(Logger.LogsDir)) - { - Process.Start(Logger.LogsDir); - } - else - { - MessageBoxEx.Show("Log directory doesn't exist.", "No Logs", MessageBoxButton.OK, MessageBoxImage.Information); - } - }); - } - } - - public string? OrganizationID - { - get - { - return _organizationID; - } - set - { - _organizationID = value; - FirePropertyChanged(); - } - } - - public string ProductName { get; set; } = "Remotely"; - - public int Progress - { - get - { - return _progress; - } - set - { - _progress = value; - FirePropertyChanged(); - FirePropertyChanged(nameof(IsProgressVisible)); - } - } - - public string ServerUrl - { - get - { - return _serverUrl; - } - set - { - _serverUrl = value?.TrimEnd('/') ?? string.Empty; - FirePropertyChanged(); - } - } - - public string? StatusMessage - { - get - { - return _statusMessage; - } - set - { - _statusMessage = value; - FirePropertyChanged(); - } - } - - public ICommand UninstallCommand => new RelayCommand(async (param) => { await Uninstall(); }); - private string? DeviceAlias { get; set; } - private string? DeviceGroup { get; set; } - private string? DeviceUuid { get; set; } - - public async Task Init() - { - _installer.ProgressMessageChanged += (sender, arg) => - { - StatusMessage = arg; - }; - - _installer.ProgressValueChanged += (sender, arg) => - { - Progress = arg; - }; - - IsServiceInstalled = ServiceController.GetServices().Any(x => x.ServiceName == "Remotely_Service"); - if (IsServiceMissing) - { - HeaderMessage = $"Install the {ProductName} service."; - } - else - { - HeaderMessage = $"Modify the {ProductName} installation."; - } - - CommandLineParser.VerifyArguments(); - - if (CommandLineParser.CommandLineArgs.ContainsKey("install")) - { - await Install(); - } - else if (CommandLineParser.CommandLineArgs.ContainsKey("uninstall")) - { - await Uninstall(); - } - - if (CommandLineParser.CommandLineArgs.ContainsKey("quiet")) - { - App.Current.Shutdown(); - } - } - - private void AddExistingConnectionInfo() - { - try - { - var connectionInfoPath = Path.Combine( - Path.GetPathRoot(Environment.SystemDirectory), - "Program Files", - "Remotely", - "ConnectionInfo.json"); - - if (File.Exists(connectionInfoPath)) - { - var serializer = new JavaScriptSerializer(); - var connectionInfo = serializer.Deserialize(File.ReadAllText(connectionInfoPath)); - - if (string.IsNullOrWhiteSpace(OrganizationID)) - { - OrganizationID = connectionInfo.OrganizationID; - } - - if (string.IsNullOrWhiteSpace(ServerUrl)) - { - ServerUrl = connectionInfo.Host ?? string.Empty; - } - } - } - catch (Exception ex) - { - Logger.Write(ex); - } - - } - - private void ApplyBranding(BrandingInfo? brandingInfo) - { - try - { - if (brandingInfo is not null && - !string.IsNullOrWhiteSpace(brandingInfo.Product)) - { - ProductName = brandingInfo.Product; - } - - Icon = GetBitmapImageIcon(brandingInfo); - } - catch (Exception ex) - { - Logger.Write(ex); - } - } - - private bool CheckIsAdministrator() - { - var identity = WindowsIdentity.GetCurrent(); - var principal = new WindowsPrincipal(identity); - var result = principal.IsInRole(WindowsBuiltInRole.Administrator); - if (!result) - { - MessageBoxEx.Show("Elevated privileges are required. Please restart the installer using 'Run as administrator'.", "Elevation Required", MessageBoxButton.OK, MessageBoxImage.Warning); - } - return result; - } - - private bool CheckParams() - { - if (string.IsNullOrWhiteSpace(OrganizationID) || string.IsNullOrWhiteSpace(ServerUrl)) - { - Logger.Write("ServerUrl or OrganizationID param is missing. Unable to install."); - MessageBoxEx.Show("Required settings are missing. Please enter a server URL and organization ID.", "Invalid Input", MessageBoxButton.OK, MessageBoxImage.Error); - return false; - } - - if (!Guid.TryParse(OrganizationID, out _)) - { - Logger.Write("OrganizationID is not a valid GUID."); - MessageBoxEx.Show("Organization ID must be a valid GUID.", "Invalid Organization ID", MessageBoxButton.OK, MessageBoxImage.Error); - return false; - } - - if (!Uri.TryCreate(ServerUrl, UriKind.Absolute, out var serverUri) || - (serverUri.Scheme != Uri.UriSchemeHttp && serverUri.Scheme != Uri.UriSchemeHttps)) - { - Logger.Write("ServerUrl is not valid."); - MessageBoxEx.Show("Server URL must be a valid Uri (e.g. https://app.example.com).", "Invalid Server URL", MessageBoxButton.OK, MessageBoxImage.Error); - return false; - } - - return true; - } - - private void CopyCommandLineArgs() - { - if (CommandLineParser.CommandLineArgs.TryGetValue("organizationid", out var orgID)) - { - OrganizationID = orgID; - } - - if (CommandLineParser.CommandLineArgs.TryGetValue("serverurl", out var serverUrl)) - { - ServerUrl = serverUrl; - } - - if (CommandLineParser.CommandLineArgs.TryGetValue("devicegroup", out var deviceGroup)) - { - DeviceGroup = deviceGroup; - } - - if (CommandLineParser.CommandLineArgs.TryGetValue("devicealias", out var deviceAlias)) - { - DeviceAlias = deviceAlias; - } - - if (CommandLineParser.CommandLineArgs.TryGetValue("deviceuuid", out var deviceUuid)) - { - DeviceUuid = deviceUuid; - } - - if (CommandLineParser.CommandLineArgs.ContainsKey("supportshortcut")) - { - CreateSupportShortcut = true; - } - } - - private async Task ExtractEmbeddedServerData() - { - - try - { - var filePath = Process.GetCurrentProcess()?.MainModule?.FileName; - - if (string.IsNullOrWhiteSpace(filePath)) - { - Logger.Write("Failed to retrieve executing file name."); - return; - } - - var embeddedData = await _embeddedDataReader.TryGetEmbeddedData(filePath!); - - if (embeddedData is null || embeddedData == EmbeddedServerData.Empty) - { - Logger.Write("Embedded server data is empty. Aborting."); - return; - } - - if (embeddedData.ServerUrl is null) - { - Logger.Write("ServerUrl is empty. Aborting."); - return; - } - - OrganizationID = embeddedData.OrganizationId; - ServerUrl = embeddedData.ServerUrl.AbsoluteUri; - - using (var httpClient = new HttpClient()) - { - var serializer = new JavaScriptSerializer(); - var brandingUrl = $"{ServerUrl.TrimEnd('/')}/api/branding/{OrganizationID}"; - using (var response = await httpClient.GetAsync(brandingUrl).ConfigureAwait(false)) - { - var responseString = await response.Content.ReadAsStringAsync(); - _brandingInfo = serializer.Deserialize(responseString); - - } - } - } - catch (Exception ex) - { - Logger.Write(ex); - } - finally - { - ApplyBranding(_brandingInfo); - } - } - private BitmapImage GetBitmapImageIcon(BrandingInfo? bi) - { - Stream imageStream; - if (bi is not null && - !string.IsNullOrWhiteSpace(bi.Icon)) - { - imageStream = new MemoryStream(Convert.FromBase64String(bi.Icon)); - } - else - { - imageStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Remotely.Agent.Installer.Win.Assets.Remotely_Icon.png"); - } - - var bitmap = new BitmapImage(); - bitmap.BeginInit(); - bitmap.StreamSource = imageStream; - bitmap.CacheOption = BitmapCacheOption.OnLoad; - bitmap.EndInit(); - bitmap.Freeze(); - imageStream.Close(); - - return bitmap; - } - private async Task Install() - { - try - { - IsReadyState = false; - if (!CheckParams()) - { - return; - } - - HeaderMessage = "Installing Remotely..."; - - if (await _installer.Install( - ServerUrl, - OrganizationID!, - DeviceGroup, - DeviceAlias, - DeviceUuid, - CreateSupportShortcut)) - { - IsServiceInstalled = true; - Progress = 0; - HeaderMessage = "Installation completed."; - StatusMessage = "Remotely has been installed. You can now close this window."; - } - else - { - Progress = 0; - HeaderMessage = "An error occurred during installation."; - StatusMessage = "There was an error during installation. Check the logs for details."; - } - if (!CheckIsAdministrator()) - { - return; - } - } - catch (Exception ex) - { - Logger.Write(ex); - } - finally - { - IsReadyState = true; - } - } - - private async Task Uninstall() - { - try - { - IsReadyState = false; - - HeaderMessage = "Uninstalling Remotely..."; - - if (await _installer.Uninstall()) - { - IsServiceInstalled = false; - Progress = 0; - HeaderMessage = "Uninstall completed."; - StatusMessage = "Remotely has been uninstalled. You can now close this window."; - } - else - { - Progress = 0; - HeaderMessage = "An error occurred during uninstall."; - StatusMessage = "There was an error during uninstall. Check the logs for details."; - } - - } - catch (Exception ex) - { - Logger.Write(ex); - } - finally - { - IsReadyState = true; - } - } -} diff --git a/Agent.Installer.Win/ViewModels/ViewModelBase.cs b/Agent.Installer.Win/ViewModels/ViewModelBase.cs deleted file mode 100644 index 15fecde7..00000000 --- a/Agent.Installer.Win/ViewModels/ViewModelBase.cs +++ /dev/null @@ -1,16 +0,0 @@ -#nullable enable - -using System.ComponentModel; -using System.Runtime.CompilerServices; - -namespace Remotely.Agent.Installer.Win.ViewModels; - -public class ViewModelBase : INotifyPropertyChanged -{ - public event PropertyChangedEventHandler? PropertyChanged; - - public void FirePropertyChanged([CallerMemberName]string propertyName = "") - { - PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); - } -} diff --git a/Agent.Installer.Win/app.manifest b/Agent.Installer.Win/app.manifest deleted file mode 100644 index 78e2df3c..00000000 --- a/Agent.Installer.Win/app.manifest +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Remotely.sln b/Remotely.sln index b57397f7..872e1565 100644 --- a/Remotely.sln +++ b/Remotely.sln @@ -31,8 +31,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Desktop.Linux", "Desktop.Li EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Desktop.Win", "Desktop.Win\Desktop.Win.csproj", "{6B726FC4-A907-4813-BF38-3342E02AA8D2}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Agent.Installer.Win", "Agent.Installer.Win\Agent.Installer.Win.csproj", "{A3D0368C-0850-4614-B5B5-41B9D5135AA9}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Server.Tests", "Tests\Server.Tests\Server.Tests.csproj", "{48D9D0E6-5781-44A9-84C0-56F56C2A1193}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LoadTester", "Tests\LoadTester\LoadTester.csproj", "{6C25240C-613D-4A86-A04E-784BA6726094}" @@ -122,18 +120,6 @@ Global {6B726FC4-A907-4813-BF38-3342E02AA8D2}.Release|x64.Build.0 = Release|x64 {6B726FC4-A907-4813-BF38-3342E02AA8D2}.Release|x86.ActiveCfg = Release|x86 {6B726FC4-A907-4813-BF38-3342E02AA8D2}.Release|x86.Build.0 = Release|x86 - {A3D0368C-0850-4614-B5B5-41B9D5135AA9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A3D0368C-0850-4614-B5B5-41B9D5135AA9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A3D0368C-0850-4614-B5B5-41B9D5135AA9}.Debug|x64.ActiveCfg = Debug|Any CPU - {A3D0368C-0850-4614-B5B5-41B9D5135AA9}.Debug|x64.Build.0 = Debug|Any CPU - {A3D0368C-0850-4614-B5B5-41B9D5135AA9}.Debug|x86.ActiveCfg = Debug|Any CPU - {A3D0368C-0850-4614-B5B5-41B9D5135AA9}.Debug|x86.Build.0 = Debug|Any CPU - {A3D0368C-0850-4614-B5B5-41B9D5135AA9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A3D0368C-0850-4614-B5B5-41B9D5135AA9}.Release|Any CPU.Build.0 = Release|Any CPU - {A3D0368C-0850-4614-B5B5-41B9D5135AA9}.Release|x64.ActiveCfg = Release|Any CPU - {A3D0368C-0850-4614-B5B5-41B9D5135AA9}.Release|x64.Build.0 = Release|Any CPU - {A3D0368C-0850-4614-B5B5-41B9D5135AA9}.Release|x86.ActiveCfg = Release|Any CPU - {A3D0368C-0850-4614-B5B5-41B9D5135AA9}.Release|x86.Build.0 = Release|Any CPU {48D9D0E6-5781-44A9-84C0-56F56C2A1193}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {48D9D0E6-5781-44A9-84C0-56F56C2A1193}.Debug|Any CPU.Build.0 = Debug|Any CPU {48D9D0E6-5781-44A9-84C0-56F56C2A1193}.Debug|x64.ActiveCfg = Debug|x64