[英]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. 我有一些文档要安装(使用安装程序项目)到每个人都可以访问的Windows 7系统上。 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. 我认为最好的位置是C:\\ Users \\ Public或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. 由于安装项目中的这两个文件夹都没有特殊的文件夹,因此到目前为止,我发现的唯一方法是创建一个自定义文件夹,并将DefaultLocation设置为[%public] [Manufacturer] [ProductName]等。
(see http://community.flexerasoftware.com/archive/index.php?t-164246.html ) (请参阅http://community.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? 此外,这是否可以在Windows 7的其他语言版本上使用? Is there a better way to define the DefaultLocation to the Public folder for a Windows 7 install? 是否有更好的方法将Windows 7安装的DefaultLocation定义到Public文件夹?
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. Luviana的建议要简单得多。 I would test them out and see if they break the %public% shortcut. 我将对其进行测试,看看它们是否打破了%public%快捷方式。 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. 我最好的建议是亲自检查一下,如果它仍然有效,那么您可以指望%public%可用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.