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)?