views:

55

answers:

2

Hi! 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

Thanks for any help and advice!

+1  A: 

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.

Aurélien Ribon
Thank you, Aurélien. Once I get to the point of distributing actual applications (rather than these test programs I'm doing to learn C#) I will probably look at using a packaging/installation tool. Thanks again!
Kevin
So you can just do the same as me : just zip the .exe and the required libraries .dll (if any) which are located in your bin/Debug or bin/Release folder, and give the zip to your friend. They won't have to install/uninstall the application and it will make their life easier ;-)
Aurélien Ribon
Awesome idea! Thanks for the help!
Kevin
+3  A: 

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).

Allon Guralnek
Wow, thank you Allon! That is great advice! I greatly appreciate it.
Kevin