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

Feature/maintenance #16

Merged
merged 11 commits into from
Nov 21, 2023
Binary file added Atc.snk
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public interface IInternetInformationServerInstallerService : IInstallerService

bool IsComponentInstalledMicrosoftNetHost7();

bool IsComponentInstalledMicrosoftNetHost8();

bool IsComponentInstalledMicrosoftAspNetCoreModule2();

bool IsComponentInstalledUrlRewriteModule2();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ public bool IsComponentInstalledWebSockets()
public bool IsComponentInstalledMicrosoftNetHost7()
=> iaInstallerService.IsAppInstalledByDisplayName("Microsoft .NET Host - 7.");

public bool IsComponentInstalledMicrosoftNetHost8()
=> iaInstallerService.IsAppInstalledByDisplayName("Microsoft .NET Host - 8.");

public bool IsComponentInstalledMicrosoftAspNetCoreModule2()
{
if (!iaInstallerService.IsAppInstalledByDisplayName("Microsoft ASP.NET Core Module V2"))
Expand Down
10 changes: 10 additions & 0 deletions src/Atc.Installer.Integration/Enums/ComponentType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,19 @@ namespace Atc.Installer.Integration;
public enum ComponentType
{
None,

[Description("Application")]
Application,

[Description("ElasticSearch")]
ElasticSearchServer,

[Description("IIS")]
InternetInformationService,

[Description("PostgreSql")]
PostgreSqlServer,

[Description("NT-Service")]
WindowsService,
}
12 changes: 12 additions & 0 deletions src/Atc.Installer.Integration/Enums/HostingFrameworkType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,22 @@ namespace Atc.Installer.Integration;
public enum HostingFrameworkType
{
None,

[Description("Native")]
Native,

[Description("Native")]
NativeNoSettings,

[Description(".NET Framework 4.8")]
DonNetFramework48,

[Description(".NET 7")]
DotNet7,

[Description(".NET 8")]
DotNet8,

[Description("NodeJS")]
NodeJs,
}
6 changes: 3 additions & 3 deletions src/Atc.Installer.Wpf.App/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
[assembly: AssemblyCompany("atc-net")]
[assembly: AssemblyProduct("Atc.Installer")]
[assembly: AssemblyTitle("Atc.Installer")]
[assembly: AssemblyVersion("1.0.15.0")]
[assembly: AssemblyInformationalVersion("1.0.15.0")]
[assembly: AssemblyFileVersion("1.0.15.0")]
[assembly: AssemblyVersion("1.0.16.0")]
[assembly: AssemblyInformationalVersion("1.0.16.0")]
[assembly: AssemblyFileVersion("1.0.16.0")]
[assembly: System.Resources.NeutralResourcesLanguage("en")]
[assembly: System.Runtime.Versioning.TargetPlatform("Windows7.0")]
[assembly: System.Runtime.Versioning.SupportedOSPlatform("Windows7.0")]
54 changes: 34 additions & 20 deletions src/Atc.Installer.Wpf.App/MainWindowProjectContent.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,21 +81,21 @@
<TextBlock
Grid.Row="0"
Grid.ColumnSpan="5"
Text="All components:" />
Text="Selected components:" />
<Button
Grid.Row="2"
Grid.Column="0"
Command="{Binding Path=ServiceStopAllCommand}"
Command="{Binding Path=ServiceStopSelectedCommand}"
Content="Stop" />
<Button
Grid.Row="2"
Grid.Column="2"
Command="{Binding Path=ServiceDeployAllCommand}"
Command="{Binding Path=ServiceDeploySelectedCommand}"
Content="Deploy" />
<Button
Grid.Row="2"
Grid.Column="4"
Command="{Binding Path=ServiceStartAllCommand}"
Command="{Binding Path=ServiceStartSelectedCommand}"
Content="Start" />
</atc:GridEx>
</Border>
Expand Down Expand Up @@ -149,27 +149,41 @@
Margin="0,20,0,10"
FontSize="26"
Text="{Binding Path=SelectedComponentProvider.Name}" />
<StackPanel Orientation="Horizontal" Visibility="{Binding Path=ComponentProviders, Converter={StaticResource CollectionNullOrEmptyToVisibilityCollapsedValueConverter}}">
<StackPanel Orientation="Horizontal" Visibility="{Binding Path=SelectedComponentProvider.InstalledVersion, Converter={StaticResource StringNullOrEmptyToVisibilityCollapsedValueConverter}}">
<TextBlock FontSize="18" Text="Version" />
<TextBlock
Margin="10,0,0,0"
FontSize="18"
Text="{Binding Path=SelectedComponentProvider.InstalledVersion}" />
<atc:GridEx Columns="Auto,*,Auto,10" Visibility="{Binding Path=ComponentProviders, Converter={StaticResource CollectionNullOrEmptyToVisibilityCollapsedValueConverter}}">
<StackPanel
Grid.Row="0"
Grid.Column="0"
Orientation="Horizontal">
<StackPanel Orientation="Horizontal" Visibility="{Binding Path=SelectedComponentProvider.InstalledVersion, Converter={StaticResource StringNullOrEmptyToVisibilityCollapsedValueConverter}}">
<TextBlock FontSize="18" Text="Version" />
<TextBlock
Margin="10,0,0,0"
FontSize="18"
Text="{Binding Path=SelectedComponentProvider.InstalledVersion}" />
</StackPanel>
<StackPanel Orientation="Horizontal" Visibility="{Binding Path=SelectedComponentProvider, Converter={StaticResource ComponentProviderVersionCompareVisibilityVisibleValueConverter}}">
<TextBlock
Margin="20,0,0,0"
FontSize="18"
Foreground="DarkOrange"
Text="New version available" />
<TextBlock
Margin="10,0,0,0"
FontSize="18"
Foreground="DarkOrange"
Text="{Binding Path=SelectedComponentProvider.InstallationVersion}" />
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal" Visibility="{Binding Path=SelectedComponentProvider, Converter={StaticResource ComponentProviderVersionCompareVisibilityVisibleValueConverter}}">
<TextBlock
Margin="20,0,0,0"
FontSize="18"
Foreground="DarkOrange"
Text="New version available" />
<StackPanel
Grid.Row="0"
Grid.Column="2"
Orientation="Horizontal">
<TextBlock
Margin="10,0,0,0"
FontSize="18"
Foreground="DarkOrange"
Text="{Binding Path=SelectedComponentProvider.InstallationVersion}" />
Text="{Binding Path=SelectedComponentProvider.Description}" />
</StackPanel>
</StackPanel>
</atc:GridEx>
</StackPanel>

<!-- Right-Content-ContentControls -->
Expand Down
40 changes: 20 additions & 20 deletions src/Atc.Installer.Wpf.App/MainWindowViewModel_Commands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,25 +42,25 @@ public IRelayCommand OpenApplicationAboutCommand
=> new RelayCommand(
OpenApplicationAboutCommandHandler);

public IRelayCommandAsync ServiceStopAllCommand
public IRelayCommandAsync ServiceStopSelectedCommand
=> new RelayCommandAsync(
ServiceStopAllCommandHandler,
CanServiceStopAllCommandHandler);
ServiceStopSelectedCommandHandler,
CanServiceStopSelectedCommandHandler);

public IRelayCommandAsync ServiceDeployAllCommand
public IRelayCommandAsync ServiceDeploySelectedCommand
=> new RelayCommandAsync(
ServiceDeployAllCommandHandler,
CanServiceDeployAllCommandHandler);
ServiceDeploySelectedCommandHandler,
CanServiceDeploySelectedCommandHandler);

public IRelayCommandAsync ServiceRemoveAllCommand
public IRelayCommandAsync ServiceRemoveSelectedCommand
=> new RelayCommandAsync(
ServiceRemoveAllCommandHandler,
CanServiceRemoveAllCommandHandler);
ServiceRemoveSelectedCommandHandler,
CanServiceRemoveSelectedCommandHandler);

public IRelayCommandAsync ServiceStartAllCommand
public IRelayCommandAsync ServiceStartSelectedCommand
=> new RelayCommandAsync(
ServiceStartAllCommandHandler,
CanServiceStartAllCommandHandler);
ServiceStartSelectedCommandHandler,
CanServiceStartSelectedCommandHandler);

public new ICommand ApplicationExitCommand
=> new RelayCommand(ApplicationExitCommandHandler);
Expand Down Expand Up @@ -336,10 +336,10 @@ private void OpenApplicationAboutCommandHandler()
aboutBoxDialog.ShowDialog();
}

private bool CanServiceStopAllCommandHandler()
private bool CanServiceStopSelectedCommandHandler()
=> ComponentProviders.Any(x => x.CanServiceStopCommandHandler());

private Task ServiceStopAllCommandHandler()
private Task ServiceStopSelectedCommandHandler()
{
var tasks = new List<Task>();
foreach (var vm in ComponentProviders)
Expand All @@ -353,10 +353,10 @@ private Task ServiceStopAllCommandHandler()
return TaskHelper.WhenAll(tasks);
}

private bool CanServiceDeployAllCommandHandler()
private bool CanServiceDeploySelectedCommandHandler()
=> ComponentProviders.Any(x => x.CanServiceDeployCommandHandler());

private Task ServiceDeployAllCommandHandler()
private Task ServiceDeploySelectedCommandHandler()
{
var tasks = new List<Task>();
foreach (var vm in ComponentProviders)
Expand All @@ -370,10 +370,10 @@ private Task ServiceDeployAllCommandHandler()
return TaskHelper.WhenAll(tasks);
}

private bool CanServiceRemoveAllCommandHandler()
private bool CanServiceRemoveSelectedCommandHandler()
=> ComponentProviders.Any(x => x.CanServiceRemoveCommandHandler());

private Task ServiceRemoveAllCommandHandler()
private Task ServiceRemoveSelectedCommandHandler()
{
var tasks = new List<Task>();
foreach (var vm in ComponentProviders)
Expand All @@ -387,10 +387,10 @@ private Task ServiceRemoveAllCommandHandler()
return TaskHelper.WhenAll(tasks);
}

private bool CanServiceStartAllCommandHandler()
private bool CanServiceStartSelectedCommandHandler()
=> ComponentProviders.Any(x => x.CanServiceStartCommandHandler());

private Task ServiceStartAllCommandHandler()
private Task ServiceStartSelectedCommandHandler()
{
var tasks = new List<Task>();
foreach (var vm in ComponentProviders)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ public string? TestConnectionResult
}
}

public override string Description => ComponentType.GetDescription();

public override void CheckPrerequisites()
{
base.CheckPrerequisites();
Expand Down Expand Up @@ -95,6 +97,7 @@ public override void CheckServiceState()

public override bool CanServiceStopCommandHandler()
=> !DisableInstallationActions &&
!HideMenuItem &&
RunningState == ComponentRunningState.Running;

public override async Task ServiceStopCommandHandler()
Expand Down Expand Up @@ -133,6 +136,7 @@ public override async Task ServiceStopCommandHandler()

public override bool CanServiceStartCommandHandler()
=> DisableInstallationActions &&
!HideMenuItem &&
RunningState == ComponentRunningState.Stopped;

public override async Task ServiceStartCommandHandler()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
global using Atc.Installer.Wpf.ComponentProvider.InternetInformationServer.Factories;
global using Atc.Installer.Wpf.ComponentProvider.InternetInformationServer.Helpers;
global using Atc.Installer.Wpf.ComponentProvider.Messages;
global using Atc.Installer.Wpf.ComponentProvider.Models;
global using Atc.Installer.Wpf.ComponentProvider.ViewModels;
global using Atc.Serialization;
global using Atc.Wpf.Collections;
Expand Down
Loading
Loading