1

I see that there is no CPACK_xxx variable for changing the wizard image(s) in NSIS (like CPACK_PACKAGE_ICON). So I copied the NSIS.template.in and modified it. I could do something like:

!define MUI_WELCOMEFINISHPAGE_BITMAP "C:\work\project\img\wizardInstall.bmp" !define MUI_UNWELCOMEFINISHPAGE_BITMAP "C:\work\project\img\wizardUninstall.bmp"

and it will work. However, the source code goes in a repository where many developers colaborate, and it's not really good idea to keep absolute paths there. I tried to find some way to get my source path, and somehow create the image path from that one, but to no avail.

So, if someone knows how can i set the wizard images in NSIS, or pass the source dir (and create the path from it) to my template file, please let me know.

Amy
  • 1,814
  • 2
  • 23
  • 38
  • You can try to modify your `NSIS.template.in` file while running `cmake` using [file](http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:file) command. For example: `file(APPEND NSIS.template.in !define FILEID ${PROJECT_SOURCE_DIR}/path/to/file !define)` – beduin May 17 '11 at 09:17
  • I could modify the file this way.. or even better, copy it and then append to the copy. However, then the defines will end-up at the bottom of the script resulting in something like: MUI_WELCOMEFINISHPAGE_BITMAP is already defined (even though i have taken out the definition of it)... Although even if it didn't result in a preprocessing error, it still comes after the !insertmacro for MUI. – Amy May 17 '11 at 19:24

2 Answers2

1

Since you are already customizing the NSIS.template.in file, and it is a template presumably configured with the CONFIGURE_FILE() command, why not put the following in to your NSIS.template.in:

!define MUI_WELCOMEFINISHPAGE_BITMAP "@MY_CPACK_MUI_WELCOMEFINISHPAGE_BITMAP@"
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "@MY_CPACK_MUI_UNWELCOMEFINISHPAGE_BITMAP@"

Then, in your CMakeLists.txt file where you set your other CPACK variables, add something like:

SET(MY_CPACK_MUI_WELCOMEFINISHPAGE_BITMAP
    "${CMAKE_SOURCE_DIR)/path/to/wizardInstall.bmp")
SET(MY_CPACK_MUI_UNWELCOMEFINISHPAGE_BITMAP
    "${CMAKE_SOURCE_DIR)/path/to/wizardUninstall.bmp")
Chris Morlier
  • 360
  • 1
  • 9
  • 1
    Thanks. But it seems these variables must have only "CPACK" prefix. Otherwise CPack ignores them and they would have an empty value in nsi. – brighteyed Sep 11 '12 at 11:34
  • the path is not defined correctly, see: http://www.cmake.org/pipermail/cmake/2008-June/022085.html – malat Feb 27 '15 at 15:26
0

You do not need to compile whole NSIS to use/change these images.

They are present on every machine which has NSIS installed in ${NSISDIR}\Contrib\Graphics\Wizard\win.bmp

Use !define MUI_WELCOMEFINISHPAGE_BITMAP bmp_file in your .nsi script to change them.

Slappy
  • 5,250
  • 1
  • 23
  • 29