# Is there a way to disable the INSTALL target in Visual Studio while still generating the cmake\_install.cmake for CPack? (Feature request?)

**URL:** https://discourse.cmake.org/t/is-there-a-way-to-disable-the-install-target-in-visual-studio-while-still-generating-the-cmake-install-cmake-for-cpack-feature-request/13383
**Category:** Development
**Tags:** gen:vs
**Created:** [January 13, 2025, 9:05am UTC](https://discourse.cmake.org/t/is-there-a-way-to-disable-the-install-target-in-visual-studio-while-still-generating-the-cmake-install-cmake-for-cpack-feature-request/13383 "2025-01-13T09:05:42Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![sasha2048](https://discourse.cmake.org/user_avatar/discourse.cmake.org/sasha2048/32/5270_2.png) [@sasha2048](https://discourse.cmake.org/u/sasha2048)
#### Post date: [January 13, 2025, 9:05am UTC](https://discourse.cmake.org/t/is-there-a-way-to-disable-the-install-target-in-visual-studio-while-still-generating-the-cmake-install-cmake-for-cpack-feature-request/13383/1 "2025-01-13T09:05:42Z")

</div>

Hello.

I think it’s a relatively popular case on Windows when the [`install(…)`](https://cmake.org/cmake/help/latest/command/install.html) command in a project is used only in conjunction with CPack – to create an installer. In such cases the INSTALL predefined target by itself is typically unable to install the project properly (especially when additional steps like addon/service registration are required) and therefore isn’t used.

There’s a [`CMAKE_SKIP_INSTALL_RULES`](https://cmake.org/cmake/help/latest/variable/CMAKE_SKIP_INSTALL_RULES.html) variable, however it prevents the `cmake_install.cmake` file from being generated at all (at least by usual means) and therefore breaks the creation of an installer (unless `cmake_install.cmake` is created by some other means a-la `file(WRITE cmake_install.cmake …)` or the installer itself is created by some alternative means a-la `add_custom_command(… COMMAND makensis …)`).

Is there way to just hide the INSTALL predefined target from Visual Studio but not disable the `cmake_install.cmake` generation? (Or, maybe, if we extend it to other platforms: to disable `install` target generation but not the `cmake_install.cmake` file generation.) Maybe I should create a feature request for that?

Thanks.
