Skip to content

Commit

Permalink
Add proper path resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed Sep 11, 2024
1 parent 12c88d2 commit 721c06a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Builders/WindowsBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System;
using System.IO;
using System.Linq;
using osu.Desktop.Deploy.Uploaders;

namespace osu.Desktop.Deploy.Builders
Expand Down Expand Up @@ -30,10 +31,15 @@ public override Uploader CreateUploader()

if (!string.IsNullOrEmpty(Program.WindowsCodeSigningMetadataPath))
{
// TODO: resolve from .nuget (or just include locally...)
string dlibPath = "Azure.CodeSigning.Dlib.dll";
string path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".nuget", "packages", "microsoft.trusted.signing.client");
const string dll_name = "Azure.CodeSigning.Dlib.dll";

extraArgs += $" --signParams=\"/td sha256 /fd sha256 /dlib {dlibPath} /dmdf {Program.WindowsCodeSigningMetadataPath} /tr http://timestamp.acs.microsoft.com\"";
string? dllPath = Directory.GetFiles(path, dll_name, SearchOption.AllDirectories).LastOrDefault();

if (dllPath == null)
Logger.Error("Could not find path for Dlib.dll");

extraArgs += $" --signParams=\"/td sha256 /fd sha256 /dlib \\\"{dllPath}\\\" /dmdf \\\"{Program.WindowsCodeSigningMetadataPath}\\\" /tr http://timestamp.acs.microsoft.com\"";
}

return new WindowsVelopackUploader(app_name, os_name, RuntimeIdentifier, channel, extraArgs: extraArgs);
Expand Down

0 comments on commit 721c06a

Please sign in to comment.