Hello,

I would like to do this kind of installation:

My package contains several executable with a version number by application

- first install: install all the application and write a version number into 
the windows registry

- update install: install only the application which have a greater version 
number.

I tryied the following example:

project (Test)

cmake_minimum_required (VERSION 2.6)

set(TEST_MAJOR 1)
set(TEST_MINOR 1)
set(TEST_REVISION 1)

get_filename_component(REG_TEST_MAJOR 
[HKEY_LOCAL_MACHINE\\Software\\Arpack\\Test;Major] NAME)
get_filename_component(REG_TEST_MINOR 
[HKEY_LOCAL_MACHINE\\Software\\Arpack\\Test;Minor] NAME)
get_filename_component(REG_TEST_REVISION 
[HKEY_LOCAL_MACHINE\\Software\\Arpack\\Test;Revision] NAME)

message(STATUS "TEST_MAJOR    = in registry - ${REG_TEST_MAJOR} - in cmake - 
${TEST_MAJOR}")
message(STATUS "TEST_MINOR    = in registry - ${REG_TEST_MINOR} - in cmake - 
${TEST_MINOR}")
message(STATUS "TEST_REVISION = in registry - ${REG_TEST_REVISION} - in cmake - 
${TEST_REVISION}")

set(REG_VERSION "${REG_MAJOR}.${REG_MINOR}.${REG_REVISION}")
set(VERSION "${MAJOR}.${MINOR}.${REVISION}")

if ((${REG_VERSION} VERSION_LESS ${VERSION}) OR (${REG_TEST_MAJOR} STREQUAL 
"/registry"))
  message(STATUS "Test Not installed")
  
  install(FILES machine.h
          DESTINATION include/)

  set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "
                                         WriteRegStr HKLM 
'SOFTWARE\\\\Arpack\\\\Test' 'Major' '${TEST_MAJOR}'
                                         WriteRegStr HKLM 
'SOFTWARE\\\\Arpack\\\\Test' 'Minor' '${TEST_MINOR}'
                                         WriteRegStr HKLM 
'SOFTWARE\\\\Arpack\\\\Test' 'Revision' '${TEST_REVISION}'")

else ()
  message(STATUS "Test Already installed")
endif ()

include(CPack)




But it works only once (the version number are red only while the package is 
created by cpack).

How can I read with cmake the registry key "dynamically" in the installer and 
use this version number to install conditionnaly some applications ?

Best regards,

YC
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to