none
How to control the location of ClickOnce installation?

    Question

  • I successfully installed my ClickOnce application from a remote site.  However, it is be default installed in c:\Document and Settings\myloginname\....  How to change the installation location to be under c:\program files\...?
    Thanks
    Monday, July 11, 2005 10:58 AM

Answers

  • You cant change that location. It is installed in the Application Cache and there is no way you can install it to some other folder directly by using ClickOnce. You could write an exe to copy files from that folder to where you want but I havent really tried it out. So not sure whether it will work or not. It sure would create problems if you have some optional files though.

    Monday, July 11, 2005 11:09 AM

All replies

  • You cant change that location. It is installed in the Application Cache and there is no way you can install it to some other folder directly by using ClickOnce. You could write an exe to copy files from that folder to where you want but I havent really tried it out. So not sure whether it will work or not. It sure would create problems if you have some optional files though.

    Monday, July 11, 2005 11:09 AM
  • Is that really necessary? I don't think it would be a good idea, because it would require the user to run as admin. Regular users aren't allowed to write to the program files directory.

    Because you have to be online and visit a website to start the ClickOnce deployment, the user would be vulnerable to all sorts of malicious code. People shouldn't be required to browse the web as admin.
    Monday, July 11, 2005 12:20 PM
  • You are right, it is not really necessary.  But it just give me a feeling of tiny software if it is installing on the "Cache"...
    What really troubling me is the convenience of publishing and updating.  I currently deploying my ClickOnce application manually as stated in http://msdn2.microsoft.com/library/xc3tc5xx(en-us,vs.80).aspx because my application involves many data files and directories.
    I will be in great trouble if mistake is made in the publishing process.  Please have a look at my concern in http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=55780 

    Thanks
    Monday, July 11, 2005 6:15 PM
  • ClickOnce application are installed per user in the user application cache. These applications are managed by the ClickOnce service. If you want to install to a user specifed location such a Program Files\... you should use MSI or some other installer technology.

    Thanks,
    Sameer

    Tuesday, July 12, 2005 4:02 AM
  • Does it imply that ClickOnce application s are per-user?  Can I make it available for all user?

    Wednesday, July 13, 2005 4:46 AM
  • Yes, clickonce apps are per user, you cant make it available for all the users, new user will have to click on the published page to run or install them.
    Wednesday, July 13, 2005 5:38 AM
  • This really stinks!!  ClickOnce is such a handy thing to have and use, but it really has lots of limitations!  We have an environment where our users "hot desk" often.  They login to XP with their network login and use our desktop app to answer phone calls.

    So now, it seems that if 5 different people use this machine, XP will maintain 5 different copies of our application.  That, seems silly.  Also, there's no way for a user that sits down for the first time to figure out how to install the application.

    Is there any way around this?  What I'd really LOVE to see from ClickOnce are:

    • Ability to be available for all users in common location
    • Ability to create a desktop icon for all users

    I've seen these two things over and over on here and it seems like almost common sense that this is how people would want to use this technology.  I really hope that MS considers these in their next release or future updates.  I really don't know now if we can use ClickOnce.
    Wednesday, February 08, 2006 6:52 PM
  • I solved this problem by posting the location of the application on the registry.  Added a registry key with the path to the application.  And also run the application using something like:

                Dim ProcInfo As New ProcessStartInfo
                Dim arguments As String = "dfshim.dll,ShOpenVerbApplication " + {{share path to the .application file (//share/drive/dir/app.application)}}
                ProcInfo.FileName = "rundll32.exe"
                ProcInfo.Arguments = arguments

                ProcInfo.FileName = filename
                ProcInfo.CreateNoWindow = True
                ProcInfo.WindowStyle = ProcessWindowStyle.Hidden
                ProcInfo.RedirectStandardError = False
                ProcInfo.RedirectStandardOutput = False
                ProcInfo.UseShellExecute = True

                Dim proc As New Process
                proc.StartInfo = ProcInfo

                proc.Start()


    This is perhaps more than you need.  The simplest way to run the app is to shell the following command:
    >explorer "http://server.com/myapp.application#myapp.application"
    Tuesday, May 30, 2006 5:31 PM
  • Thank you for your suggestions. This is the first version of ClickOnce.  We welcome all requests or suggestions to make ClickOnce better in the next release.  The two points that you suggest are being considered in the next version of ClickOnce.  We are in the process of evaluating each customer's request for next release. Thanks.
    Tuesday, May 30, 2006 9:04 PM
  • How did you find the location of the application? I can currently do it from with in the app but for that, the app needs to be run atleast once before the location entry is created.

    I am using a custom installation routine to install the custom prereqs followed by the Click Once installation routine (all from cd). However, I am not sure how can I get the installation location of my app without having to run the app.

    Appreciate the help.

    Wednesday, July 05, 2006 4:44 PM
  • I have a question, is it possible to maybe install my clickonce application to C:\myapp? because then you wouldn't have to run it as admin, and I also would to suggest features for clickonce:

    •  clickonce can install to locations that are other then application cache, like for example C:\myapp
    •  the folder C:\myapp where my clickonce application will be installed, would be overwritted so you could install to this common place, but don't overwrite the text files, or xml files that may be inside the folder(Because I use installkey, and it would be a big help to not make people continuesly reactivate my software everytime they update my software. and they use .xml files to store the activation in it.) and so everytime you installed this application, you would install it to C:\myapp so it would be a common location. and because it is a big pain to keep my customers to continusly reactivate my software, when they update my software.
    • Ability to create a desktop icon for all users
    Monday, December 27, 2010 5:00 PM
  • Hi,

    No, you can't define the installation location for a ClickOnce application. The design goals of ClickOnce deployment include making sure it doesn't require any admin privileges (aside from the prerequisites) to install and update, and that means installing the application under the user profile. This is also why you can't install a ClickOnce app or shortcut for all users -- it doesn't have the privileges to do that.

    Another design goal was to be as unintrusive as possible. So the application and its assemblies are installed in their own location within the user profile in order to keep them insulated from other applications being updated, and to keep it from modifying assemblies used by other assemblies.

    If you have text files and/or XML files that you do not want modified or overwritten, then copy them to another location when the user first installs the application, and access them there. Here is an article about how to do that:

    http://robindotnet.wordpress.com/2009/08/19/where-do-i-put-my-data-to-keep-it-safe-from-clickonce-updates/

    RobinDotNet


    Click here to visit my ClickOnce blog!
    Microsoft MVP, Client App Dev
    Wednesday, January 05, 2011 8:40 PM
    Moderator
  • Hi Kennon,

    In the click once deployment, you can't change the location. the idea behind the click once is

    If any software / application needs to be update with large number of computers, then instead of distributing the updates to every computer, the click once will be automatically updated the patches from the server.

    Each time when the software / application launching, it will be verify with the click once server with the available version of the sofware in the server and installed version of the software in the computer. If there is any discripany, automatically this will update.

    Regards,

    Arun.


    Arun PS
    Wednesday, August 10, 2011 6:02 AM