Replies: 1 comment 1 reply
-
Found the solution. I have created a class named using System;
using WixSharp;
namespace MyNameSpace;
internal class MSCustomSigner : DigitalSignature
{
public override int Apply(string fileToSign)
{
Console.WriteLine("Signing: " + fileToSign);
var process = new System.Diagnostics.Process();
process.StartInfo.FileName = "powershell.exe";
process.StartInfo.Arguments = $"-ExecutionPolicy Bypass -File ../../scripts/Sign-File.ps1 -Target \"{fileToSign}\"";
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = true;
process.OutputDataReceived += (sender, args) => Console.WriteLine(args.Data);
process.ErrorDataReceived += (sender, args) => Console.WriteLine(args.Data);
process.StartInfo.CreateNoWindow = true;
process.Start();
process.WaitForExit(30000);
Console.WriteLine($"Signing completed with exit code: {process.ExitCode}");
if (process.ExitCode != 0) throw new Exception($"Signing failed for {fileToSign}");
return 1;
}
} I have passed the class to the project and boostrapper. var bootstrapper = new Bundle(PackageHelper.DisplayName)
{
DigitalSignature = new MSCustomSigner()
};
// ... my other codes
var project = new ManagedProject(productName)
{
SignAllFiles = true,
DigitalSignature = new MSCustomSigner()
}; |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to use Azure's Trusted Signing Account to Sign my files (MSI, DLL, EXE etc.) but I haven't able to make it work.
What I'm trying to use it, I want to use a custom signer that signs with my own commands on every file. My current signing process is not working if i sign it externally (after MSI and EXE build is finished).
For example;
Is it possible to do this?
Beta Was this translation helpful? Give feedback.
All reactions