CMP0172 — CMake 4.4.1 Documentation

# CMP0172

Added in version 3.31.

The `CPack` module enables per-machine installation by default in the `CPack WIX Generator`.

The `CPack WIX Generator`'s `CPACK_WIX_INSTALL_SCOPE` option controls the scope of the generated Windows Installer package. When `CPACK_WIX_VERSION` is set to 4 or higher, the default scope is `perMachine`. However, when using WIX 3 the default scope is `NONE`, and CPack does not set any `InstallScope` in the package specification. The resulting installer requires administrative privileges and installs into the system-wide `ProgramFiles` directory, but the start menu entry and uninstaller registration are created only for the current user.

The `CPack` module in CMake 3.30 and older does not specify any `CPACK_WIX_INSTALL_SCOPE` value by default, so CPack uses no installation scope by default with WIX 3. CMake 3.31 and newer instead prefer to set `CPACK_WIX_INSTALL_SCOPE` to `perMachine` by default to make the behavior consistent across all WIX versions. This policy provides compatibility for projects that have not been updated to expect `perMachine` behavior.

The `OLD` behavior for this policy is to not set `CPACK_WIX_INSTALL_SCOPE` by default. The `NEW` behavior for this policy is to set `CPACK_WIX_INSTALL_SCOPE` to `perMachine` by default.

This policy was introduced in CMake version 3.31. It may be set by `cmake_policy()` or `cmake_minimum_required()`. If it is not set, CMake does not warn by default, and uses `OLD` behavior.

See documentation of the `CMAKE_POLICY_WARNING_CMP0172` variable to control the warning.

Note

The `OLD` behavior of a policy is deprecated by definition and may be removed in a future version of CMake.