title: ClickOnce deployment issues
body: <p>I'm working on a project deployed with ClickOnce, and I'm running through several issues.</p>
  
  <p>There are two components in my software solution: a desktop client which needs <a href="http://en.wikipedia.org/wiki/.NET_Framework" rel="noreferrer">.NET</a> framework 3.5 to run, and a server (<a href="http://en.wikipedia.org/wiki/ASP.NET" rel="noreferrer">ASP.NET</a> application) which lists available documents and provides a way to install the desktop client with ClickOnce.</p>
  
  <p>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 <code>setup.exe</code> which takes care of that, but in order to make it work, it has to be run directly (instead of linking to the <code>.application</code> file), and the deployment <a href="http://en.wikipedia.org/wiki/Uniform_Resource_Locator" rel="noreferrer">URL</a> has to be known when creating the ClickOnce manifest.</p>
  
  <p>So I have two more problems: there is apparently no way to run the client application with query string arguments after installing it with <code>setup.exe</code>, 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 <code>setup.exe</code>.</p>
  
  <p>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 <code>setup.exe</code> 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 <code>setup.exe</code>, prerequisites and the ClickOnce deployment files in a big ZIP file.</p>
  
  <p>An user with the proper framework version can still use the <code>.application</code> 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 <code>setup.exe</code> 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.</p>
  
  <p>Needless to say, I'm not very proud of this strategy, which ruins all ClickOnce deployment advantages.</p>
  
  <p>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)?</p>