Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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'>
      <Directory 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!

like image 259
callie16 Avatar asked Oct 19 '10 08:10

callie16


1 Answers

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.

like image 127
steinar Avatar answered Nov 06 '22 00:11

steinar