简体   繁体   中英

My program has been “published”, how can I change the installation path?

I "published" my C# solution in Visual Studio 2008 to C:\\Deploy. When I run the setup.exe program, it installs my program to C:\\Documents and Settings\\Kevin\\Start Menu\\Programs\\MyProgram

Is there any way, within Visual Studio, to set a custom install path? For instance, what if I wanted my program to install to C:\\Program Files\\MyProgram?

Publishing uses ClickOnce for deployment. ClickOnce has the advantage that it's easy to install and update, and doesn't require the user to have administrator privileges to install your application.

If you'd like a more traditional next-next-next-next-finish installer, which also allows the user to specify the target folder (and for you to set/force a default one), add a "Setup Project" to your solution by clicking File >> Add >> New Project..., in the tree select Other Project Types >> Setup and Deployment and double click Setup Project. When you build the setup project, it create an MSI file (Microsoft Installer setup file) and a bootstrapper EXE file (in case the user doesn't have Microsoft Installer or the required .NET Framework, which it then installs automatically).

ClickOnce ("published") applications are installed per user in the user application cache location. There is no way you can change this location ;-)

You have to use your own setup packaging tool in order to choose or let the user choose the location. Or you can just distribute your application as a zipped executable, if no installation routine has to be called, liked registering file types or adding keys to the registry.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM