jaspernygaard
jaspernygaard

Reputation: 3158

Set ClickOnce ProductName post compile

We recently adopted Octopus Deploy as our release management system and also use it to deploy ClickOnce applications. The ClickOnce application gets reconfigured and resigned upon installation. However, I haven't been able to figure out how to set the title of the application.

I can do it by setting the ProductName when publishing the ClickOnce package, but we compile once and deploy the same set of binaries throughout our deployment pipeline. Is it possible to set the ProductName after the ClickOnce package has been created?

Upvotes: 1

Views: 553

Answers (2)

Seb T.
Seb T.

Reputation: 1124

For those you may still struggle, as I did recently, with Click-Once packages within Octopus Deploy :

I have created a step script template that will create a Click-Once package based on a previous step of the deployment process. Will pack binaries installed from this previous step and sign package using mage with your certificate.

It should come with enough parameters to finally make Click-Once package creation fast and easy with Octopus.

Script is available in the Octopus library

HTH

Upvotes: 0

redcalx
redcalx

Reputation: 8637

There are two ClickOnce manifest files that are relevant here:

1) Application manifest. This contains the product name and lists all of the files that make up the application.

2) Deployment manifest. This refers to the application manifest and a URL to this file is distributed to anyone wanting to install the application.

You can change the product name in the application manifest, but you will have to re-sign it. And as a result you will have to rebuild the deployment manifest and re-sign it as well - because the reference to the application manifest contains a signature hash that will now be out-of-date.

To clarify, this product name is what appears at installation time in the 'Do you want to install this application' dialog box, and also in the Start Menu once installed (if ClickOnce is set to install locally instead of always retrieving the application from a remote server).

FYI, I use the following command lines to rebuild the application and deployment manifests respectively (options is square brackets are optional):

Create/update the application manifest:

mage -New Application -ToFile AppFiles/fooApp_1.2.0.0/fooApp.exe.manifest -Name "fooApp Name" -Version 1.2.0.0 -FromDirectory AppFiles/fooApp_1.2.0.0 [-Processor x86]

Sign the application manifest:

mage -Sign AppFiles//fooApp_1.2.0.0/fooApp.exe.manifest -CertFile mycert.pfx -Password mypass

Create / Update deployment manifest

mage -New Deployment -Install true -Publisher "Foo Corp." -ProviderUrl "http://fooserver/mydeploymentfolder/fooApp.application" -AppManifest AppFile/fooApp_1.2.0.0/fooApp.exe.manifest -ToFile fooApp.application [-Processor x86]

Sign the deployment manifest:

mage -Sign fooApp.application -CertFile mycert.pfx -Password mypass

Upvotes: 2

Related Questions