Skip to content

Commit

Permalink
Update NuGet packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyrrrz committed Nov 21, 2023
1 parent ed6da79 commit 5a5640e
Show file tree
Hide file tree
Showing 10 changed files with 70 additions and 54 deletions.
24 changes: 15 additions & 9 deletions DotnetRuntimeBootstrapper.AppHost.Cli/Bootstrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ 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 @@ -57,9 +59,11 @@ 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 @@ -151,9 +155,11 @@ 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,8 +12,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="CSharpier.MsBuild" Version="0.25.0" PrivateAssets="all" />
<PackageReference Include="PolyShim" Version="1.5.0" PrivateAssets="all" />
<PackageReference Include="CSharpier.MsBuild" Version="0.26.2" PrivateAssets="all" />
<PackageReference Include="PolyShim" Version="1.8.0" PrivateAssets="all" />
<PackageReference Include="QuickJson" Version="1.1.0" PrivateAssets="all" />
</ItemGroup>

Expand Down
22 changes: 12 additions & 10 deletions DotnetRuntimeBootstrapper.AppHost.Core/Dotnet/DotnetInstallation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,18 @@ 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,8 +5,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CSharpier.MsBuild" Version="0.25.0" PrivateAssets="all" />
<PackageReference Include="PolyShim" Version="1.5.0" PrivateAssets="all" />
<PackageReference Include="CSharpier.MsBuild" Version="0.26.2" 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,15 +11,17 @@ 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,8 +13,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="CSharpier.MsBuild" Version="0.25.0" PrivateAssets="all" />
<PackageReference Include="PolyShim" Version="1.5.0" PrivateAssets="all" />
<PackageReference Include="CSharpier.MsBuild" Version="0.26.2" 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.25.0" PrivateAssets="all" />
<PackageReference Include="CSharpier.MsBuild" Version="0.26.2" 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.25.0" PrivateAssets="all" />
<PackageReference Include="CSharpier.MsBuild" Version="0.26.2" PrivateAssets="all" />
</ItemGroup>

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

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

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

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

assembly.Write();

Expand Down
8 changes: 4 additions & 4 deletions DotnetRuntimeBootstrapper/DotnetRuntimeBootstrapper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="CSharpier.MsBuild" Version="0.25.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.Build.Framework" Version="17.6.3" PrivateAssets="all" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="17.6.3" PrivateAssets="all" ExcludeAssets="runtime" />
<PackageReference Include="CSharpier.MsBuild" Version="0.26.2" 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" />
<PackageReference Include="PolyShim" Version="1.5.0" PrivateAssets="all" />
<PackageReference Include="PolyShim" Version="1.8.0" PrivateAssets="all" />
<PackageReference Include="Ressy" Version="1.0.3" PrivateAssets="all" GeneratePathProperty="true" />
</ItemGroup>

Expand Down

0 comments on commit 5a5640e

Please sign in to comment.