[CMake] CPack WIX examples

Nils Gladitz nilsgladitz at gmail.com
Wed Sep 24 03:17:33 EDT 2014


On 24.09.2014 02:40, jmerkow wrote:
> It seems the best way to do this would be to override the template with a
> number of configurable entries?
> So I could add something like (there's about 15 of em):
> <Registry Id='regid7' Root='HKLM' Key='Software\@proj_name@\@proj_name@
> @proj_FULL_VERSION@' Name='HomeDir' Action='write' Type='string'
> Value='[INSTALL_ROOT]@home_path@' />
>
> I wanted to check to see if there was a way to handle this directly from
> CMake.
>

The <Registry> elements will require a <Component> parent and that 
component needs to be referenced by an existing feature.
I've used CPACK_WIX_PATCH_FILE (e.g. the fragment_injection example) to 
insert similar content into existing components.
The patch file could also be configured by configure_file().

If you need this to be an independent <Component> I suppose you could 
use your own template,
add the <Component> (and its <Registry> childen) to the <Product> 
element and add a reference
to it from within the existing <FeatureRef Id="ProductFeature"/> element.

Nils




More information about the CMake mailing list