I had created a Setup and Deployment project for a WPF application I had created. I noticed that when I installed the project, the path was being installed in the directory c:\Program Files\Awesome Place\FileTracker. As awesome as “Awesome Place” is, I didn’t want my application installed there – I wanted it installed at c:\Program Files\FileTracker.
What would Dr. Smith of Lost in Space fame do? He would say “the pain, the pain”, and then try to sabotage the Robinson family. That wasn’t going to help me, though, so I did some Google searching. And behold, I found the answer on Daniweb.
Here are the steps needed:
- Right click on the deployment project in the Solution window and select View, File System.
- Click on the Application Folder. Notice in the Properties window, the list of properties is refreshed, and one of the properties is DefaultLocation.
- Change the format to [ProgramFilesFolder]\[ProductName], removing the [Manufacturer] property from the mix.
(Click on the image to see a larger view.)
After you rebuild the deployment project, you can verify that the change has been made by right clicking on the deployment project and selecting Install. Stepping through the installation process, you’ll see that the target location is now the one that you want.