Question related to ClickOnce RRS feed

  • Question



      We have a WPF desktop application which we want to make available to the users by downloading and installing the same from our website. Since this is something for the kids, we want minimal interaction on their part while installing the same on their machines. I searched through the web and found out that Clickonce was the answer to my questions. However I am listing down the options I would like Clickonce to perform. Please let me know if we can perform the same using clickonce and how do we get those things to work.


    1. 1. Have .NET 3.0 install in the local machine if not installed already. --> I think we can add this to the prerequisites list while creating the installer. Does this mean that .net 3.0 will be installed automatically if its not found in the system?
    2. Install the application in a predefinded location (within MyDocuments). Will it create the folder structures and then install the application in that location? How do I mention the location where I would want my application to get installed.
    3. Can I change the app.config file of the application while it is being downloaded and installed? If yes then how? The reason why I would like this to happen is, since my application involves the users to login before using the application, but it doesnt prevent them from using the application if there is no internet connectivity. I need to be able to add the login information in the config file and check for the authenticity of the user from this config file in the absence of an internet connection.
    4. My application will have the exe and also have several images and other files placed within respective folders. How do I include folders in the ClickOnce installer. All these folders are present in the bin directory and are not added in my VBProject.


    Will be eagerly waiting for the answers to my above questions. It is pre-emptive for me to know the answers before going in for Clickonce as my installer. If the above mentioned points are not possible using Clickonce, kindly let me know if there is something else I can use for my purpose.


    Thanx and Regards,


    Tuesday, April 29, 2008 9:25 AM


  • 1. Yes. In the Prerequisites dialog under the Publish Tab under your project's properties, you can select which version of the .Net framework to deploy.


    2. You can't. ClickOnce installs under each user's profile in obfuscated folders. The point of that is that it does not require administrative privileges to install or run, and the user can't muck with the deployment. Note that if you have a machine with multiple Windows accounts, each user will have to install the application. This way, the users can't mess up each other's deployment.


    3. No. It will deploy whatever you have at the time of deployment. So you need to write your application to handle this itself. For example, one application I've seen caches the username and password in a local encrypted file, and if the user is not online, it verifies against the last time he logged in.


    4. Add a folder to your project, and then add the files to that folder, in SolutionExplorer in VS. On each file, set the Build Action to "None" and the "Copy to Output Directory" property to "copy always". Then they will be included in the deployment.


    On the deployed side, you can get to them by looking in Path.Combine(System.Windows.Forms.Application.StartupPath, "yourfoldername").


    ClickOnce is really easy to use, so you can muck around with it and see if you like it without spending a lot of time on it.




    Tuesday, April 29, 2008 4:12 PM