Skip to content

Commit

Permalink
Updated dependencies
Browse files Browse the repository at this point in the history
Removed duplicate code
  • Loading branch information
nefarius committed Oct 2, 2024
1 parent a4f2c16 commit 805d30c
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 79 deletions.
3 changes: 2 additions & 1 deletion setup/DsHidMini.Installer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@
<PackageReference Include="CliWrap" Version="3.6.6" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Nefarius.Utilities.WixSharp" Version="1.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
<PackageReference Include="Nefarius.Utilities.DeviceManagement" Version="4.0.0" />
<PackageReference Include="Nefarius.Utilities.DeviceManagement" Version="4.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
24 changes: 2 additions & 22 deletions setup/InstallScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using Nefarius.Utilities.DeviceManagement.Drivers;
using Nefarius.Utilities.DeviceManagement.Exceptions;
using Nefarius.Utilities.DeviceManagement.PnP;
using Nefarius.Utilities.WixSharp.Util;

using Newtonsoft.Json;

Expand Down Expand Up @@ -82,7 +83,7 @@ private static void Main()
new Dir(driversFeature, "nefcon")
{
Files = new DirFiles(driversFeature, "*.*").GetFiles(nefconDir),
Dirs = GetSubDirectories(driversFeature, nefconDir).ToArray()
Dirs = WixExt.GetSubDirectories(driversFeature, nefconDir).ToArray()
},
new Dir(driversFeature, "drivers",
new Files(driversFeature, @"..\artifacts\drivers\*.*"),
Expand Down Expand Up @@ -198,27 +199,6 @@ private static void ProjectOnAfterInstall(SetupEventArgs e)
CustomActions.UninstallDrivers(e.Session);
}
}

/// <summary>
/// Recursively resolves all subdirectories and their containing files.
/// </summary>
private static List<Dir> GetSubDirectories(Feature feature, string directory)
{
List<Dir> subDirectoryInfosCollection = new();

foreach (string subDirectory in Directory.GetDirectories(directory))
{
string subDirectoryName = subDirectory.Remove(0, subDirectory.LastIndexOf('\\') + 1);
Dir newDir =
new(feature, subDirectoryName, new Files(feature, subDirectory + @"\*.*")) { Name = subDirectoryName };
subDirectoryInfosCollection.Add(newDir);

// Recursively traverse nested directories
GetSubDirectories(feature, subDirectory);
}

return subDirectoryInfosCollection;
}
}

public static class CustomActions
Expand Down
31 changes: 0 additions & 31 deletions setup/Util/ArchitectureInfo.cs

This file was deleted.

14 changes: 0 additions & 14 deletions setup/Util/FileSystemHelpers.cs

This file was deleted.

11 changes: 0 additions & 11 deletions setup/Util/StringExtensions.cs

This file was deleted.

0 comments on commit 805d30c

Please sign in to comment.