3
votes

I am having difficulty in understanding the concept of Custom Element of Wix. I read this and it says it is Used to sequence a custom action.

Now if you consider the follwing piece of Wix code:

<Binary Id="SetupCA"  SourceFile="..\..\ext_library\SetupCA\SetupCA\bin\Release\SetupCA.CA.dll"/>
<CustomAction Id="WRITEFILETODISK" Execute="immediate" BinaryKey="SetupCA" DllEntry="WriteFileToDisk" />
<InstallExecuteSequence>
   <Custom Action="WRITEFILETODISK" Sequence="2"></Custom>
</InstallExecuteSequence>

I want the Custom Action WRITEFILETODISK execute just before the MSI installs the file in my system. Even though I used Sequence=2, this is a bad way. So I must be using Before or After Attribute present in Custom tag. This website gives info on InstallExecuteSequence, but it is vague for newbie like me. Most developers uses CostInitialize, CostFinalize, InstallInitialize, InstallFinalize. So I want to know the difference between the above attributes and when to use them properly while making MSI Installer?

1

1 Answers

2
votes

This isn't too bad for the Install Execute stage:

http://www.advancedinstaller.com/user-guide/standard-actions.html

This:

http://blogs.technet.com/b/alexshev/archive/2008/02/21/how-windows-installer-engine-installs-the-installation-package.aspx

A typical order: http://msdn.microsoft.com/en-us/library/aa372038(v=vs.85).aspx

but you could always get Orca from the Windows Kit and look at the install sequences in the MSI file to see what specific order they have in your MSI files.

The big wrinkle is that the execute sequence has two phases that correspond to immediate ccustom actions (when nothing happens to the system) and deferred, when the changes actually happen. So to do something immediately before files are written to disk you'd have a deferred CA before InstallFiles.