在Visual Studio环境中向WIX添加第一个自定义对话框 [英] Adding first custom Dialog Box to WIX in VisualStudio environment

查看:109
本文介绍了在Visual Studio环境中向WIX添加第一个自定义对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用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.zip \ src \ ext \ UIExtension \ wixlib

I downloaded the source, and I see 35 *.wxs file in this directory wix35-sources.zip\src\ext\UIExtension\wixlib

这是我开始迷路的地方.

This is where I'm starting to get lost.

  1. 我是否需要将某些文件(仅要更改的文件)或所有这些文件复制到我的Visual Studio项目中.到目前为止,我还没有运行过这些源文件.

  1. 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文件,它们将被编译并链接在一起.如果在Visual Studio中使用wix,则只需将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文件的内容可以通过诸如UIRefComponentRefComponentGroupRefDirectoryRef等元素的容器来引用其他wxs文件中的元素.

The content of a wxs file can container references to elements in other wxs files through elements such as UIRef, ComponentRef, ComponentGroupRef, DirectoryRef etcetera.

这篇关于在Visual Studio环境中向WIX添加第一个自定义对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆