Skip to content

Commit

Permalink
Update NuGet packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyrrrz committed Dec 27, 2023
1 parent 0e3c3a7 commit 9cfcc97
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 66 deletions.
24 changes: 9 additions & 15 deletions DotnetRuntimeBootstrapper.AppHost.Cli/Bootstrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,9 @@ IPrerequisite[] missingPrerequisites
{
using (ConsoleEx.WithForegroundColor(ConsoleColor.DarkRed))
{
Console
.Error
.WriteLine(
$"Your system is missing runtime components required by {targetAssembly.Name}:"
);
Console.Error.WriteLine(
$"Your system is missing runtime components required by {targetAssembly.Name}:"
);

foreach (var prerequisite in missingPrerequisites)
Console.Error.WriteLine($" - {prerequisite.DisplayName}");
Expand All @@ -50,11 +48,9 @@ IPrerequisite[] missingPrerequisites
// When not running in interactive mode, instruct the user to set the environment variable instead
else
{
Console
.Error
.Write(
"To install the missing components automatically, set the environment variable "
);
Console.Error.Write(
"To install the missing components automatically, set the environment variable "
);

using (ConsoleEx.WithForegroundColor(ConsoleColor.DarkCyan))
Console.Error.Write(AcceptPromptEnvironmentVariable);
Expand Down Expand Up @@ -146,11 +142,9 @@ IPrerequisite[] missingPrerequisites
if (isRebootRequired)
{
using (ConsoleEx.WithForegroundColor(ConsoleColor.DarkYellow))
Console
.Out
.WriteLine(
$"You need to restart Windows before you can run {targetAssembly.Name}."
);
Console.Out.WriteLine(
$"You need to restart Windows before you can run {targetAssembly.Name}."
);

// Only prompt for reboot if running in interactive mode
if (ConsoleEx.IsInteractive)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="CSharpier.MsBuild" Version="0.26.5" PrivateAssets="all" />
<PackageReference Include="CSharpier.MsBuild" Version="0.26.7" PrivateAssets="all" />
<PackageReference Include="PolyShim" Version="1.8.0" PrivateAssets="all" />
<PackageReference Include="QuickJson" Version="1.1.0" PrivateAssets="all" />
</ItemGroup>
Expand Down
3 changes: 1 addition & 2 deletions DotnetRuntimeBootstrapper.AppHost.Core/BootstrapperBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ private void HandleException(Exception exception)
var bootstrapperVersion = Assembly
.GetExecutingAssembly()
.GetName()
.Version
.ToString(3);
.Version.ToString(3);

var content = $"""
Description: Bootstrapper for a .NET application has failed.
Expand Down
22 changes: 10 additions & 12 deletions DotnetRuntimeBootstrapper.AppHost.Core/Dotnet/DotnetInstallation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,16 @@ internal static class DotnetInstallation
{
private static string? TryGetDirectoryPathFromRegistry()
{
var dotnetRegistryKey = Registry
.LocalMachine
.OpenSubKey(
(
OperatingSystemEx.ProcessorArchitecture.Is64Bit()
? "SOFTWARE\\Wow6432Node\\"
: "SOFTWARE\\"
)
+ "dotnet\\Setup\\InstalledVersions\\"
+ OperatingSystemEx.ProcessorArchitecture.GetMoniker(),
false
);
var dotnetRegistryKey = Registry.LocalMachine.OpenSubKey(
(
OperatingSystemEx.ProcessorArchitecture.Is64Bit()
? "SOFTWARE\\Wow6432Node\\"
: "SOFTWARE\\"
)
+ "dotnet\\Setup\\InstalledVersions\\"
+ OperatingSystemEx.ProcessorArchitecture.GetMoniker(),
false
);

var dotnetDirPath = dotnetRegistryKey?.GetValue("InstallLocation", null) as string;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CSharpier.MsBuild" Version="0.26.5" PrivateAssets="all" />
<PackageReference Include="CSharpier.MsBuild" Version="0.26.7" PrivateAssets="all" />
<PackageReference Include="PolyShim" Version="1.8.0" PrivateAssets="all" />
<PackageReference Include="QuickJson" Version="1.1.0" PrivateAssets="all" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,15 @@ internal class VisualCppPrerequisite : IPrerequisite
public string DisplayName => "Visual C++ Redistributable 2015-2019";

public bool IsInstalled() =>
Registry
.LocalMachine
.ContainsSubKey(
(
OperatingSystemEx.ProcessorArchitecture.Is64Bit()
? "SOFTWARE\\Wow6432Node\\"
: "SOFTWARE\\"
)
+ "Microsoft\\VisualStudio\\14.0\\VC\\Runtimes\\"
+ OperatingSystemEx.ProcessorArchitecture.GetMoniker()
);
Registry.LocalMachine.ContainsSubKey(
(
OperatingSystemEx.ProcessorArchitecture.Is64Bit()
? "SOFTWARE\\Wow6432Node\\"
: "SOFTWARE\\"
)
+ "Microsoft\\VisualStudio\\14.0\\VC\\Runtimes\\"
+ OperatingSystemEx.ProcessorArchitecture.GetMoniker()
);

public IPrerequisiteInstaller DownloadInstaller(Action<double>? handleProgress)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="CSharpier.MsBuild" Version="0.26.5" PrivateAssets="all" />
<PackageReference Include="CSharpier.MsBuild" Version="0.26.7" PrivateAssets="all" />
<PackageReference Include="PolyShim" Version="1.8.0" PrivateAssets="all" />
<PackageReference Include="QuickJson" Version="1.1.0" PrivateAssets="all" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CSharpier.MsBuild" Version="0.26.5" PrivateAssets="all" />
<PackageReference Include="CSharpier.MsBuild" Version="0.26.7" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CSharpier.MsBuild" Version="0.26.5" PrivateAssets="all" />
<PackageReference Include="CSharpier.MsBuild" Version="0.26.7" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
Expand Down
34 changes: 14 additions & 20 deletions DotnetRuntimeBootstrapper/BootstrapperTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,28 +72,22 @@ private void InjectConfiguration()
new ReaderParameters { ReadWrite = true }
);

assembly
.MainModule
.Resources
.RemoveAll(
r =>
string.Equals(
r.Name,
"BootstrapperConfiguration",
StringComparison.OrdinalIgnoreCase
)
);

assembly
.MainModule
.Resources
.Add(
new EmbeddedResource(
assembly.MainModule.Resources.RemoveAll(
r =>
string.Equals(
r.Name,
"BootstrapperConfiguration",
ManifestResourceAttributes.Public,
Encoding.UTF8.GetBytes(configuration)
StringComparison.OrdinalIgnoreCase
)
);
);

assembly.MainModule.Resources.Add(
new EmbeddedResource(
"BootstrapperConfiguration",
ManifestResourceAttributes.Public,
Encoding.UTF8.GetBytes(configuration)
)
);

assembly.Write();

Expand Down
2 changes: 1 addition & 1 deletion DotnetRuntimeBootstrapper/DotnetRuntimeBootstrapper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="CSharpier.MsBuild" Version="0.26.5" PrivateAssets="all" />
<PackageReference Include="CSharpier.MsBuild" Version="0.26.7" PrivateAssets="all" />
<PackageReference Include="Microsoft.Build.Framework" Version="17.8.3" PrivateAssets="all" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="17.8.3" PrivateAssets="all" ExcludeAssets="runtime" />
<PackageReference Include="Mono.Cecil" Version="0.11.5" PrivateAssets="all" GeneratePathProperty="true" />
Expand Down

0 comments on commit 9cfcc97

Please sign in to comment.