关闭

wix-tallow使用

标签: wixfilecomponentsinstallerredirectencoding
2686人阅读 评论(0) 收藏 举报
分类:

又整合了两篇文章,关于使用tallow.exe的

近时不断深入研究Wix,终于将setup的界面部分搞懂,并制做了一个比较好看的界面。接下来就是要制做文件表。

看了这么久的Wix,我知道需要使用工具tallow.exe制作文件表。我还没用过,试用了一下,果然极其好使。它会将源目录下所有文件找出来列表,并自动生成wxs文件,它是一个Fragment。
用完之后,发现不能卸载这些文件,觉得应该是GUID的问题。前些时候一直关注Wix的文章,依稀记得以前看贴的时候有人就发现tallow.exe不能产生GUID的BUG,于是就翻出这篇文章照着改。果然有效。
改完后运行一下wix源文件根目录下的make.bat,它就自动将Wix toolset编译了一次。看着命令行编译,似乎与Linux下的差不多,呵呵~也挺好使的,用惯了图形界面编译,感觉有些别钮。
完了后用了新的tallow,非常好,能生成GUID了。
想想e Joel Test的软件开发成功 12 法则,第二条,你们可以把整个系统从源码到CD映像文件一步建成吗?现在我可以有把握地回答:“是”了,虽然暂时还没有实现。

WiX Tips and Tricks: Part 2 - Tallow, Component GUID's and Uninstallation
Included with the WiX toolset is a tool called Tallow.  This tool is meant for the purpose of walking a directory tree to produce valid Fragments containing Directories, Components and Files.  Unfortunately though, when using the tool you don't get a "Guid" attribute on each "Component" element as seen in the below example:

C:/wix>tallow -d ./doc -nologo
<Wix xmlns="http://schemas.microsoft.com/wix/2003/01/wi">
  <Fragment>
    <DirectoryRef Id="TARGETDIR">
      <Directory Id="directory0" Name="doc">
        <Component Id="component0" DiskId="1">
          <File Id="file0" Name="vssver2.scc" src="C:/wix/doc/vssver2.scc" />
          <File Id="file1" Name="WiX.chm" src="C:/wix/doc/WiX.chm" />
          <File Id="file2" Name="wix.xsd" src="C:/wix/doc/wix.xsd" />
          <File Id="file3" Name="wixloc.xsd" src="C:/wix/doc/wixloc.xsd" />
        </Component>
      </Directory>
    </DirectoryRef>
  </Fragment>
</Wix>

This in turn causes a problem on eventual uninstallation of the generated MSI - as there are no component Guid's, Windows Installer doesn't know which files to remove!

Enter Stefan Zschocke's "Mallow" tool available from http://www.infozoom.de/download/Mallow.zip.  This tool overcomes the limitations of Tallow - and also adds synchronisation functionality - the tool can be run with an existing .wxs file as input, any extra files will be added and existing component Guid's will be preserved.


C:/wix>mallow -d ./doc
<?xml version="1.0" encoding="IBM437"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2003/01/wi">
  <!--Mallow protocol 10/12/2005 18:48:45
  Added     Component Id=component0 Path=
  -->
  <Fragment>
    <DirectoryRef Id="TARGETDIR">
      <Component Id="component0" Guid="ec4d2b48-28f5-4c3d-bf02-ebc1d490177f" DiskId="1">
        <File Id="file0" Name="vssver2.scc" src="C:/wix/doc/vssver2.scc" />
        <File Id="file1" Name="WiX.chm" src="C:/wix/doc/WiX.chm" />
        <File Id="file2" Name="wix.xsd" src="C:/wix/doc/wix.xsd" />
        <File Id="file3" Name="wixloc.xsd" src="C:/wix/doc/wixloc.xsd" />
      </Component>
    </DirectoryRef>
  </Fragment>
</Wix>

Update: Actually, Rob Mensching has updated SourceForge to say that this functionality has now been added to Tallow, see http://sourceforge.net/tracker/index.php?func=detail&aid=1120401&group_id=105970&atid=642717 - and as Rob mentions in his blog post, they are gearing up to push another release to SourceForge imminently including MSI 4.0 support.


You have to redirect the output, and you will also want to strip the logo.

tallow -nologo -d c:/drop > mywixfile.wxs

I would recommend going over the generated file very carefully before
trying to use it in a build process (IIRC, it will not place GUID's in
components, and may not even be buildable in it's initial form).


 

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:101500次
    • 积分:1197
    • 等级:
    • 排名:千里之外
    • 原创:13篇
    • 转载:27篇
    • 译文:0篇
    • 评论:11条
    最新评论