在 VisualStudio 环境中将第一个自定义对话框添加到 WIX [英] Adding first custom Dialog Box to WIX in VisualStudio environment
问题描述
我正在使用 Visual Studio 构建我的 wix 文件.到目前为止,我有一个文件 Product.wxs,它可以进行简单的安装.
I'm using Visual Studio to build my wix file. So far I have one file Product.wxs and it's working for a simple install.
现在我想添加一些自定义对话框.我想从下面的两篇文章中,我明白了如何去做——在我设置好我的环境之后:
Now I want to add some custom dialogs. I think from the two articles below, I understand how to do it - after I get my environment set up:
http://blog.torresdal.net/2008/10/24/WiXAndDTFUsingACustomActionToListAvailableWebSitesOnIIS.aspx和http://www.merlinia.com/mdt/WiXTutorial2.msl
我下载了源代码,我在这个目录中看到了 35 个 *.wxs 文件wix35-sources.zipsrcextUIExtensionwixlib
I downloaded the source, and I see 35 *.wxs file in this directory wix35-sources.zipsrcextUIExtensionwixlib
这是我开始迷路的地方.
This is where I'm starting to get lost.
我是否需要将一些(仅我想要更改的)或所有这些文件复制到我的 Visual Studio 项目中.到目前为止,我一直没有使用这些源文件.
Do I need to copy some (only the ones I want to change) or all these files to my Visual Studio Project. Until now, I have been running with none of these source files.
我的 Product.wxs 如何知道使用这些文件?它首先查看本地目录吗?还是我必须重建一些 C# 模块?
How does my Product.wxs know to use these files? Does it look at local directory first? Or do I have to rebuild some C# modules?
我在我的 Product.wxs 中包含了这些行,它在执行时为我提供了用户界面:
I included these lines in my Product.wxs, and it gave me the user interface at execution time:
<UIRef Id="WixUI_Mondo" />
<UIRef Id="WixUI_ErrorProgressText" />
谢谢,
尼尔
推荐答案
我是否需要将一些(仅我想要更改的)或所有这些文件复制到我的 VisualStudio 项目.到目前为止,我一直在运行这些源文件.
Do I need to copy some (only the ones I want to change) or all these files to my VisualStudio Project. Until now, I have been running with none of these source files.
由于您已经在使用 WixUI_Mondo
,我假设您想要自定义该 UI.在 wix 源中找到 WixUI_Mondo.wxs
,并将其复制到您的 Visual Studio 项目中.将文件重命名为 WixUI_MyCustomUI.wxs
并将文件内的 UI Id 属性更改为 Id="WixUI_MyCustomUI"
.您还不需要复制任何其他文件;复制的 UI 序列中引用的对话框作为资源编译到 wix 工具中,因此 wix 通过名称知道"这些对话框.
Since you are already using WixUI_Mondo
, I assume you want to customize that UI. Locate WixUI_Mondo.wxs
in the wix sources, and copy that to your visual studio project. Rename the file to WixUI_MyCustomUI.wxs
and change the UI Id attribute inside the file to Id="WixUI_MyCustomUI"
. You don't need to copy any other files yet; the dialogs referenced in the copied UI sequence are compiled into the wix tools as resources, so wix "knows" these dialogs by name.
在您的 product.wxs 文件中,将 UI 引用更改为 <UIRef Id="WixUI_MyCustomUI"/>
.如果您现在重新构建您的设置,UI 应该仍然看起来与 WixUI_Mondo
完全相同,因为我们还没有自定义任何东西.
In your product.wxs file, change the UI reference to <UIRef Id="WixUI_MyCustomUI" />
. If you now rebuild your setup, the UI should still look exactly as WixUI_Mondo
as we haven't customized anything yet.
如果可行,您可能需要自定义或添加一个对话框.同样,您可以通过从 wix 源复制现有对话框来开始.您还必须编辑 WixUI_MyCustomUI.wxs
文件,以便它使用您的新对话框.看看这个 其他答案我写了一个例子.
If that worked, you'll probably want to customize or add a dialog. Again, you can start from an existing dialog by copying it from the wix sources. You'll also have to edit the WixUI_MyCustomUI.wxs
file so that it uses your new dialog. Take a look at this other answer I wrote for an example.
我的 Product.wxs 如何知道如何使用这些文件?看当地的吗目录第一?还是我必须重建一些 C# 模块?
How does my Product.wxs know to use these files? Does it look at local directory first? Or do I have to rebuild some C# modules?
您没有重建任何 C# 模块.您下载 wix 源代码的唯一原因是现有的 UI 序列和对话框是很好的示例.原则上,您也可以忽略 wix 源并从头开始为 UI 序列和对话框定义编写这些 wxs 文件.
You do not have rebuild any C# modules. The only reason you downloaded the wix sources is because the existing UI sequences and dialogs are good examples to start from. In principle you could also ignore the wix sources and write these wxs files for the UI sequence and dialog definitions from scratch.
当您使用命令行工具时,您只需传递多个文件参数即可组合多个 wxs 文件,它们将被编译并链接在一起.如果您将 wix 与 Visual Studio 一起使用,则只需将 wxs 文件添加到项目中.一个重要的 wix 设置通常由许多 wxs 文件定义.
When you use the command line tools, you combine multiple wxs files by simply passing multiple file arguments and they will be compiled and linked together. If you use wix with visual studio, you just have to add the wxs file to the project. A non-trivial wix setup will typically be defined by many wxs files.
一个wxs文件的内容可以通过UIRef
、ComponentRef
、ComponentGroupRef
、DirectoryRef
等等.
The content of a wxs file can container references to elements in other wxs files through elements such as UIRef
, ComponentRef
, ComponentGroupRef
, DirectoryRef
etcetera.
这篇关于在 VisualStudio 环境中将第一个自定义对话框添加到 WIX的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!