CPack: Application not added to Start Menu if extension included in CPACK_PACKAGE_EXECUTABLE entries
The original bug report is below. This turned out to be a misunderstanding due to docs for CPACK_PACKAGE_EXECUTABLE
not being clear on its usage. The underlying problem is that CPACK_PACKAGE_EXECUTABLE
expects the application name to be given without any path or file extension. Specifically, on Windows you must not add the .exe
or .com
extension.
The docs for CPACK_PACKAGE_EXECUTABLE
should be improved to make this clear.
Original bug report
Consider the following fairly minimal reproducer project:
cmake_minimum_required(VERSION 3.27)
project(MyProj VERSION 1.3.29)
add_executable(MainApp main.cpp)
install(TARGETS MainApp)
set(CPACK_PACKAGE_NAME MyProj)
set(CPACK_PACKAGE_VENDOR MyCompany)
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Example Inno Setup project")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}")
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
set(CPACK_VERBATIM_VARIABLES YES)
set(CPACK_GENERATOR INNOSETUP)
set(CPACK_PACKAGE_EXECUTABLES
"MainApp.exe" "Compulsory MyProj app"
)
include(CPack)
My understanding of the CPack Inno Setup Generator docs is that this should result in a folder in the Start Menu with the name "MyProj", and there should be an entry under that with the name "Compulsory MyProj app" that runs MainApp.exe
. However, neither of those is created. It seems like nothing is added to the Start Menu at all.
If you add a separate item as a link menu item, that does work:
set(CPACK_INNOSETUP_MENU_LINKS
"https://cmake.org" "CMake Web Site"
)
The menu link results in the folder being created in the Start Menu and the expected link under it as well. But still no entry for MainApp.exe
.