From 62acc2c5426b1c68a839ae49587b7e8603402f61 Mon Sep 17 00:00:00 2001 From: David Kallesen Date: Mon, 11 Mar 2024 22:39:58 +0100 Subject: [PATCH] feat: Fix Spelling issue for HostingFrameworkType DonNetFramework48 => DotNetFramework48 --- .../Enums/HostingFrameworkType.cs | 2 +- ...rmationServerComponentProviderViewModel.cs | 2 +- ...wsApplicationComponentProviderViewModel.cs | 4 +-- .../ComponentProviderViewModel_LogicBase.cs | 28 +++++++++++++------ ...nCompareVisibilityVisibleValueConverter.cs | 2 +- 5 files changed, 25 insertions(+), 13 deletions(-) diff --git a/src/Atc.Installer.Integration/Enums/HostingFrameworkType.cs b/src/Atc.Installer.Integration/Enums/HostingFrameworkType.cs index 8858b58..fa438c3 100644 --- a/src/Atc.Installer.Integration/Enums/HostingFrameworkType.cs +++ b/src/Atc.Installer.Integration/Enums/HostingFrameworkType.cs @@ -12,7 +12,7 @@ public enum HostingFrameworkType NativeNoSettings, [Description(".NET Framework 4.8")] - DonNetFramework48, + DotNetFramework48, [Description(".NET 7")] DotNet7, diff --git a/src/Atc.Installer.Wpf.ComponentProvider.InternetInformationServer/InternetInformationServerComponentProviderViewModel.cs b/src/Atc.Installer.Wpf.ComponentProvider.InternetInformationServer/InternetInformationServerComponentProviderViewModel.cs index 2e5bc5c..6a06765 100644 --- a/src/Atc.Installer.Wpf.ComponentProvider.InternetInformationServer/InternetInformationServerComponentProviderViewModel.cs +++ b/src/Atc.Installer.Wpf.ComponentProvider.InternetInformationServer/InternetInformationServerComponentProviderViewModel.cs @@ -774,7 +774,7 @@ private void CheckPrerequisitesForHostingFramework() { switch (HostingFramework) { - case HostingFrameworkType.DonNetFramework48: + case HostingFrameworkType.DotNetFramework48: if (iisInstallerService.IsMicrosoftDotNetFramework48()) { AddToInstallationPrerequisites("IsMicrosoftDotNetFramework48", LogCategoryType.Information, "Microsoft .NET Framework 4.8 is installed"); diff --git a/src/Atc.Installer.Wpf.ComponentProvider.WindowsApplication/WindowsApplicationComponentProviderViewModel.cs b/src/Atc.Installer.Wpf.ComponentProvider.WindowsApplication/WindowsApplicationComponentProviderViewModel.cs index 5d2ae17..2932f61 100644 --- a/src/Atc.Installer.Wpf.ComponentProvider.WindowsApplication/WindowsApplicationComponentProviderViewModel.cs +++ b/src/Atc.Installer.Wpf.ComponentProvider.WindowsApplication/WindowsApplicationComponentProviderViewModel.cs @@ -529,10 +529,10 @@ private void CheckPrerequisitesForHostingFramework() case HostingFrameworkType.DotNet8: AddToInstallationPrerequisites("IsMicrosoftDotNet8", LogCategoryType.Warning, "Microsoft .NET 8 is not installed"); break; - case HostingFrameworkType.DonNetFramework48 when waInstallerService.IsMicrosoftDotNetFramework48(): + case HostingFrameworkType.DotNetFramework48 when waInstallerService.IsMicrosoftDotNetFramework48(): AddToInstallationPrerequisites("IsMicrosoftDotNetFramework48", LogCategoryType.Information, "Microsoft .NET Framework 4.8 is installed"); break; - case HostingFrameworkType.DonNetFramework48: + case HostingFrameworkType.DotNetFramework48: AddToInstallationPrerequisites("IsMicrosoftDotNetFramework48", LogCategoryType.Warning, "Microsoft .NET Framework 4.8 is not installed"); break; case HostingFrameworkType.Native: diff --git a/src/Atc.Installer.Wpf.ComponentProvider/ComponentProviderViewModel_LogicBase.cs b/src/Atc.Installer.Wpf.ComponentProvider/ComponentProviderViewModel_LogicBase.cs index 251c545..ec57cd5 100644 --- a/src/Atc.Installer.Wpf.ComponentProvider/ComponentProviderViewModel_LogicBase.cs +++ b/src/Atc.Installer.Wpf.ComponentProvider/ComponentProviderViewModel_LogicBase.cs @@ -3,6 +3,7 @@ // ReSharper disable ReturnTypeCanBeEnumerable.Local // ReSharper disable StringLiteralTypo // ReSharper disable SwitchStatementHandlesSomeKnownEnumValuesWithDefault +// ReSharper disable SwitchStatementMissingSomeEnumCasesNoDefault namespace Atc.Installer.Wpf.ComponentProvider; [SuppressMessage("Design", "MA0048:File name must match type name", Justification = "OK - partial class")] @@ -110,7 +111,7 @@ public void LoadConfigurationFiles() switch (HostingFramework) { - case HostingFrameworkType.DonNetFramework48: + case HostingFrameworkType.DotNetFramework48: { if (InstalledMainFilePath is not null) { @@ -201,10 +202,21 @@ public void PrepareInstallationFiles( UnpackedZipFolderPath = Path.Combine(InstallerTempDirectory.FullName, @$"{ProjectName}\Unpacked\{Name}"); - if (Directory.Exists(UnpackedZipFolderPath) && - Directory.GetFiles(UnpackedZipFolderPath).Length == 0) + if (Directory.Exists(UnpackedZipFolderPath)) { - Directory.Delete(UnpackedZipFolderPath, recursive: true); + var minimumExpectedNumberOfFiles = 1; + if (HostingFramework is + HostingFrameworkType.DotNetFramework48 or + HostingFrameworkType.DotNet7 or + HostingFrameworkType.DotNet8) + { + minimumExpectedNumberOfFiles = 10; + } + + if (Directory.GetFiles(UnpackedZipFolderPath).Length < minimumExpectedNumberOfFiles) + { + Directory.Delete(UnpackedZipFolderPath, recursive: true); + } } if (unpackIfExist || @@ -823,7 +835,7 @@ public async Task GetReportingData() switch (HostingFramework) { - case HostingFrameworkType.DonNetFramework48 or + case HostingFrameworkType.DotNetFramework48 or HostingFrameworkType.DotNet7 or HostingFrameworkType.DotNet8: { @@ -946,7 +958,7 @@ private void ResolveInstalledMainFile( { case { ComponentType: ComponentType.Application, HostingFramework: HostingFrameworkType.DotNet7 }: case { ComponentType: ComponentType.Application, HostingFramework: HostingFrameworkType.DotNet8 }: - case { ComponentType: ComponentType.Application, HostingFramework: HostingFrameworkType.DonNetFramework48 }: + case { ComponentType: ComponentType.Application, HostingFramework: HostingFrameworkType.DotNetFramework48 }: InstalledMainFilePath = new ValueTemplateItemViewModel( Path.Combine(basePath, $"{Name}.exe"), template: instFolderPath, @@ -960,7 +972,7 @@ private void ResolveInstalledMainFile( break; case { ComponentType: ComponentType.InternetInformationService, HostingFramework: HostingFrameworkType.DotNet7 }: case { ComponentType: ComponentType.InternetInformationService, HostingFramework: HostingFrameworkType.DotNet8 }: - case { ComponentType: ComponentType.InternetInformationService, HostingFramework: HostingFrameworkType.DonNetFramework48 }: + case { ComponentType: ComponentType.InternetInformationService, HostingFramework: HostingFrameworkType.DotNetFramework48 }: InstalledMainFilePath = new ValueTemplateItemViewModel( Path.Combine(basePath, $"{Name}.dll"), template: instFolderPath, @@ -974,7 +986,7 @@ private void ResolveInstalledMainFile( break; case { ComponentType: ComponentType.WindowsService, HostingFramework: HostingFrameworkType.DotNet7 }: case { ComponentType: ComponentType.WindowsService, HostingFramework: HostingFrameworkType.DotNet8 }: - case { ComponentType: ComponentType.WindowsService, HostingFramework: HostingFrameworkType.DonNetFramework48 }: + case { ComponentType: ComponentType.WindowsService, HostingFramework: HostingFrameworkType.DotNetFramework48 }: InstalledMainFilePath = new ValueTemplateItemViewModel( Path.Combine(basePath, $"{Name}.exe"), template: instFolderPath, diff --git a/src/Atc.Installer.Wpf.ComponentProvider/ValueConverters/ComponentProviderVersionCompareVisibilityVisibleValueConverter.cs b/src/Atc.Installer.Wpf.ComponentProvider/ValueConverters/ComponentProviderVersionCompareVisibilityVisibleValueConverter.cs index f08a1cc..c86dd38 100644 --- a/src/Atc.Installer.Wpf.ComponentProvider/ValueConverters/ComponentProviderVersionCompareVisibilityVisibleValueConverter.cs +++ b/src/Atc.Installer.Wpf.ComponentProvider/ValueConverters/ComponentProviderVersionCompareVisibilityVisibleValueConverter.cs @@ -21,7 +21,7 @@ public object Convert( } if (vm.HostingFramework is - HostingFrameworkType.DonNetFramework48 or + HostingFrameworkType.DotNetFramework48 or HostingFrameworkType.DotNet7 or HostingFrameworkType.DotNet8) {