Archiv für April 28th, 2007

WiX: PatchFamily patch filtering

Saturday, 28. April 2007 at 5:36 am

Using the Patch system in WiX 3.0 allows you to select which differences between 2 builds you want to ship. By default, all the changes will go into a patch, but sometimes people want to ship a targeted update to fix a security issue or major customer problem. This can be done using the PatchFamily concept built into WiX.


A patch family has 2 meanings in this context, it specifies which changes you would like in any given patch, and also provides a mechanism for supercedence and dependency tracking. I’m not going to get into supercedence here other than to say that for each patch family in a patch will get an entry in the MsiPatchSequence table.


The PatchFamily element is a child of the Patch element. You can have as many PatchFamily elements in a Patch as you want. Under a PatchFamily element, there is a set of Reference elements that can be used to pull various items into your patch. Just as in your product authoring, referencing anything in a Fragment will result in that entire fragment being pulled in. WiX will handle file and media sequencing as well as the Sequence tables for you.


Example:


This PatchFamily would select the Fragment that contains the Component “MyComponent” and add it to the patch.


<PatchFamily Id=”MyPatchFamily” supercede=”yes”>
    <ComponentRef “MyComponent” />
</PatchFamily>


Sidenote:


One thing to note is that there are rules about patch families. Once you ship a patch family, you must keep its references the same or add to it (grow it) but never remove items from it. All items in your product must be a part of only one patch family. When you change the build that you are targeting (re-baseline), patch families start over so you can change the contents and asociations at this time.

Original post by Petermarcu

Abgelegt von WiX
von bingen

WiX: Functional Preprocessing

Saturday, 28. April 2007 at 5:27 am

The preprocessor in WiX has a new feature called Functional Preprocessing. It is a way for WiX users to define functions that they can use in their authoring to dynamically fill in content.


 Most people who use WiX are familiar with preprocessor variables which look like:


 ”$(var.VariableName)”


 The preprocessor now has support for functions in addition to variables which look like:


“$(func.FunctionName(arg1,arg2,arg3))”


While there have been no additions as of yet to the standard WiX preprocessor function library many functions have been implemented and are being used in people’s preprocessor extensions. In an extension you tell the preprocessor that you would like to have all functions with a specific qualifier be handled by your extension.


Example:


Say you want to keep track of all of your component GUID’s in a single file. The file has 4 pieces of data for each GUID. Id, Language, Architecture, and of course the GUID.


MyComponentId, English, Intel, 365453-34235-32525-23325345223


If you implement a preprocessor extension to handle ”guid” functions and define a function called “GetGuid” that takes 3 arguments you could represent the guid in your authoring as:


“$(guid.GetGuid(MyComponentId,English,Intel))”


This function would be replaced in your authoring with “365453-34235-32525-23325345223″.


 There are a lot of possible uses of this type of functionality. I’d love to hear how other people use it.

Original post by Petermarcu

Abgelegt von WiX
von bingen