Home
Support
通过Microsoft Visual Studio 2003/2005发布Measurement Studio的应用程序
通过Microsoft Visual Studio 2003/2005发布Measurement Studio的应用程序
主要软件:
主要软件版本: 8.0.1
主要软件修正版本: N/A
次要软件: Measurement Studio>>Measurement Studio for Visual C++, Measurement Studio>>Measurement Studio for Visual Basic 6, Measurement Studio>>Measurement Studio for Visual C++, Measurement Studio>>Measurement Studio for Visual Basic 6
问题: 我创建了一个包含Measurement Studio组件的.NET应用程序。我想将我的程序发布到另一台计算机上,该怎么做?
解答: 要使一个包含Measurement Studio组件的.NET应用程序能够正常的在目标计算机上运行,目标计算机上必须包括特定的Measurement Studio组件。
Microsoft Visual Studio .NET提供了安装和部署项目,从而使发布应用程序变得很简单。安装项目让您能够创建安装文件从而发布您的应用程序。生成的Windows安装文件(
.msi
)包含应用程序、所依赖的文件、诸如注册表之类的与应用程序相关的信息,以及安装说明。
按照下属的步骤可以使用Visual Studio 2003/2005创建一个包含所需的Measurement Studio组件的部署项目。
- 打开已有的Visual Studio项目或者例子程序。
- 编译并执行此windows应用程序,以确认应用程序没有错误。
- 在您已有的项目中添加一个新的项目:
- Visual Studio 2005 - 选择 File » Add » New Project.
- Visual Studio 2003 - 选择 File » Add Project » New Project.
- 在弹出的 Add New Project 对话框中::
- Visual Studio 2005 - 选择 Other Project Types » Setup and Deployment .
- Visual Studio 2003 - 选择 Setup and Deployment Projects.
- 在Templates面板,选择 Setup Wizard。
- 在Name框中,键入“My Installer”。
- 点击 OK 关闭对话框并打开助手。
- 点击 Next。
- 选择 Create a setup for a Windows Application 并点击 Next。
- 选中 Primary Output for [项目名称] 并点击 Next。
- 如果您的应用需要额外的文件,比如文本文件或者
.ini
文件,您可以添加它们并点击Next。
- 点击 Finish。
- 您可以通过选择View » Editor » File System或者在Solution Explorer中双击Primary Output from [项目名称]来打开File System Editor。默认情况下,File System Editor 只会显示代表了目标计算机上目录结构的一些标准的目录。(注:只有当部署项目在Solution Explorer中被选中时,File System Editor才可用。)
- 右键点击File System on Target Machine节点并选择Add Special Folder » Program Files Folder。(注:这样做可以避免在某些目标计算机上出现代码为2705的错误。)
- 选中 Detected Dependencies 以便确认所有的组建所用到的合并模块都已被添加到项目中。多数情况下,Visual Studio会自动的检测到合并模块,然后在有些情况下,Visual Studio却无法检测到它们。
- 如果您使用到ActiveX控件,请完成下列的子步骤,否则请跳至下一步。
- 右键单击“My Installer”安装项目,并选择 Add » Merge Module。
- 如果您用到了图形、滑动条,或者其他的用户界面控件,请添加
CWUI_OCX.msm
,如果您用到了3D图形控件,还请添加 CW3DGRAPH_OCX.msm
合并模块。这样就可以将所有的ActiveX空间所需的额外附属物添加进来了。Measurement Studio会把所有的合并模块安装在 \Common Files\Merge Modules
文件夹下。(注:如果你使用到了DAQ ActiveX控件,在运行安装程序或者您的应用程序之前,您还需要安装NI-DAQ对Visual Basic的支持。)
- 右键单击“My Installer”项目并选择 Rebuild。这样就会对包含了所有的附属物的安装文件进行编译。
- 欲将您的文件部署到另一台计算机上,打开Windows Explorer,定位到您的项目文件夹并找到已经编译好的安装文件。默认的路径是
\Documents and Settings\用户名\My Documents\Visual Studio\Projects\Solution Folder Name\My Installer\project configuration\My Installer.msi
。(默认的项目配置是Debug或Release。)
- 把My Installer.msi、Setup.exe,以及当前目录下的所有文件及子目录,复制到目标计算机上。
- 在目标计算机上,双击Setup.exe启动安装文件。(注:欲启动安装程序,您必须具有目标计算机上的安装权限。)
欲了解更多关于如何部署Measurement Studio应用程序,以及哪些合并模块所需要的内容,请参照Measurement Studio Documentation中“Deploying Measurement Studio Application”帮助话题。
相关链接: KnowledgeBase 3332LH42: Error -2705 from the MSI Installer Built with the Visual Studio .NET Installation Builder
KnowledgeBase 2W3G520Q: Distributing Measurement Studio ActiveX Applications
MSDN - Deploying a Windows Application
附件:
报告日期: 03/08/2007
最近更新: 03/26/2007
文档编号: 341AEOW3
Other Support Options
Ask the NI Community
Collaborate with other users in our discussion forums
Request Support from an Engineer
A valid service agreement may be required, and support options vary by country.