26

How do I set the default install path when deploying a program using a windows installer.

ThinkingStiff
  • 64,767
  • 30
  • 146
  • 239
user589195
  • 4,180
  • 13
  • 53
  • 81

1 Answers1

56

In a Visual Studio Setup project, you control the default install path by setting the DefaultLocation property of the Application Folder folder, within the File System Editor.

This, in turn, as you've found, defaults to [ProgramFilesFolder][Manufacturer][ProductName]. You can either replace this property entirely (you should keep [ProgramFilesFolder], at the very least though), or you can modify these properties.

[ProgramFilesFolder] is built in, and correctly leads to the Program Files directory on the target machine, no matter how customized the setup of Window is. The other two properties are properties of the setup project (select the Setup project in Solution Explorer, and examine the properties grid to find them). These default to the company name you supplied when installing Visual Studio, and the name of the Setup project.

lazyPower
  • 267
  • 3
  • 12
Damien_The_Unbeliever
  • 234,701
  • 27
  • 340
  • 448
  • 2
    its the program files bit i want to get rid of. I want to install in the folder above the program files directory. ie C:\Manufacturer – user589195 Nov 15 '11 at 15:41
  • 18
    You can eliminate it, but it's strongly not recommended by Microsoft. How do you know whether the machine you're installing on even has a C drive? You might try `[WindowsVolume][Manufacturer]`, but I'm not sure it will work. Here's the [documentation](http://msdn.microsoft.com/en-us/library/windows/desktop/aa370905(v=vs.85).aspx#system_folder_properties) for the standard installer properties. – Damien_The_Unbeliever Nov 15 '11 at 15:52
  • Do not install directly to the `WindowsVolume`. This is intentionally made hard to achieve because nothing should be installed there in the first place. This is not some fixed idea, these are Windows application design guidelines. Future OS upgrades could cause binaries here to refuse to launch - for example. – Stein Åsmul Nov 22 '18 at 19:31