tags:

views:

239

answers:

2

I'm writing a few WiX files today and there's a lot of repetitve typing involved, so it looks to me like Resharper's Live Templates would be very useful here. Does anyone know of any?

I know it's not too hard to write new Live Templates so I may end up answering my own question in a couple of hours, but if anyone can point me to pre-exisitng ones that would be great.

As an aside any other WiX editing tips would be appreciated:-)

+1  A: 

Are you using Votive? because then you get InteliSense when working on wxs.
if you are not using Votive then you can put the Wix XSD into Visual Studio XSD repository to get InteliSense.

Shay Erlichmen
Yep, am using Votive, but worth checking:-)
Steve Haigh
A: 

I actually only needed a couple of very simple ones...

For creating file components:

 <Component Id="C_$COMP_ID$" Guid="$GUID$">
        <File Id="F_$FILE_ID$" Name="$FILENAME$" />
 </Component>

I wired up $GUID$ to the "generate new guid" macro.

Then an even more simple one for creating directory entries:

<Directory Id="D_$DIR_NAME$" Name="$NAME$" />

The handy thing I found with the Live Templates was the ability to assign one of the fields to the clipboard value, so when adding a new file I could highlight the file's name and ctrl-C it to the clipboard and then run the template, but it only saves an tiny bit of typing.

I'll probably write a few more next time I'm editing WiX files, I'd be happy to share but they are so easy to write and customise to personal preference I'm not sure there's going to be a huge demand:-)

Steve Haigh

related questions