开发者

Copying multiple files using wildcards/recursively using Wix

I'm a total noob on Wix (and installers in general) so please forgive me.

My goal is to be able to traverse a directory, search for all, say, *.exe files and copy them to a predefined destination folder. Thing is, I don't know what these files are and their names so I can't type them out one by one in the wxs file... hence wildcards.

Now, I ended up with something like this:

...
<Directory Id='TARGETDIR' Name='SourceDir'>
      <Directo开发者_StackOverflowry Id='ProgramFilesFolder' Name='PFiles'>
        <Directory Id='MyDir' Name='TestProj'>
          <Component Id='MyComponent' Guid='PUT_GUID_HERE'>
            <CopyFile Id="CopyFiles" DestinationProperty="DESTDIR" SourceName="*.exe" SourceProperty="SRCDIR" />
          </Component>
        </Directory>
      </Directory>
</Directory>
...

Well, this is ok if I'm reading only from SRCDIR but what if there are subfolders? How do I go down looking for files with a certain extension? Or is there another way of doing this...?

Same thing with removing those same files after the installation...

Thanks a bunch for any help you can give!


A way to do this is using John Robbin's command line tool Paraffin. It goes automatically through the directories you select and creates a WiX fragment that references these files. Paraffin is great for this since it supports adding new files later without creating new GUIDs for the old files - i.e. it supports an evolving project.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜