diff --git a/Directory.Build.props b/Directory.Build.props index 1d9e59c..18d3a42 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -41,7 +41,7 @@ - + diff --git a/src/Atc.Installer.Integration.WindowsApplication/GlobalUsings.cs b/src/Atc.Installer.Integration.WindowsApplication/GlobalUsings.cs index d7b7962..860cdb3 100644 --- a/src/Atc.Installer.Integration.WindowsApplication/GlobalUsings.cs +++ b/src/Atc.Installer.Integration.WindowsApplication/GlobalUsings.cs @@ -2,4 +2,6 @@ global using System.Diagnostics.CodeAnalysis; global using System.Runtime.CompilerServices; global using System.Runtime.Versioning; -global using System.ServiceProcess; \ No newline at end of file +global using System.ServiceProcess; + +global using Atc.Helpers; \ No newline at end of file diff --git a/src/Atc.Installer.Integration.WindowsApplication/IWindowsApplicationInstallerService.cs b/src/Atc.Installer.Integration.WindowsApplication/IWindowsApplicationInstallerService.cs index 364602c..73ffc71 100644 --- a/src/Atc.Installer.Integration.WindowsApplication/IWindowsApplicationInstallerService.cs +++ b/src/Atc.Installer.Integration.WindowsApplication/IWindowsApplicationInstallerService.cs @@ -30,10 +30,6 @@ bool StopApplication( FileInfo applicationFile, ushort timeoutInSeconds = 60); - bool StartApplication( - string applicationName, - ushort timeoutInSeconds = 60); - bool StartApplication( FileInfo applicationFile, ushort timeoutInSeconds = 60); diff --git a/src/Atc.Installer.Integration.WindowsApplication/WindowsApplicationInstallerService.cs b/src/Atc.Installer.Integration.WindowsApplication/WindowsApplicationInstallerService.cs index 3e4c1ab..cc15a4a 100644 --- a/src/Atc.Installer.Integration.WindowsApplication/WindowsApplicationInstallerService.cs +++ b/src/Atc.Installer.Integration.WindowsApplication/WindowsApplicationInstallerService.cs @@ -60,8 +60,8 @@ public async Task StopService( try { var services = ServiceController.GetServices(); - var service = - services.FirstOrDefault(x => x.ServiceName.Equals(serviceName, StringComparison.OrdinalIgnoreCase)); + var service = services.FirstOrDefault(x => x.ServiceName.Equals(serviceName, StringComparison.OrdinalIgnoreCase)); + if (service is null || service.Status != ServiceControllerStatus.Running) { @@ -93,8 +93,8 @@ public async Task StartService( try { var services = ServiceController.GetServices(); - var service = - services.FirstOrDefault(x => x.ServiceName.Equals(serviceName, StringComparison.OrdinalIgnoreCase)); + var service = services.FirstOrDefault(x => x.ServiceName.Equals(serviceName, StringComparison.OrdinalIgnoreCase)); + if (service is null || service.Status != ServiceControllerStatus.Stopped) { @@ -195,23 +195,6 @@ public bool StopApplication( return StopApplication(applicationName, timeoutInSeconds); } - public bool StartApplication( - string applicationName, - ushort timeoutInSeconds = 60) - { - ArgumentException.ThrowIfNullOrEmpty(applicationName); - - try - { - Process.Start(applicationName); - return true; - } - catch - { - return false; - } - } - public bool StartApplication( FileInfo applicationFile, ushort timeoutInSeconds = 60) @@ -220,7 +203,7 @@ public bool StartApplication( try { - Process.Start(applicationFile.FullName); + ProcessHelper.Execute(applicationFile.Directory!, applicationFile, string.Empty); return true; } catch diff --git a/src/Atc.Installer.Wpf.App/AssemblyInfo.cs b/src/Atc.Installer.Wpf.App/AssemblyInfo.cs index 58864ed..b90c6a0 100644 --- a/src/Atc.Installer.Wpf.App/AssemblyInfo.cs +++ b/src/Atc.Installer.Wpf.App/AssemblyInfo.cs @@ -5,9 +5,9 @@ [assembly: AssemblyCompany("atc-net")] [assembly: AssemblyProduct("Atc.Installer")] [assembly: AssemblyTitle("Atc.Installer")] -[assembly: AssemblyVersion("1.0.12.0")] -[assembly: AssemblyInformationalVersion("1.0.12.0")] -[assembly: AssemblyFileVersion("1.0.12.0")] +[assembly: AssemblyVersion("1.0.14.0")] +[assembly: AssemblyInformationalVersion("1.0.14.0")] +[assembly: AssemblyFileVersion("1.0.14.0")] [assembly: System.Resources.NeutralResourcesLanguage("en")] [assembly: System.Runtime.Versioning.TargetPlatform("Windows7.0")] [assembly: System.Runtime.Versioning.SupportedOSPlatform("Windows7.0")] \ No newline at end of file diff --git a/src/Atc.Installer.Wpf.App/Atc.Installer.Wpf.App.csproj b/src/Atc.Installer.Wpf.App/Atc.Installer.Wpf.App.csproj index c27e1a2..7a42784 100644 --- a/src/Atc.Installer.Wpf.App/Atc.Installer.Wpf.App.csproj +++ b/src/Atc.Installer.Wpf.App/Atc.Installer.Wpf.App.csproj @@ -43,17 +43,17 @@ - - - - + + + + - + diff --git a/src/Atc.Installer.Wpf.ComponentProvider.ElasticSearch/Atc.Installer.Wpf.ComponentProvider.ElasticSearch.csproj b/src/Atc.Installer.Wpf.ComponentProvider.ElasticSearch/Atc.Installer.Wpf.ComponentProvider.ElasticSearch.csproj index 7122cae..43cf5ab 100644 --- a/src/Atc.Installer.Wpf.ComponentProvider.ElasticSearch/Atc.Installer.Wpf.ComponentProvider.ElasticSearch.csproj +++ b/src/Atc.Installer.Wpf.ComponentProvider.ElasticSearch/Atc.Installer.Wpf.ComponentProvider.ElasticSearch.csproj @@ -8,10 +8,10 @@ - - - - + + + + diff --git a/src/Atc.Installer.Wpf.ComponentProvider.InternetInformationServer/Atc.Installer.Wpf.ComponentProvider.InternetInformationServer.csproj b/src/Atc.Installer.Wpf.ComponentProvider.InternetInformationServer/Atc.Installer.Wpf.ComponentProvider.InternetInformationServer.csproj index 11b5881..a2af9f4 100644 --- a/src/Atc.Installer.Wpf.ComponentProvider.InternetInformationServer/Atc.Installer.Wpf.ComponentProvider.InternetInformationServer.csproj +++ b/src/Atc.Installer.Wpf.ComponentProvider.InternetInformationServer/Atc.Installer.Wpf.ComponentProvider.InternetInformationServer.csproj @@ -8,10 +8,10 @@ - - - - + + + + diff --git a/src/Atc.Installer.Wpf.ComponentProvider.InternetInformationServer/Controls/X509CertificateView.xaml b/src/Atc.Installer.Wpf.ComponentProvider.InternetInformationServer/Controls/X509CertificateView.xaml index afe8689..b531abc 100644 --- a/src/Atc.Installer.Wpf.ComponentProvider.InternetInformationServer/Controls/X509CertificateView.xaml +++ b/src/Atc.Installer.Wpf.ComponentProvider.InternetInformationServer/Controls/X509CertificateView.xaml @@ -106,10 +106,7 @@ IsEnabled="{Binding Path=EnableEditingMode}" Spacing="10">