I am using cpack and Wix to create an MSI installer containing media files.
I am getting catastrophic failure, I read, due to cabinet file exceeding 2GB.
If I understand correctly, I can split the installation package into multiple CAB files.
Simplified CMakeLists.txt:
cmake_minimum_required(VERSION 3.14)
project(content 1.0.0 LANGUAGES CXX)
install(DIRECTORY video
DESTINATION "."
FILES_MATCHING REGEX ".+\.(avi|mp4)")
install(DIRECTORY images
DESTINATION "."
FILES_MATCHING PATTERN "*.png")
set(CPACK_WIX_PATCH_FILE "${CMAKE_CURRENT_SOURCE_DIR}/misc/wix_patch.xml")
include(CPack)
I am not sure if it is correct, but I can add more media elements in wix_patch.xml:
<CPackWiXPatch>
<CPackWiXFragment Id="#PRODUCT">
<Media Id='2' Cabinet='package1.cab' EmbedCab='no'/>
<Media Id='3' Cabinet='package2.cab' EmbedCab='no'/>
</CPackWiXFragment>
</CPackWiXPatch>
Now the question arises, how can I assign DiskId attribute to files included in the CMake file?
How can I split files into these cabinet files?
If I am correct, in Wix file I would write:
<File Source="./vid.mp4" DiskId="2" />
To assign vid.mp4 file to package2.cab.
How can I achieve that using CPack?