dotnet / sign

Code Signing CLI tool supporting Authenticode, NuGet, VSIX, and ClickOnce
MIT License
447 stars 84 forks source link

Sign many applications and manifestfiles in batch for click-once #681

Open klamfeldt opened 2 months ago

klamfeldt commented 2 months ago

Is your feature request related to a problem? Please describe. Cant sign many application-files in one batch. We have a setup where we have a .application and .manifest file per customer and we have about 100 customers. I would like to sign all files in one run.

Describe the solution you'd like When signing CustomerA.application file the program should look for a manifestfile named CustomerA.dll.manifest

Describe alternatives you've considered My workaround now is to temporary move customerA.application and customerA.dll.manifest to a temporary folder and sign them and them move them back.

jackmtpt commented 2 months ago

Do you actually have a .manifest per customer, or just per-version of your application? We do something similar - with a .manifest for e.g. v1 of the app and another for v2, and then per-customer .application files with a unique update URL and that we configure to point to either v1 or v2 of the .manifest file.

I merged some changes to this tool a few weeks ago that should support signing multiple .application files but there's not been a release since then so you'd have to compile it yourself.

klamfeldt commented 2 months ago

Yes we have 1 manifestfile for each customer, since we have an unique URL for each customer. I have compiled the latest code and run but fails with "Sequence contains more than one matching element" from \ClickOnceSignatureProvider.cs:line 130 which has a SingleOrDefault FileInfo? manifestFile = filteredFiles.SingleOrDefault(f => ".manifest".Equals(f.Extension, StringComparison.OrdinalIgnoreCase));

ottD commented 2 weeks ago

We are facing the same issue as @klamfeldt outlined as our solution contains multiple .manifest files in the same directory. The current implementation of the ClickOnceSigner assumes a single .manifest file which is pretty limiting and renders the sign tool unusable without having to implement some sort of workaround.