Hi, @Bhilare, Tushar S
Thank you for posting in Microsoft Q&A forum.
To resolve the "Unknown Publisher" window for ClickOnce when installing a code-signed application, you need to sign the Setup program using SignTool.exe. By default, ClickOnce has signed manifests and a signed Setup program. However, if you want to change the parameters of the Setup program later, you must sign the Setup program later. If you change the parameters after the Setup program is signed, the signature becomes corrupted. The following procedure generates unsigned manifests and an unsigned Setup program. Then, ClickOnce signing is enabled in Visual Studio to generate signed manifests. The Setup program is left unsigned so that the customer can sign the executable with their own certificate.
To generate an unsigned Setup program and sign later:
- On the development computer, install the certificate that you want to sign the manifests with.
- Select the project in Solution Explorer.
- On the Project menu, click ProjectName Properties.
- In the Signing page, clear Sign the ClickOnce manifests.
- In the Publish page, click Prerequisites.
- Verify that all the prerequisites are selected, and then click OK.
- In the Publish page, verify the publish settings and then click Publish Now. The solution publishes the unsigned application manifest, unsigned deployment manifest, version-specific files, and unsigned Setup program to the publishing folder location.
- In the Publish page, click Prerequisites.
- In the Prerequisites dialog box, clear Create setup program to install prerequisite components.
- In the Publish page, verify the publish settings and then click Publish Now. The solution publishes the signed application manifest, signed deployment manifest, and version-specific files to the publishing folder location. The unsigned Setup program is not overwritten by the publish process.
- At the customer site, open a command prompt.
- Change to the directory that contains the .exe file.
- Sign the .exe file with the following command: For example, to sign the Setup program, use one of the following commands:
signtool.exe sign /f <path to pfx file> /p <password> /t http://timestamp.digicert.com <path to setup.exe>
Replace <path to pfx file>
with the path to your PFX file, <password>
with the password for your PFX file, and <path to setup.exe>
with the path to your Setup program.
References:
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Add comment".