简体   繁体   English

设置和部署项目中系统驱动器的默认位置

[英]Default Location to System Drive in Setup and Deployment Project

I have a setup and deployment project in Visual Studio 2010我在 Visual Studio 2010 中有一个安装和部署项目

The default location of Application Folder is set to C:\\[Appname]应用程序文件夹的默认位置设置为 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.问题是,如果安装应用程序的机器中没有 C: 驱动器,安装程序将崩溃并显示错误“ 'xxxxxxxx' 不是有效文件名”或类似错误,因为安装程序会在安装之前验证位置用户有机会设置实际的应用程序安装文件夹。 (so the default location is validated and since drive c: is missing it throws this error) (因此验证了默认位置,并且由于驱动器 c: 丢失它会引发此错误)

You can set the location to something like [ProgramFilesFolder] \\[AppName] etc..您可以将位置设置为[ProgramFilesFolder] \\[AppName] 等。

I would like to know what is the "macro" for the system's windows drive !我想知道系统的windows驱动器的“宏”是什么! 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!我希望像[WindowsDrive][SystemDrive]或类似的东西,以便我可以将默认位置设置为[SystemDrive]\\[Appname] ,例如!

Does anybody know?有人知道吗?

我认为http://msdn.microsoft.com/en-us/library/aa372057.aspx包含您正在寻找的信息(对于 .NET 3.5,其他框架可能有所不同)。

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?如何将默认位置设置为 WindowsVolume?

  • Use the WindowsVolume property.使用 WindowsVolume 属性。

Example:例子:

有关如何更改默认位置的屏幕截图

Hope this helps.希望这可以帮助。

[WindowsVolume][Manufacturer]\[ProductName]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Studio 2010安装项目:如何设置默认安装位置中使用的公司名称? - Visual Studio 2010 setup project: How to set company name used in default install location? 如何在安装和部署项目中包含依赖项? - How to include dependencies in Setup and Deployment Project? 安装和部署项目添加注册表项 - Setup and Deployment project adding a registry key 在设置和部署项目中设置表单的代码页 - Set codepage of forms in a setup and deployment project Visual Studio设置项目是否在同一位置更新? - visual studio setup project updating at same location? Visual Studio安装程序系统控件的本地化 - Visual Studio Setup Project Localization of System Controls 如何确定Visual Studio安装和部署项目的先决条件? - How to determine Visual Studio Setup and Deployment project prerequisites? 针对Windows 2000的Visual Studio 2010安装/部署项目 - Visual Studio 2010 Setup/Deployment Project targeting Windows 2000 Visual Studio 2010安装和部署项目模板在哪里 - Where is the visual studio 2010 setup and deployment project template 用于“安装和部署Visual Studio”的自定义安装项目-如何获取.msi文件所在的文件夹的内容? - Custom setup project for “Setup and Deployment Visual Studio”- How to get the contents of the folder where the .msi file resides?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM