January 5, 2012

How is upgrade code stored in the registry?

Did you wonder how is upgrade code stored in the registry? Its using the Darwin Transform..
 
A standard GUID requires 38 characters and contains 5 groups of hexadecimal characters separated by dashes. The valid format for a standard GUID is:
 {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
where X is a hex digit (0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F).
 
A packed GUID is an alternative representation that allows Windows Installer to reduce the space in the registry database when storing a GUID. A packed GUID requires only 32 characters. Its valid format is: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
where X is a hex digit.
 
A packed GUID can be obtained by applying a transform to a standard GUID. This transform performs the following operations:
* removes the curly braces and separating dashes from a standard GUID;
* writes the first three groups of hexadecimals characters in a standard GUID in reverse order;
* switches every two characters in the fourth and fifth group in a standard GUID.
This conversion procedure,is called Darwin Transform since its primary use is to construct a well-known Darwin Descriptor, which is a combination of the product code GUID, a feature name, and a component code GUID.