Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add a README and examples/platforms.
[simgrid.git] / buildtools / Cmake / simgrid.nsi.in
index 281da0a..54bb19f 100644 (file)
@@ -1,5 +1,5 @@
 # define installer name\r
-outFile "SimGrid@SIMGRID_VERSION_MAJOR@.@SIMGRID_VERSION_MINOR@.@SIMGRID_VERSION_PATCH@_win@WIN_ARCH@@BIN_EXE@"\r
+outFile "SimGrid@SIMGRID_VERSION_MAJOR@.@SIMGRID_VERSION_MINOR@.@SIMGRID_VERSION_PATCH@_@CMAKE_SYSTEM_PROCESSOR@@BIN_EXE@"\r
 \r
 # set the default installation directory\r
 InstallDir $PROGRAMFILES\SimGrid\r
@@ -127,11 +127,17 @@ section
        file bin\smpirun\r
        file bin\tesh\r
        \r
-       #install doc\r
+       # install doc\r
        CreateDirectory $INSTDIR\doc\r
        setOutPath $INSTDIR\doc\r
-       file /r @CMAKE_HOME_DIRECTORY@\doc\html\r
-\r
+       file /nonfatal /r @CMAKE_HOME_DIRECTORY@\doc\html\r
+       file /r @CMAKE_HOME_DIRECTORY@\doc\HelloWorld\r
+       \r
+       # install examples\r
+       CreateDirectory $INSTDIR\examples\r
+       setOutPath $INSTDIR\examples\r
+       file /r @CMAKE_HOME_DIRECTORY@\examples\platforms       \r
+       \r
        # define uninstaller name\r
        writeUninstaller $INSTDIR\uninstaller@BIN_EXE@\r
 \r
@@ -140,6 +146,16 @@ section
        createShortCut  "$SMPROGRAMS\SimGrid\Uninstall simgrid.lnk" "$INSTDIR\uninstaller@BIN_EXE@"\r
        createShortCut  "$SMPROGRAMS\SimGrid\Documentation.lnk" "$INSTDIR\doc\index.html"\r
        \r
+       # Include for some of the windows message defines\r
+       !include "winmessages.nsh"\r
+       # HKLM (all users) vs HKCU (current user) defines\r
+       !define env_hklm 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"'\r
+       !define env_hkcu 'HKCU "Environment"'\r
+       # Set Variables\r
+       WriteRegExpandStr ${env_hklm} SIMGRID_ROOT $INSTDIR\r
+       WriteRegExpandStr ${env_hklm} GRAS_ROOT $INSTDIR\r
+       WriteRegExpandStr ${env_hklm} SIMGRID_VERSION @SIMGRID_VERSION_MAJOR@.@SIMGRID_VERSION_MINOR@.@SIMGRID_VERSION_PATCH@\r
+\r
        MessageBox MB_OK "Installation was successful."\r
 \r
 # default section end\r
@@ -251,9 +267,14 @@ section "Uninstall"
        RMDir  "$INSTDIR\include\mc"\r
        RMDir  "$INSTDIR\include\xbt"\r
        RMDir  "$INSTDIR\include"\r
-       RMDir  "$INSTDIR\doc"\r
+       RMDir  /r "$INSTDIR\doc"\r
+       RMDir  /r "$INSTDIR\examples"\r
        RMDir  "$SMPROGRAMS\SimGrid"\r
-       RMDir  "$PROGRAMFILES\SimGrid"\r
+       \r
+       # Delete variable\r
+       DeleteRegValue ${env_hklm} SIMGRID_ROOT\r
+       DeleteRegValue ${env_hklm} GRAS_ROOT\r
+       DeleteRegValue ${env_hklm} SIMGRID_VERSION\r
 \r
 # uninstall section end\r
 sectionEnd
\ No newline at end of file