installer.nsi 2.57 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
!include EnvVarUpdate.nsh
!include "MUI2.nsh"
!include "winmessages.nsh"


# Name of the installer
Name "ALTA"
Outfile "ALTA.exe"

InstallDir "$DESKTOP\ALTA"

12 13
;!define ALTADIR "${__FILEDIR__}\..\.."
!define ALTADIR "..\.."
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53

# Request application privileges for Windows Vista
RequestExecutionLevel user


# Pages
  !define MUI_WELCOMEPAGE_TITLE "Welcome to ALTA Installer"

  !define MUI_HEADERIMAGE
  !define MUI_HEADERIMAGE_BITMAP "alta-logo-installer.bmp"

  !define MUI_ABORTWARNING
  !define MUI_ABORTWARNING_CANCEL_DEFAULT

  !define MUI_ICON "alta-logo-installer.ico"
  #!define MUI_WELCOMEFINISHPAGE_BITMAP "alta-logo-installer-welcome.bmp"

  !insertmacro MUI_PAGE_WELCOME


  !insertmacro MUI_PAGE_LICENSE "..\..\LICENSE.txt"
#	!insertmacro MUI_PAGE_COMPONENTS
  !insertmacro MUI_PAGE_DIRECTORY
  !insertmacro MUI_PAGE_INSTFILES




  !insertmacro MUI_UNPAGE_CONFIRM
  !insertmacro MUI_UNPAGE_INSTFILES

;Interface Settings

  !insertmacro MUI_LANGUAGE "English"


# Section start
Section "ALTA" SecMain

  SetOutPath $INSTDIR\bin
54 55
  File /nonfatal /r "${ALTADIR}\build\softs\*.exe"
  File /nonfatal /r "${ALTADIR}\external\build\bin\*.dll"
56 57

  SetOutPath $INSTDIR\lib
58
  File /nonfatal /r "${ALTADIR}\build\core\core.lib"
59 60

  SetOutPath $INSTDIR\plugins
61 62 63
  File /nonfatal /r "${ALTADIR}\build\plugins\nonlinear*.dll"
  File /nonfatal /r "${ALTADIR}\build\plugins\rational*.dll"
  File /nonfatal /r "${ALTADIR}\build\plugins\data*.dll"
64

65 66
  ; Python package
  SetOutPath $INSTDIR\python
67
  File /nonfatal /r "${ALTADIR}\build\python\alta.dll"
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111

  # Update the ENVIROMNENT
  WriteRegStr HKCU "Environment" "ALTA_DIR"   '$INSTDIR'
  WriteRegStr HKCU "Environment" "ALTA_PLUGIN_PATH"   '$INSTDIR\plugins'
  ${EnvVarUpdate} $0 "PATH"     "A" "HKCU" '$INSTDIR\bin'
  ${EnvVarUpdate} $1 "PYTHONPATH" "A" "HKCU" '$INSTDIR\python'



  ;Create uninstaller
  WriteUninstaller "$INSTDIR\Uninstall.exe"

  ; make sure windows knows about the change
  SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000

#End Section
SectionEnd

;--------------------------------
;Uninstaller Section

Section "Uninstall"

  ;FILES

  Delete "$INSTDIR\Uninstall.exe"

  ;Remove the directory and all its content!
  RMDir /r "$INSTDIR"


  ;Remove ALTA_PLUGIN_PATH AND ALTA_DIR env. variable
  DeleteRegKey HKCU "ALTA_DIR"
  DeleteRegKey HKCU "ALTA_PLUGIN_PATH"


  ${un.EnvVarUpdate} $0 "PATH" "R" "HKCU" "$INSTDIR"
  ${un.EnvVarUpdate} $0 "PYTHONPATH" "R" "HKCU" "$INSTDIR\python"


  ; make sure windows knows about the change
  SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000

SectionEnd