Monday, October 27, 2008

Can I has user created by WiX?

Ok. I'm starting to get this stuff figured out.

The User tag is part of WixUtilExtension.dll but it is not enough to simply reference WixUtilExtension on the command line.

You must also add an XML name space reference in the .wxs file. Also, another gotcha. The namespace spelling is different from the WixUtilExtension spelling. D'oh!

I had to add the following:



   1:  <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"

   2:       xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">



Now, the User tag that I created has to have the "util" prefix to let the linker know that the User tag is being referenced for the WixUtilExtension:



   1:  <Component Id="RequiredUser" Guid="{SUPER-DUPER-GUID}">

   2:    <util:User Id="UserStuff" Name="UserStuff" Password="supersekrit" />

   3:    <CreateFolder/>

   4:  </Component>



Notice that I had to add the CreateFolder tag in my User tag to prevent error ICE18. Otherwise, it'll fail and make me cry.

I was able to link with candle with a "-ext WixUtilExtension.dll" reference and the wixobj was created and with the CreateFolder I avoided the dreaded ICE18 error. I was also able to create my .msi and I will test that tomorrow on my VM.

Wasn't that all intuitively obvious?

My thanks go out to the wix-users listserv that pointed out where I was banging my head against the brick wall of wix. Now with this information I should be able to go forward with the other tasks required and be a tad bit more efficient with WiX (Finally!).

No comments: