Skip to content

WingetSourceCreator cannot sign package when spaces are in cert path #5844

@JohnnyElvis

Description

@JohnnyElvis

Relevant area(s)

WinGet CLI

Relevant command(s)

No response

Brief description of your issue

WingetSourceCreator cannot handle spaces in certificate path. Root cause is within the method SignFile in WingetSourceCreator\Helpers.cs

You need to change this:

string command = $"sign /a /fd sha256 /f {signature.CertFile} ";

to this:

string command = $"sign /a /fd sha256 /f \"{signature.CertFile}\" ";

You can implement #4948 while you are on it.

Steps to reproduce

Build solution. You might want to apply fix from #4181 so you can actually work with the IndexCreationTool.

Run the IndexCreationTool with Signature.CertFile path having an empty space somewhere in between.

When using path e.g "D:/Jenkins/WrkDir/workspace/Winget Builder/Build Winget Package/signing_cert.pfx" you will be greeted with "SignTool Error: File not found: D:/Jenkins/WrkDir/workspace/Winget"

Expected behavior

Being able to deal with empty spaces in a path

Actual behavior

When using path e.g "D:/Jenkins/WrkDir/workspace/Winget Builder/Build Winget Package/signing_cert.pfx" you will be greeted with "SignTool Error: File not found: D:/Jenkins/WrkDir/workspace/Winget"

Environment

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-BugIt either shouldn't be doing this or needs an investigation.

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions