Reputation: 693
I'm working on a pipeline migration from an old manually implemented ci/cd solution to Azure DevOps. There are some prebuilt functions/processes that I'm still reusing.
For example. Like how they package all their solution as artifacts.
I'm trying to keep the code changes as minimal as possible.
The build pipeline creates a ClickOnce package .zip
.
Then on the release stage, the myapp.exe.config
in the Application Files gets transformed via XML-Document-Transform. Also the application manifest <ApplicationName>.application
gets manually edited through Powershell. The <deploymentProvider codebase="http://1.1.1.1/samplefolder/myapp.application" />
gets changed on release depending on the environment/path it is going to be deployed to.
Application Manifest
<asmv1:assembly ...>
<deployment ...>
<subscription>
<update>
<beforeApplicationStartup />
</update>
</subscription>
<deploymentProvider codebase="http://1.1.1.1/samplefolder/myapp.application" />
</deployment>
</asmv1:assembly>
Now I understand that this method requires Re-Signing of the whole package. They have a custom .exe
file to re-sign the whole package (it's not mage.exe). Unfortunately, I cant reuse the said executable to re-sign it.
All I have is their Certificate Thumbprint. But I don't know what to do with it.
Questions:
Upvotes: 5
Views: 1185
Reputation: 693
I have managed to sign the ClickOnce Appmanifest (*.application
) and *.exe.manifest
files on release by using dotnet mage. I've done this by adding the certificate (.pfx
or .p12
) file in the Secure Files and the certificate password in the pipeline variables.
dotnet tool update --global microsoft.dotnet.mage --version 5.0.0
## Signing the exe.manifest file
dotnet mage -update "<folder>/Application Files/<assembly folder name>/<assemblyname>.exe.manifest" -fd "<folder>/Application Files/<folder>" -CertFile "$(SignKey.secureFilePath)" -Password "$(SignKeyPassword)"
## Signing the .Application file
dotnet mage -update "<the .Application full path>" -pu "$publisherURL" -pub "$(PublisherDetails)" -appmanifest "Application Files/<assembly folder name>/<assemblyname>.exe.manifest" -CertFile "$(SignKey.secureFilePath)" -Password "$(SignKeyPassword)"
Upvotes: 2