If you have had a look at the documentation you’ve probably noticed a few elements like “ServiceInstall”, “User” and “WebVirtualDir”. What these elements all have in common is that if you add them to a wix document they will compile and link with out any problem, but they will not do anything at all on installation. If you take a closer at the msi produced using the reason they do nothing becomes clear, for example the User elements generates a table called user in the Msi and if you read the windows installer documentation you will quickly see there is no User table defined.
<?xml:namespace prefix = o ns = “urn:schemas-microsoft-com:office:office” />
But why go to all the bother of putting these elements into the wix schema if they don’t do anything? They are there because they are designed to work with the wix custom action dlls, that is “scasched.dll” and “scaexec.dll”. The idea behind these is that common task such as creating users, installing services and virtual directories have been given there own set of wix commands even though they are not natively supported natively by the windows installer. I think this is a really good idea, but there is a down side, which I’ll cover towards then end of this post.
To make these elements work correctly you have to follow a number of steps that I have not seen documented anywhere. First of you need include the dll from the wix\ca in you’re install script, this is done with the following wix syntax (paths make of course vary depending on you’re install):
Next you need to try out the wix code to call into the correct custom action for the kind of elements you’re adding. Again I’ve not see this documented anywhere, but you can find what you need to know form the “scasched.cpp” file in the fix source. If you were trying to add a user then you would need the following CustomAction tag to call into the write bit of code.
You also need to specific when the custom action should be called; here is an easy to do this.
In all there are 6 custom action entry points listed in the source file “scasched.cpp”, these are: ConfigureIIs
It is not entry clear which elements in wix these map, although they all probably map to sets of elements that will not work with out calling into code in the custom action dlls. It is important to note that these are sets of elements not individual elements. Some are fairly obvious; for example instal using any element prefixed with web needs to call into the ConfigureIIs custom action and ConfigureUsers action has three elements that will not work with out it, these are User, Group and GroupRef. However it’s odd that these is both ConfigurePerfmonInstall and ConfigurePerfmonUninstall where as the others just have one action. Also there appears to be a customaction missing as the element ServiceArgument, ServiceConfig, ServiceControl, ServiceDependency, ServiceInstall have no equivalent in the window install documentation, yet there is no customaction for them. I’m going to try and work out exactly what maps to what and list in a later blog entry.
As I have menationed there is a down side to these none native elements. They don’t work very well. I’ve being trying to use them to install a user and it just isn’t working. I’ve put together this short sample that should install a local user, but it does not, it breaks with some very obscure errors. Create a log of the msi action clear show that the entires from the user table are being used, but don’t really reveal why it fails. Here is an excerpt log of the msi:
Action start <?xml:namespace prefix = st1 ns = “urn:schemas-microsoft-com:office:smarttags” />
MSI (s) (F4:F0): Creating MSIHANDLE (33) of type 790542 for thread 2544
ConfigureUsers: Error 0x8007065a: Failed MsiDoAction on deferred action
ConfigureUsers: Error 0x8007065a: failed to schedule RemoveUser
ConfigureUsers: Error 0x8007065a: failed to add/remove User actions
Can any one explain this error? Answers on a post card …
Feedback was imported from my only blog engine, it’s no longer possible to post feedback here.
re: Installing Services, User, Virtual Directories etc. using Wix - Paul Gunn
Thanks for the information - it was very helpful in getting me started. I ran into the same issue as you and on investigation, it seems that the main configure functions are basically setting up a number of deferred actions, but the actions themselves need to be predefined. The easy way to do this is to link the sca.wixlib file in the ca directory (this file was apparently added sept. 10). Once I did that, things started working for me.
re: Installing Services, User, Virtual Directories etc. using Wix - Eric Bowen
FYI: None of your XML code samples are showing up in the post (I dug around in the source to find them ;-)