[CMake] custom nsis template- "Install targets" not working

Eric Noulard eric.noulard at gmail.com
Thu Mar 27 03:02:39 EDT 2014


2014-03-27 7:08 GMT+01:00 Lloyd <lloydkl.tech at gmail.com>:
> Hi,
>
> My CMake file contains the install comands like this
>
> install(TARGETS MyExe RUNTIME DESTINATION .)
>
> When I use the standard NSIS template, the installer is created with
> "MyExe". But our project needs a custom NSIS template so I have written one,
> and it is generating an installer *without* MyExe.
>
> So I made a comparison between my nsis template and the standard one.
>
> The one big difference I found is the presence of
>
> @CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS@
>  @CPACK_NSIS_FULL_INSTALL@
>
> after the SetOutPath "$INSTDIR" command. These above two variables seems to
> be undocumented.

>From the source code one can see that
CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS is empty unless the user provide
some value for it.

CPACK_NSIS_FULL_INSTALL is populated with "File /r
\"${INST_DIR}\\*.*\" unless the
user provide another value.

> When the standard nsis template is processed, these lines are changed to
>
> File /r "${INST_DIR}\*.*"

which corresponds to the source code default behavior.

> I am struck at this point, how can I make my install targets command work?
> Any hint or documentation would be greatly appreciated.

I am no NSIS expert so I can't imagine why 'File /r "${INST_DIR}\*.*"'
could possibly do ???

So I guess that if your template does not contain such command you
either need it
(and should use CPACK_NSIS_FULL_INSTALL in your template) or replace
it with something more appropriate to you case.

Now on the semantic,

CPACK_NSIS_FULL_INSTALL probably means "full install of all components"

you will find other CPACK_NSIS_*_COMPONENTS* var

CPACK_NSIS_INSTALLER_MUI_COMPONENTS_DESC
CPACK_NSIS_PAGE_COMPONENTS
CPACK_NSIS_COMPONENT_SECTIONS
CPACK_NSIS_COMPONENT_SECTION_LIST
...

See http://www.cmake.org/Wiki/CMake:Component_Install_With_CPack
for some explanation about component vs full/monolithic install with CPack.

-- 
Erk
L'élection n'est pas la démocratie -- http://www.le-message.org


More information about the CMake mailing list