# CPACK\_WIX\_TEMPLATE function

**URL:** <https://discourse.cmake.org/t/cpack-wix-template-function/6850>\
**Category:** Code\
**Tags:** os:windows\
**Created:** [November 12, 2022, 12:30am UTC](https://discourse.cmake.org/t/cpack-wix-template-function/6850 "2022-11-12T00:30:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alice](https://discourse.cmake.org/user_avatar/discourse.cmake.org/alice/32/1615_2.png) [@alice](https://discourse.cmake.org/u/alice)\
**Post date:** [November 12, 2022, 12:30am UTC](https://discourse.cmake.org/t/cpack-wix-template-function/6850/1 "2022-11-12T00:30:40Z")

</div>

Hi,  
I try to use cpack to process the wix.

And the WIX.template.in is reference on

> <https://github.com/Kitware/CMake/blob/master/Utilities/Release/WiX/WIX.template.in>

```auto
    set(CPACK_WIX_TEMPLATE ${CMAKE_CURRENT_SOURCE_DIR}/cmake/wix.template.in)
    set(CPACK_WIX_EXTENSIONS "WixUtilExtension")

```

Then I found it will generate the directories.wxs automatically when buiding .

The directories.wxs show the dir structure.  
It doesn’t match the structure.  
The place that [CMake/WIX.template.in at master · Kitware/CMake · GitHub](https://github.com/Kitware/CMake/blob/master/Utilities/Release/WiX/WIX.template.in#L41)

I add the Define the directory structure, like this [How To: Add a File to Your Installer](https://wixtoolset.org/documentation/manual/v3/howtos/files_and_registry/add_a_file.html)
