How to install to the Public directory in Windows 7 from the VS 2010 deployment Setup Project
I have some documents I want to install (using the Setup project) onto a Windows 7 system which is accessible by everyone. These documents should not be hidden. They should be visible for all users to double click on. I believe the best place for this is C:\Users\Public or C:\Users\Public\Documents.
Since there isn't a special folder for either of these folders in the Setup project, the only way I have found so far is to create a custom folder and set the DefaultLocation to [%public][Manufacturer][ProductName] etc.
(see http://com开发者_如何学运维munity.flexerasoftware.com/archive/index.php?t-164246.html)
However, this seems very brittle; what if someone deletes the environment variable for public? Also, would this work on a different language version of Windows 7? Is there a better way to define the DefaultLocation to the Public folder for a Windows 7 install?
The public folder isn't stored in a standard environment variable (System -> Advanced -> Environment Variables) so I think it is very unlikely too many people are doing this, but I understand the need to create a robust installer.
This page has instructions on changing the location of the public folder. The accepted solution is quite involved and requires command line work. The suggestion by Luviana is much simpler. I would test them out and see if they break the %public% shortcut. My guess is that they will not. My best advice is to check it out for yourself and if it still works then you can count on the fact that %public% will be available.
精彩评论