Roxana Goidaci

Hello,

I need to create a setup project for a webapplication that includes a link to a ClickOnce installer (MyApp.application) and the ClickOnce installer package itself. The problem is that when I build and publish the ClickOnce application I don;t know the Install URL that will be used on the web server after the package is installed there.

In a few words, I need to manually republish the application on a series of different webservers by simply copying the files to other websites.

I found in the MyApp.application file, the section that holds this install URL:

<deploymentProvider codebase="http://installLocation/MyApp.application" />

and changed the codebase attribute in a custom action of the wrapper setup for the webapplication. After this, I created the setup and included the ClickOnce publishing package and installed it on another web server.

The only problem is that I get the following error when trying to install the ClickOnce application from the web:

ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of http://serverName/webSite/MyApp.application resulted in exception. Following failure messages were detected:
+ Exception reading manifest from http://serverName/webSite/MyApp.application: the manifest may not be valid or the file could not be opened.
+ Manifest XML signature is not valid.
+ The digital signature of the object did not verify.

....

--- Inner Exception ---
System.Deployment.Application.InvalidDeploymentException (SignatureValidation)
- Manifest XML signature is not valid.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.Manifest.AssemblyManifest.ValidateSignature(Stream s)
at System.Deployment.Application.ManifestReader.FromDocument(String localPath, ManifestType manifestType, Uri sourceUri)
--- Inner Exception ---
System.Security.Cryptography.CryptographicException
- The digital signature of the object did not verify.

- Source: System.Deployment
- Stack trace:
at System.Deployment.Internal.CodeSigning.SignedCmiManifest.Verify(CmiManifestVerifyFlags verifyFlags)
at System.Deployment.Application.Manifest.AssemblyManifest.ValidateSignature(Stream s)




Re: ClickOnce and Setup & Deployment Projects Change Install and Update URL after publishing...

blixt


Hi,

I believe you need to sign your manifest after
you have changed it.

Something like..
mage -Sign MyApp.application -CertFile MyKey.pfx -Password MyPassword





Re: ClickOnce and Setup & Deployment Projects Change Install and Update URL after publishing...

Roxana Goidaci

Ok, first I used this to change the install URL

mage -Update MyApp.application -ProviderUrl http://server/installerLocation/MyApp.application 

Then I resigned the manifest with this command:

mage -Sign MyApp.application -CertFile MyKey.pfx -Password MyPassword

I have the certificate installed on the dev machine where I executed these 2 commands. After this, I copied the whole package to the web server where I want to republish the application. The problem is that I get this error again: (at the end of message)

I guess there is a problem with the certificate... I created the cert file with makecert, then exported the pfx and installed it also on the web server. Can you tell me exactly how to create and manage the certificate because maybe I am doing something wrong...

ERROR DETAILS
 Following errors were detected during this operation.
 * [12/15/2006 11:10:08 AM] System.Deployment.Application.InvalidDeploymentException (ManifestParse)
  - Exception reading manifest from http://server/installerLocation/MyApp.application: the manifest may not be valid or the file could not be opened.
  - Source: System.Deployment
  - Stack trace:
   at System.Deployment.Application.ManifestReader.FromDocument(String localPath, ManifestType manifestType, Uri sourceUri)
   at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestDirectBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
   at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options)
   at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut)
   at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
  --- Inner Exception ---
  System.Deployment.Application.InvalidDeploymentException (SignatureValidation)
  - Manifest XML signature is not valid.
  - Source: System.Deployment
  - Stack trace:
   at System.Deployment.Application.Manifest.AssemblyManifest.ValidateSignature(Stream s)
   at System.Deployment.Application.ManifestReader.FromDocument(String localPath, ManifestType manifestType, Uri sourceUri)
  --- Inner Exception ---
  System.Security.Cryptography.CryptographicException
  - No signature was present in the subject.

  - Source: System.Deployment
  - Stack trace:
   at System.Deployment.Internal.CodeSigning.SignedCmiManifest.Verify(CmiManifestVerifyFlags verifyFlags)
   at System.Deployment.Application.Manifest.AssemblyManifest.ValidateSignature(Stream s)

 

 






Re: ClickOnce and Setup & Deployment Projects Change Install and Update URL after publishing...

Roxana Goidaci

I forgot to tell ... I used also the last command:

setup.exe /url= http://server/installLocation

as adviced in this article:

http://proactivelogic.com/blog/index.php/2006/09/30/packaging-a-clickonce-server-deployment/






Re: ClickOnce and Setup & Deployment Projects Change Install and Update URL after publishing...

blixt


As far as I know you need to sign the manifest on the
target machine, not the dev machine or it will not work.

This means that you will need to distribute the certificate
to the target machine also.

Hope that helps.