-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bootstrapper.DigitalSignature.Apply hide console output #373
Comments
The easiest way for you is to override As a starting point you can use the current implementation: public virtual int Apply(string fileToSign)
{
var retValue = CommonTasks.Tasks.DigitalySign(fileToSign,
PfxFilePath,
TimeUrl?.AbsoluteUri,
Password,
PrepareOptionalArguments(),
WellKnownLocations,
UseCertificateStore);
Console.WriteLine(retValue != 0
? $"Could not sign the {fileToSign} file."
: $"The file {fileToSign} was signed successfully.");
return retValue;
} Where, wixsharp/Source/src/WixSharp/CommonTasks.cs Line 182 in a2c1a72
However in the next release you will have the possibility to modify (or even clear) the output content before it is displayed in the console: ExternalTool.ConsoleOut = (line) => Console.WriteLine(line.Replace("secret", "******")) |
Accumulative fixes and minor improvements. ----- v1.6.5.0 - Added session extension `e.Session.GetMainWindow()` for properly displaying message box from CAs - Updated all sample projects to target v4.6.1 runtime - Issue #373: Bootstrapper.DigitalSignature.Apply hide console output - Issue #372: MsiFile location v1.6.4.3 - Issue #354: Adding an InternetShortcuts throw NullReferenceException - Assorted internal fixes (XML docs etc.) - All compatible `IGenericEntity.Process(ProcessingContext)` cases moved to `WixEntity.CreateAndInsertParentComponent` v1.6.4.2 * Issue #344: Duplicate symbol 'Directory:ProgramFilesFolder' found v1.6.4.1 * Updated all IGenericEntity implementations to support 'no-directory' deployments * Removed all references to the obsolete `IncludeWixExtension` * Implemented clean algorithm for handling no-dir scenarios without resorting to the `%ProgramFiles%\WixSharp\DummyDir`. Algorithm is controlled by `AutoElements.LagacyDummyDirAlgorithm` * Issue #341: UAC Text is not localized * Implemented adding custom error description of he ManagedUI.ExitDialog depending on the Install error or cancellation.
Thank you Oleg! |
👍 |
I also want to have the password hidden. But I don't understand your proposal. |
Don't I look silly now? I have just released half-done re-implementation of already existing feature. @Lechl this message is also important for you. You are absolutely right. This is the line you are referring to: Compiler.OutputWriteLine("Execute:\n\"" + this.ExePath + "\" " + this.Arguments); And the default value of class Compiler
{
public static Action<string> OutputWriteLine = Console.WriteLine;
. . . Thus if you use it as is it will just print the output (e.g. signtool.exe) without any changes. However you can assign it to a new handler that can process the output or even completely "swallow" it. Compiler.OutputWriteLine = (line)=>{}; I will try to re-release and revoke the change later this week. Thank you. |
Oh god, we all overlooked this. Thank's @oleg-shilo! Can be closed. |
After further considerations I decided to keep that additional output filtering as it allows output massaging per var tool = new ExternalTool
{
WellKnownLocations = wellKnownLocations ?? @"C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin;" +
...
ExePath = "signtool.exe",
Arguments = sha1,
ConsoleOut = (line) => Compiler.OutputWriteLine(line.Replace(password, "***"))
} Meaning that from the next release you may remove |
Thx @oleg-shilo. I'm sorry, I did not look into With following defined before Compiler.OutputWriteLine = (line) => Console.WriteLine(line.Replace(secret, "******")); |
To: @Lechl Hi Dominic, can you please give me some details on your use of AppVeyor. I am evaluating it for the commercial product CI and want to avoid problems that you have described. My question are:
Thank you |
The default masking is very good, so no one has the chance to get the password via changing the code (eg. remove the |
Great, thank you. |
* Implemented NSIS-based bootstrapper. * Issue #387: Certificate password can be null * Issue #377: How to register a new MIME type with custom document icon * Issue #373: Bootstrapper.DigitalSignature.Apply hide console output * Added missing IconFile support * SetupEvent sample extended to show how restart itself elevated if required.
Hello Oleg,
i'm using AppVeyor for automated builds. I have a bootstrapper which i sign with a pfx certificate. Works perfect!
But in the AppVeyor build i see the console output of the signtool. This is bad for me because I have no option to suppress the log showing the password of the certificate.
Few enhancement options are: Replace the password always with something like '*****', or add an parameter hiddenLog with default value to the Sign function. Or maybe add a ApplySilent function.
What do you think?
The text was updated successfully, but these errors were encountered: