X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/19a7582234a64354e454fdab60a0d8c7ac16d2cc..56d29b1554682d19700b052fdbe18278dafb7266:/buildtools/Cmake/simgrid.nsi.in diff --git a/buildtools/Cmake/simgrid.nsi.in b/buildtools/Cmake/simgrid.nsi.in index d49ff2bded..2191decb2d 100644 --- a/buildtools/Cmake/simgrid.nsi.in +++ b/buildtools/Cmake/simgrid.nsi.in @@ -1,17 +1,39 @@ -Name "Simgrid" -XPstyle on +!include "MUI2.nsh" -# define installer name -outFile "SimGrid@SIMGRID_VERSION_MAJOR@.@SIMGRID_VERSION_MINOR@.@SIMGRID_VERSION_PATCH@_@CMAKE_SYSTEM_PROCESSOR@@BIN_EXE@" +;-------------------------------- +;Interface Configuration -# set the default installation directory -InstallDir $PROGRAMFILES\SimGrid + !define MUI_HEADERIMAGE + !define MUI_HEADERIMAGE_BITMAP "@CMAKE_HOME_DIRECTORY@\doc\webcruft\simgrid_logo_win.bmp" ; optional + !define MUI_ABORTWARNING -# The text to prompt the user to enter a directory -DirText "This will install Simgrid on your computer. Choose a directory" +;-------------------------------- +;Pages -# default section start -section + !insertmacro MUI_PAGE_LICENSE "@CMAKE_HOME_DIRECTORY@\LICENSE-LGPL-2.1" + !insertmacro MUI_PAGE_COMPONENTS + !insertmacro MUI_PAGE_DIRECTORY + !insertmacro MUI_PAGE_INSTFILES + !insertmacro MUI_PAGE_FINISH + + !insertmacro MUI_UNPAGE_CONFIRM + !insertmacro MUI_UNPAGE_INSTFILES + !insertmacro MUI_UNPAGE_FINISH + +;-------------------------------- +;Languages + !insertmacro MUI_LANGUAGE "English" + !insertmacro MUI_LANGUAGE "French" +;-------------------------------- + +Name "Simgrid" +outFile "SimGrid@SIMGRID_VERSION_MAJOR@.@SIMGRID_VERSION_MINOR@.@SIMGRID_VERSION_PATCH@_@SIMGRID_SYSTEM_PROCESSOR@@BIN_EXE@" +Icon "@CMAKE_HOME_DIRECTORY@\doc\webcruft\SimGrid.ico" + +# set the default installation directory +InstallDir c:\SimGrid@SIMGRID_VERSION_MAJOR@.@SIMGRID_VERSION_MINOR@.@SIMGRID_VERSION_PATCH@ + +Section "Libraries and Headers" LibSection # install lib CreateDirectory $INSTDIR\lib @@ -117,6 +139,9 @@ section file @CMAKE_HOME_DIRECTORY@\include\simix\datatypes.h file @CMAKE_HOME_DIRECTORY@\include\simix\context.h +SectionEnd +Section "Binaries" BinSection + # insatll bin CreateDirectory $INSTDIR\bin setOutPath $INSTDIR\bin @@ -130,25 +155,55 @@ section file bin\smpirun file bin\tesh +SectionEnd +Section "Documentation" DocSection + # install doc CreateDirectory $INSTDIR\doc setOutPath $INSTDIR\doc file /nonfatal /r @CMAKE_HOME_DIRECTORY@\doc\html - file /r @CMAKE_HOME_DIRECTORY@\doc\HelloWorld + # create a shortcut in the start menu programs directory + CreateDirectory "$SMPROGRAMS\SimGrid" + createShortCut "$SMPROGRAMS\SimGrid\Documentation.lnk" "$INSTDIR\doc\html\index.html" + +SectionEnd +Section "Examples" ExamplesSection # install examples CreateDirectory $INSTDIR\examples setOutPath $INSTDIR\examples - file /r @CMAKE_HOME_DIRECTORY@\examples\platforms + file /r @CMAKE_HOME_DIRECTORY@\examples\platforms + file /r @CMAKE_HOME_DIRECTORY@\doc\HelloWorld + # create a shortcut in the start menu programs directory + createShortCut "$SMPROGRAMS\SimGrid\HelloWorld project.lnk" "$INSTDIR\examples\HelloWorld" + +SectionEnd +Section "Pcre library" PCRESection + # install pcre library + CreateDirectory $INSTDIR\GnuWin32 + setOutPath $INSTDIR\GnuWin32 + file "@PATH_PCRE_LICENCE@\LICENCE" + + CreateDirectory $INSTDIR\GnuWin32\lib + setOutPath $INSTDIR\GnuWin32\lib + file @PATHLIBPCRE@\libpcre.a + file @PATHLIBPCRE@\libpcreposix.a + CreateDirectory $INSTDIR\GnuWin32\include + setOutPath $INSTDIR\GnuWin32\include + file @PATH_PCRE_H@\pcre.h + file @PATH_PCRE_H@\pcreposix.h +SectionEnd + +# default section start +section # define uninstaller name writeUninstaller $INSTDIR\uninstaller@BIN_EXE@ # create a shortcut in the start menu programs directory CreateDirectory "$SMPROGRAMS\SimGrid" createShortCut "$SMPROGRAMS\SimGrid\Uninstall simgrid.lnk" "$INSTDIR\uninstaller@BIN_EXE@" - createShortCut "$SMPROGRAMS\SimGrid\Documentation.lnk" "$INSTDIR\doc\index.html" - + # Include for some of the windows message defines !include "winmessages.nsh" # HKLM (all users) vs HKCU (current user) defines @@ -156,14 +211,39 @@ section !define env_hkcu 'HKCU "Environment"' # Set Variables WriteRegExpandStr ${env_hklm} SIMGRID_ROOT $INSTDIR - WriteRegExpandStr ${env_hklm} GRAS_ROOT $INSTDIR WriteRegExpandStr ${env_hklm} SIMGRID_VERSION @SIMGRID_VERSION_MAJOR@.@SIMGRID_VERSION_MINOR@.@SIMGRID_VERSION_PATCH@ - MessageBox MB_OK "Installation was successful." + WriteRegExpandStr ${env_hklm} SIMGRID_PCRE_LIBRARY_PATH $INSTDIR\GnuWin32 + WriteRegExpandStr ${env_hklm} SIMGRID_PCRE_LIBRARY_VERSION "8.12" + + WriteRegStr HKCU "SOFTWARE\SimGrid" "Version" "@SIMGRID_VERSION_MAJOR@.@SIMGRID_VERSION_MINOR@.@SIMGRID_VERSION_PATCH@" + WriteRegStr HKCU "SOFTWARE\SimGrid" "InstallPath" "$INSTDIR" + + SetRebootFlag true # default section end sectionEnd +LangString DESC_LibSection ${LANG_ENGLISH} "Install Simgrid and gras libraries with associated headers." +LangString DESC_BinSection ${LANG_ENGLISH} "Install some useful tools for Simgrid." +LangString DESC_DocSection ${LANG_ENGLISH} "Generated (doxygen) documentation." +LangString DESC_ExamplesSection ${LANG_ENGLISH} "Simgrid's HelloWorld example and some classical platforms." +LangString DESC_PCRESection ${LANG_ENGLISH} "Install the PCRE and PCREPOSIX libraries for SimGrid." + +LangString DESC_LibSection ${LANG_FRENCH} "Installer les librairies Simgrid et Gras et leurs EntĂȘtes." +LangString DESC_BinSection ${LANG_FRENCH} "Installer les outils optionnels." +LangString DESC_DocSection ${LANG_FRENCH} "Installer la documentation." +LangString DESC_ExamplesSection ${LANG_FRENCH} "Installer un exemple 'HelloWorld' et des fichiers de plate-formes types." +LangString DESC_PCRESection ${LANG_FRENCH} "Installer les librairies PCRE et PCREPOSIX for SimGrid." + +!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN + !insertmacro MUI_DESCRIPTION_TEXT ${LibSection} $(DESC_LibSection) + !insertmacro MUI_DESCRIPTION_TEXT ${BinSection} $(DESC_BinSection) + !insertmacro MUI_DESCRIPTION_TEXT ${DocSection} $(DESC_DocSection) + !insertmacro MUI_DESCRIPTION_TEXT ${ExamplesSection} $(DESC_ExamplesSection) + !insertmacro MUI_DESCRIPTION_TEXT ${PCRESection} $(DESC_PCRESection) +!insertmacro MUI_FUNCTION_DESCRIPTION_END + # create a section to define what the uninstaller does. # the section will always be named "Uninstall" section "Uninstall" @@ -255,6 +335,7 @@ section "Uninstall" # delete link delete "$SMPROGRAMS\SimGrid\Uninstall simgrid.lnk" delete "$SMPROGRAMS\SimGrid\Documentation.lnk" + delete "$SMPROGRAMS\SimGrid\HelloWorld project.lnk" # now delete directories RMDir "$INSTDIR\bin" @@ -274,10 +355,15 @@ section "Uninstall" RMDir /r "$INSTDIR\examples" RMDir "$SMPROGRAMS\SimGrid" + # delete PCRE + RMDir /r "$INSTDIR\GnuWin32" + # Delete variable DeleteRegValue ${env_hklm} SIMGRID_ROOT - DeleteRegValue ${env_hklm} GRAS_ROOT DeleteRegValue ${env_hklm} SIMGRID_VERSION - + DeleteRegValue ${env_hklm} SIMGRID_PCRE_LIBRARY_PATH + DeleteRegValue ${env_hklm} SIMGRID_PCRE_LIBRARY_VERSION + DeleteRegKey HKCU "SOFTWARE\SimGrid" + # uninstall section end sectionEnd \ No newline at end of file