locked
Customizing ClickOnce Intranet Deployment RRS feed

  • Question

  • Hello,

    I am working on my first clickonce deployment to our company intranet (VS 2010 windows forms app) and need some assistance with customizing it.

    Our company's hosting team doesn't allow .exe files in the intranet environment and they are wondering if I can save the .exe on an Enterprise File Share and only deploy the other files to the web servers?

    I don't have enough experience in this area to know whether clickonce can handle different directories for the deployment files. 

    Any ideas?  Thanks in advance,

    Tim

    Monday, June 3, 2013 3:06 PM

Answers

  • Put the files on the server as .deploy extensions, so the .exe file becomes a .exe.deploy file.

    See this article:

    http://msdn.microsoft.com/en-us/library/ms228998.aspx

    This saves configuration of the server anyway, you only have to
    configure .deploy files as streaming binary files, instead of doing that
    for each extension.


    ----------------------------------------------- "Cannot find reality.sys ... Universe Halted!"

    • Proposed as answer by Chester Hong Tuesday, June 4, 2013 8:44 AM
    • Marked as answer by Chester Hong Friday, June 21, 2013 12:06 AM
    Monday, June 3, 2013 9:14 PM
  • Make sure your setup.exe is in the same location as publish.htm, so we know we are talking about the same things:

    The setup.exe in the same directory as publish.htm is the bootstrapper which loads any prerequisites (like .net framework) if necessary.

    Go look at the publish.htm that you are shipping, you will find html code that executes the setup.exe if prerequisites are needed.

    You could change the publish.htm to execute the bootstrapper from another location...  Another server or share perhaps...

    Once you start down that road, you are manually modifying what click once build provides, which has attendant headaches.  From then on, you need to manually modify every publish.htm before you ship it, and you have to make sure that the setup.exe in the new location gets continually updated whenever you do a build.  This means you really don't want to be doing a visual studio publish anymore, you want a build process to kick off, so all these manual modifications stay consistent.

    Once you try to run setup.exe off another location, you also need to consider permission problems for your various users, and the fact that things won't work right if that 2nd server is down....

    You get the idea....


    ----------------------------------------------- "Cannot find reality.sys ... Universe Halted!"

    • Marked as answer by Chester Hong Friday, June 21, 2013 12:06 AM
    Tuesday, June 4, 2013 4:53 PM
  • OK, that clarifies it for me.  Thanks!

    • Marked as answer by Tim Dot Net Tuesday, June 4, 2013 8:35 PM
    Tuesday, June 4, 2013 8:35 PM

All replies

  • Put the files on the server as .deploy extensions, so the .exe file becomes a .exe.deploy file.

    See this article:

    http://msdn.microsoft.com/en-us/library/ms228998.aspx

    This saves configuration of the server anyway, you only have to
    configure .deploy files as streaming binary files, instead of doing that
    for each extension.


    ----------------------------------------------- "Cannot find reality.sys ... Universe Halted!"

    • Proposed as answer by Chester Hong Tuesday, June 4, 2013 8:44 AM
    • Marked as answer by Chester Hong Friday, June 21, 2013 12:06 AM
    Monday, June 3, 2013 9:14 PM
  • Thanks for your reply, DDarwin. 

    I already had the "use .deploy" option selected, and the items in the Application Files folder have that extension.

    My question is about the setup.exe file that is on the same root as the Application Files folder, and doesn't have the .deploy extension.  Do I just go into Windows Explorer and change the file name directly (adding .deploy to the end of the filename?)  If so, do you do that with the manifest as well or just the exe?

    As you can see, this is my first go at deploying via our intranet:)

    Thanks for you help,

    Tim

    Tuesday, June 4, 2013 3:51 PM
  • Make sure your setup.exe is in the same location as publish.htm, so we know we are talking about the same things:

    The setup.exe in the same directory as publish.htm is the bootstrapper which loads any prerequisites (like .net framework) if necessary.

    Go look at the publish.htm that you are shipping, you will find html code that executes the setup.exe if prerequisites are needed.

    You could change the publish.htm to execute the bootstrapper from another location...  Another server or share perhaps...

    Once you start down that road, you are manually modifying what click once build provides, which has attendant headaches.  From then on, you need to manually modify every publish.htm before you ship it, and you have to make sure that the setup.exe in the new location gets continually updated whenever you do a build.  This means you really don't want to be doing a visual studio publish anymore, you want a build process to kick off, so all these manual modifications stay consistent.

    Once you try to run setup.exe off another location, you also need to consider permission problems for your various users, and the fact that things won't work right if that 2nd server is down....

    You get the idea....


    ----------------------------------------------- "Cannot find reality.sys ... Universe Halted!"

    • Marked as answer by Chester Hong Friday, June 21, 2013 12:06 AM
    Tuesday, June 4, 2013 4:53 PM
  • Thanks, DDarwin.  I want to avoid having the exe elsewhere, per your advice.

    The primary item I'm contending with is that our intranet group doesn't want .exe files, but are fine with .deploy.  So [brace for stupid question] can I just rename the exe file "setup.exe.deploy" before I ship it? :)  

    That seemed to be your first response, but not sure if that's really how you go about changing the exe to a deploy.

    Thanks,

    Tim

    Tuesday, June 4, 2013 8:13 PM
  • The .deploy trick won't work for the bootstrapper.

    The bootstrapper is not a part of the click once distribution, its a separate file, and a peer with publish.htm.  Both of these execute before you start the click once download.  Think about it, the bootstrapper is supposed to make sure you have the correct version of .net framework BEFORE you start the click once install.  It has to be separate from click once....

    The files in the click once distribution work because .net framework knows about .deploy extensions during the download, and can stream them and rename them.  There is a click once manifest for each file in the File Store.

    When you download the bootstrapper, this is the browser doing it, not .net framework.  The browser doesn't natively know what to do with a .deploy file.

    You might have some success with your security department if you ask them for an exemption, and point out the setup.exe is a system generated thing meant only to upgrade .net framework.  This isn't a file you developed, it's something built for you based on prerequisite list on your application.

    Other than that, your only option is to play the game of moving the setup.exe to another place and manually modifying publish.htm.


    ----------------------------------------------- "Cannot find reality.sys ... Universe Halted!"

    Tuesday, June 4, 2013 8:31 PM
  • OK, that clarifies it for me.  Thanks!

    • Marked as answer by Tim Dot Net Tuesday, June 4, 2013 8:35 PM
    Tuesday, June 4, 2013 8:35 PM