5

I have a setup and deployment project in Visual Studio 2010

The default location of Application Folder is set to C:\[Appname]

The problem is that if there is no drive C: in the machine the app is being installed, the installer will crash with an error "'xxxxxxxx' is not a valid file name" or something similar, because the installer verifies the location before the user has a chance to set the actual application installation folder. (so the default location is validated and since drive c: is missing it throws this error)

You can set the location to something like [ProgramFilesFolder]\[AppName] etc..

I would like to know what is the "macro" for the system's windows drive! I would expect something like [WindowsDrive] or [SystemDrive] or something like that so that I could set the default location to [SystemDrive]\[Appname], for instance!

Does anybody know?

Thanasis Ioannidis
  • 2,981
  • 1
  • 30
  • 50

3 Answers3

7

I think http://msdn.microsoft.com/en-us/library/aa372057.aspx contains the info you are looking for(for .NET 3.5, other frameworks may differ).

  • 1
    Yes I found this link shortly after making the question :) The property I was looking for was "WindowsVolume". I forgot to post it as my own answer, but hey... that earned you 25 points ;) – Thanasis Ioannidis Jun 17 '13 at 23:20
0

Hopefully the following explanation/screenshots will make it easier for future readers to set the default location:

How to set the Default location to the WindowsVolume?

  • Use the WindowsVolume property.

Example:

Screenshot on how to change the default location

Hope this helps.

BenKoshy
  • 33,477
  • 14
  • 111
  • 80
0
[WindowsVolume][Manufacturer]\[ProductName]
Adarsh Babu PR
  • 179
  • 1
  • 5