Hello,
To create an installer for my juce application I am using CPack with NSIS. My application generate .myExt files to save its data. And I want .myExt files to have a fancy icon.
To do so, for what I understand, I need to do this with CPack :
set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "
WriteRegStr HKCR '.myExt' '' 'myfile'
WriteRegStr HKCR 'myfile' '' 'MyApp Document'
WriteRegStr HKCR 'myfile\\\\DefaultIcon' '' '$INSTDIR\\\\bin\\\\${EXECUTABLE_NAME}.exe,0'
WriteRegStr HKCR 'myfile\\\\shell\\\\open\\\\command' '' '$INSTDIR\\\\bin\\\\${EXECUTABLE_NAME}.exe %1'
WriteRegStr HKCR 'myfile\\\\shell\\\\print\\\\command' '' '$INSTDIR\\\\bin\\\\${EXECUTABLE_NAME}.exe /p %1'
WriteRegStr HKLM 'Software\\\\RegisteredApplications' '${EXECUTABLE_NAME}' '$INSTDIR\\\\bin\\\\${EXECUTABLE_NAME}.exe'
WriteRegStr HKCU 'Software\\\\RegisteredApplications' '${EXECUTABLE_NAME}' '$INSTDIR\\\\bin\\\\${EXECUTABLE_NAME}.exe'
WriteRegStr HKCU 'Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Explorer\\\\FileExts\\\\.myExt\\\\OpenWithList' 'a' '$INSTDIR\\\\bin\\\\${EXECUTABLE_NAME}.exe'
")
The important line is :
WriteRegStr HKCR 'myfile\\\\DefaultIcon' '' '$INSTDIR\\\\bin\\\\${EXECUTABLE_NAME}.exe,0'
The index at the end of the file is the one of the icon I want to use. It is specified in the .rc files of the application.
Here is my problem, the cmake api of Juce already generate and link a rc file. I cannot generate and use my custom .rc file. If I use the index 0 or 1, it will use the application icon ICON_BIG or ICON_SMALL specify in :
juce_add_gui_app(${EXECUTABLE_NAME}
ICON_BIG "${PLACEHOLDER_DIR}/icon_big.png" # ICON_* arguments specify a path to an image file to use as an icon
ICON_SMALL "${PLACEHOLDER_DIR}/icon_small.png"
)
Is there a way to specify a third icon in the juce rc file ?
Should I use another method to link a fancy icon to my .myExt files ? Which one ?
Thank you for your help.
