X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/e12909f73b3ab10d195c5156b0521d63c22caefd..0c14e681436e252f680310c7696b3ba17a349706:/buildtools/Cmake/simgrid.nsi.in diff --git a/buildtools/Cmake/simgrid.nsi.in b/buildtools/Cmake/simgrid.nsi.in index 0be024088f..74077730b2 100644 --- a/buildtools/Cmake/simgrid.nsi.in +++ b/buildtools/Cmake/simgrid.nsi.in @@ -1,20 +1,55 @@ -# define installer name -outFile "SimGrid@SIMGRID_VERSION_MAJOR@.@SIMGRID_VERSION_MINOR@.@SIMGRID_VERSION_PATCH@.exe" +!include "MUI2.nsh" + +;-------------------------------- +;Interface Configuration + + !define MUI_HEADERIMAGE + !define MUI_HEADERIMAGE_BITMAP "@CMAKE_HOME_DIRECTORY@\doc\webcruft\simgrid_logo_win_2011.bmp" ; optional + !define MUI_ABORTWARNING + +;-------------------------------- +;Pages + + !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@_SGjava_@NSIS_WIN_VERSION@@BIN_EXE@" +Icon "@CMAKE_HOME_DIRECTORY@\doc\webcruft\SGicon.ico" + +RequestExecutionLevel admin # set the default installation directory -InstallDir $PROGRAMFILES\SimGrid +InstallDir c:\SimGrid@SIMGRID_VERSION_MAJOR@.@SIMGRID_VERSION_MINOR@.@SIMGRID_VERSION_PATCH@ -# The text to prompt the user to enter a directory -DirText "This will install Simgrid on your computer. Choose a directory" +Section "Libraries and Headers" LibSection -# default section start -section + setOutPath $INSTDIR + file @CMAKE_HOME_DIRECTORY@\AUTHORS + file @CMAKE_HOME_DIRECTORY@\Changelog + file @CMAKE_HOME_DIRECTORY@\COPYING + file @CMAKE_HOME_DIRECTORY@\LICENSE-LGPL-2.1 + file @CMAKE_HOME_DIRECTORY@\NEWS # install lib CreateDirectory $INSTDIR\lib setOutPath $INSTDIR\lib - file lib\libgras.a - file lib\libsimgrid.a + file lib\libgras.dll + file lib\libsimgrid.dll + file lib\libsimgrid.def #install headers CreateDirectory $INSTDIR\include @@ -59,11 +94,18 @@ section file @CMAKE_HOME_DIRECTORY@\include\xbt\mmalloc.h file @CMAKE_HOME_DIRECTORY@\include\xbt\replay_trace_reader.h file @CMAKE_HOME_DIRECTORY@\include\xbt\parmap.h - - CreateDirectory $INSTDIR\include\mc - setOutPath $INSTDIR\include\mc - file @CMAKE_HOME_DIRECTORY@\include\mc\modelchecker.h - + file @CMAKE_HOME_DIRECTORY@\include\xbt\automaton.h + file @CMAKE_HOME_DIRECTORY@\include\xbt\automatonparse_promela.h + file @CMAKE_HOME_DIRECTORY@\include\xbt\datadesc.h + file @CMAKE_HOME_DIRECTORY@\include\xbt\socket.h + file @CMAKE_HOME_DIRECTORY@\include\xbt\file_stat.h + + CreateDirectory $INSTDIR\include\simgrid + setOutPath $INSTDIR\include\simgrid + file @CMAKE_HOME_DIRECTORY@\include\simgrid\platf.h + file @CMAKE_HOME_DIRECTORY@\include\simgrid\modelchecker.h + file @CMAKE_HOME_DIRECTORY@\include\simgrid\simix.h + CreateDirectory $INSTDIR\include\msg setOutPath $INSTDIR\include\msg file @CMAKE_HOME_DIRECTORY@\include\msg\msg.h @@ -90,7 +132,6 @@ section CreateDirectory $INSTDIR\include\gras setOutPath $INSTDIR\include\gras - file @CMAKE_HOME_DIRECTORY@\include\gras\datadesc.h file @CMAKE_HOME_DIRECTORY@\include\gras\transport.h file @CMAKE_HOME_DIRECTORY@\include\gras\virtu.h file @CMAKE_HOME_DIRECTORY@\include\gras\emul.h @@ -108,57 +149,150 @@ section setOutPath $INSTDIR\include\instr file @CMAKE_HOME_DIRECTORY@\include\instr\instr.h - CreateDirectory $INSTDIR\include\simix - setOutPath $INSTDIR\include\simix - file @CMAKE_HOME_DIRECTORY@\include\simix\simix.h - 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 file bin\colorize - file bin\graphicator.exe - file bin\gras_stub_generator.exe + file bin\graphicator@BIN_EXE@ file bin\simgrid_update_xml - file bin\smpicc - file bin\smpif2c - file bin\smpiff - file bin\smpirun - file bin\tesh - #install doc +SectionEnd +Section "Documentation" DocSection + + # install doc CreateDirectory $INSTDIR\doc setOutPath $INSTDIR\doc - file /r @CMAKE_HOME_DIRECTORY@\doc\html + file /nonfatal /r @CMAKE_HOME_DIRECTORY@\doc\html + # create a shortcut in the start menu programs directory + CreateDirectory "$SMPROGRAMS\SimGrid @SIMGRID_VERSION_MAJOR@.@SIMGRID_VERSION_MINOR@.@SIMGRID_VERSION_PATCH@" + createShortCut "$SMPROGRAMS\SimGrid @SIMGRID_VERSION_MAJOR@.@SIMGRID_VERSION_MINOR@.@SIMGRID_VERSION_PATCH@\Documentation.lnk" "$INSTDIR\doc\html\index.html" + createShortCut "$SMPROGRAMS\SimGrid @SIMGRID_VERSION_MAJOR@.@SIMGRID_VERSION_MINOR@.@SIMGRID_VERSION_PATCH@\Website.lnk" "http://simgrid.gforge.inria.fr/" + +SectionEnd +Section "Examples" ExamplesSection + CreateDirectory $INSTDIR\examples + setOutPath $INSTDIR\examples + + #install examples for platforms + file /r @CMAKE_HOME_DIRECTORY@\examples\platforms + + # install example HelloWorld + file /r @CMAKE_HOME_DIRECTORY@\doc\HelloWorld + + # install example MasterSlave + CreateDirectory $INSTDIR\examples\MasterSlave + setOutPath $INSTDIR\examples\MasterSlave + file @CMAKE_HOME_DIRECTORY@\examples\msg\masterslave\masterslave_forwarder.c + file @CMAKE_HOME_DIRECTORY@\examples\msg\masterslave\deployment_masterslave_forwarder.xml + file @CMAKE_HOME_DIRECTORY@\examples\msg\msg_platform.xml + file @CMAKE_HOME_DIRECTORY@\doc\HelloWorld\CMakeLists.txt + file @CMAKE_HOME_DIRECTORY@\doc\HelloWorld\FindPcreWin.cmake + + # create shortcuts in the start menu programs directory + CreateDirectory "$SMPROGRAMS\SimGrid @SIMGRID_VERSION_MAJOR@.@SIMGRID_VERSION_MINOR@.@SIMGRID_VERSION_PATCH@\Examples\" + createShortCut "$SMPROGRAMS\SimGrid @SIMGRID_VERSION_MAJOR@.@SIMGRID_VERSION_MINOR@.@SIMGRID_VERSION_PATCH@\Examples\HelloWorld project.lnk" "$INSTDIR\examples\HelloWorld" + createShortCut "$SMPROGRAMS\SimGrid @SIMGRID_VERSION_MAJOR@.@SIMGRID_VERSION_MINOR@.@SIMGRID_VERSION_PATCH@\Examples\MasterSlave project.lnk" "$INSTDIR\examples\MasterSlave" + +SectionEnd +Section "Pcre library" PCRESection + # install pcre library + CreateDirectory $INSTDIR\GnuWin32 + setOutPath $INSTDIR\GnuWin32 + file /r "@PCRE_LIBRARY_PATH@\lib" + file /r "@PCRE_LIBRARY_PATH@\include" + file /r "@PCRE_LIBRARY_PATH@\bin" + file /r "@PCRE_LIBRARY_PATH@\man" + file /r "@PCRE_LIBRARY_PATH@\share" +SectionEnd + +Section "Java Bindings" JavaSection + # install java library and examples + CreateDirectory $INSTDIR\examples\simgrid-java + setOutPath $INSTDIR\lib + file "$%SIMGRID_JAVA_SRC%\build\SG_java.dll" + file "$%SIMGRID_JAVA_SRC%\build\SG_java.def" + file "$%SIMGRID_JAVA_SRC%\simgrid.jar" + setOutPath $INSTDIR\examples\simgrid-java + file /r "$%SIMGRID_JAVA_SRC%\examples\" + # create shortcuts in the start menu programs directory + createShortCut "$SMPROGRAMS\SimGrid @SIMGRID_VERSION_MAJOR@.@SIMGRID_VERSION_MINOR@.@SIMGRID_VERSION_PATCH@\Examples\Java project.lnk" "$INSTDIR\examples\simgrid-java" + # create a popup box, with an OK button" + messageBox MB_OK "WARNING! Please add to your environment variable CLASSPATH value '$INSTDIR\lib\simgrid.jar;.' before executing Simgrid classes." +SectionEnd + +# default section start +section # define uninstaller name - writeUninstaller $INSTDIR\uninstaller.exe + 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.exe" + CreateDirectory "$SMPROGRAMS\SimGrid @SIMGRID_VERSION_MAJOR@.@SIMGRID_VERSION_MINOR@.@SIMGRID_VERSION_PATCH@" + createShortCut "$SMPROGRAMS\SimGrid @SIMGRID_VERSION_MAJOR@.@SIMGRID_VERSION_MINOR@.@SIMGRID_VERSION_PATCH@\Uninstall simgrid.lnk" "$INSTDIR\uninstaller@BIN_EXE@" - MessageBox MB_OK "Installation was successful." + # Include for some of the windows message defines + !include "winmessages.nsh" + # HKLM (all users) vs HKCU (current user) defines + !define env_hklm 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"' + !define env_hkcu 'HKCU "Environment"' + # Set Variables + WriteRegExpandStr ${env_hkcu} SIMGRID_ROOT $INSTDIR + WriteRegExpandStr ${env_hkcu} SIMGRID_VERSION @SIMGRID_VERSION_MAJOR@.@SIMGRID_VERSION_MINOR@.@SIMGRID_VERSION_PATCH@ + WriteRegExpandStr ${env_hkcu} SIMGRID_PCRE_LIBRARY_PATH $INSTDIR\GnuWin32 + WriteRegExpandStr ${env_hkcu} SIMGRID_PCRE_LIBRARY_VERSION "8.21" + + WriteRegStr HKCU "SOFTWARE\SimGrid" "Version" "@SIMGRID_VERSION_MAJOR@.@SIMGRID_VERSION_MINOR@.@SIMGRID_VERSION_PATCH@" + WriteRegStr HKCU "SOFTWARE\SimGrid" "InstallPath" "$INSTDIR" + + # create a popup box, with an OK button" + messageBox MB_OK "WARNING! Please add to your environment variable PATH value '$INSTDIR\lib;$INSTDIR\GnuWin32\bin' before executing Simgrid binaries." + + 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_JAVASection ${LANG_ENGLISH} "Install the Java binding and examples." + +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." +LangString DESC_JAVASection ${LANG_FRENCH} "Installer la librairie Simgrid-java and les examples." + +!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_DESCRIPTION_TEXT ${JAVASection} $(DESC_JAVASection) +!insertmacro MUI_FUNCTION_DESCRIPTION_END + # create a section to define what the uninstaller does. # the section will always be named "Uninstall" section "Uninstall" # always delete uninstaller first - delete $INSTDIR\uninstaller.exe + delete $INSTDIR\uninstaller@BIN_EXE@ # delete installed libs - delete $INSTDIR\lib\libgras.a - delete $INSTDIR\lib\libsimgrid.a + delete $INSTDIR\lib\libgras.dll + delete $INSTDIR\lib\libsimgrid.dll + delete $INSTDIR\lib\libsimgrid.def # delete installed bin delete $INSTDIR\bin\colorize - delete $INSTDIR\bin\graphicator.exe - delete $INSTDIR\bin\gras_stub_generator.exe + delete $INSTDIR\bin\graphicator@BIN_EXE@ delete $INSTDIR\bin\simgrid_update_xml delete $INSTDIR\bin\smpicc delete $INSTDIR\bin\smpif2c @@ -204,7 +338,13 @@ section "Uninstall" delete $INSTDIR\include\xbt\mmalloc.h delete $INSTDIR\include\xbt\replay_trace_reader.h delete $INSTDIR\include\xbt\parmap.h - delete $INSTDIR\include\mc\modelchecker.h + delete $INSTDIR\include\xbt\socket.h + delete $INSTDIR\include\xbt\file_stat.h + + delete $INSTDIR\include\simgrid\platf.h + delete $INSTDIR\include\simgrid\modelchecker.h + delete $INSTDIR\include\simgrid\simix.h + delete $INSTDIR\include\msg\msg.h delete $INSTDIR\include\msg\datatypes.h delete $INSTDIR\include\simdag\simdag.h @@ -228,13 +368,14 @@ section "Uninstall" delete $INSTDIR\include\amok\peermanagement.h delete $INSTDIR\include\amok\bandwidth.h delete $INSTDIR\include\instr\instr.h - delete $INSTDIR\include\simix\simix.h - delete $INSTDIR\include\simix\datatypes.h - delete $INSTDIR\include\simix\context.h - # delete link - delete "$SMPROGRAMS\SimGrid\uninstall simgrid.lnk" - + # delete EXTRA FILES + delete $INSTDIR\AUTHORS + delete $INSTDIR\Changelog + delete $INSTDIR\COPYING + delete $INSTDIR\LICENSE-LGPL-2.1 + delete $INSTDIR\NEWS + # now delete directories RMDir "$INSTDIR\bin" RMDir "$INSTDIR\lib" @@ -249,9 +390,25 @@ section "Uninstall" RMDir "$INSTDIR\include\mc" RMDir "$INSTDIR\include\xbt" RMDir "$INSTDIR\include" - RMDir "$INSTDIR\doc" - RMDir "$SMPROGRAMS\SimGrid" - RMDir "$PROGRAMFILES\SimGrid" - + RMDir /r "$INSTDIR\doc" + RMDir /r "$INSTDIR\examples" + RMDir /r "$SMPROGRAMS\SimGrid @SIMGRID_VERSION_MAJOR@.@SIMGRID_VERSION_MINOR@.@SIMGRID_VERSION_PATCH@" + + # delete PCRE + RMDir /r "$INSTDIR\GnuWin32" + + # Delete variable + DeleteRegValue ${env_hkcu} SIMGRID_ROOT + DeleteRegValue ${env_hkcu} SIMGRID_VERSION + DeleteRegValue ${env_hkcu} SIMGRID_PCRE_LIBRARY_PATH + DeleteRegValue ${env_hkcu} SIMGRID_PCRE_LIBRARY_VERSION + DeleteRegKey HKCU "SOFTWARE\SimGrid" + + # delete JAVA-bindings + RMDir /r "$INSTDIR\simgrid-java" + + # delete INSTDIR + RMDir /r "$INSTDIR" + # uninstall section end sectionEnd \ No newline at end of file