.net – ClickOnce deployment issues

clickoncenetprerequisites

I'm working on a project deployed with ClickOnce, and I'm running through several issues.

There are two components in my software solution: a desktop client which needs .NET framework 3.5 to run, and a server (ASP.NET application) which lists available documents and provides a way to install the desktop client with ClickOnce.

My first problem is the prerequisites' one: I need a way to install the 3.5 framework prior to the client installation. Visual studio creates a setup.exe which takes care of that, but in order to make it work, it has to be run directly (instead of linking to the .application file), and the deployment URL has to be known when creating the ClickOnce manifest.

So I have two more problems: there is apparently no way to run the client application with query string arguments after installing it with setup.exe, so instead of having a server displaying the documents list linking to a URL like "…/client.application?document=doc1" I can only have a link to setup.exe.

The other problem is the worst: the server is intended to be used in relatively small private networks, and not on a single web server. The problem is: I do not know the deployment URL of the ClickOnce client at build time, so the setup.exe cannot run properly when the "install from a web site" option is checked. For now, the workaround is to have an offline installer which contains the setup.exe, prerequisites and the ClickOnce deployment files in a big ZIP file.

An user with the proper framework version can still use the .application link with querystring to the document to install/update the client and open the document. An user without the framework gets an error message ("System update required blablabla 3.5.0.0 blabla GAC"), and has to download the ZIP file, extracts it to his local machine and run the setup.exe file to install the framework, and then the client. And after that, he has to go back to the documents list and use the link to launch the client with proper arguments.

Needless to say, I'm not very proud of this strategy, which ruins all ClickOnce deployment advantages.

Is it possible to get rid of the prerequisites issue in a more elegant way? Is there a simple way to modify the installation URL of the ClickOnce application when deploying the server in a network (like writing the URL in a configuration file or something)?

Best Answer

I too have been trying to solve the "I do not know the deployment URL of the clickonce client at build time" problem.

The best I can come up (I just started writing it so this is still speculation) is to write a utility that the end-user will run that will set the deploymentURL. This appears to be possible in .NET but you need to:

  • Read in the manifest with ManifestReader.ReadManifest
  • set the DeploymentUrl
  • ManifestWriter.WriteManifest

Then you have to sign the manifest again using SecurityUtilities.SignFile

The signing process bothers me. Either I have to use a throwaway certificate (which makes the signing meaningless) or I need to use a cert from a CA and then I have to distribute my password in order to resign the manifest (which is stupid since it makes my cert insecure). So I seem to be left with the user seeing "Unknown Publisher" and a Yellow exclamation mark...

Related Topic