Commit 896f5832 authored by Laurent Belcour's avatar Laurent Belcour

[Installer] Correction of the installer to handle new build structure.

parent 7d8967d4
!include EnvVarUpdate.nsh
!include "MUI2.nsh"
!include "winmessages.nsh"
# Name of the installer
Name "ALTA"
Outfile "ALTA.exe"
InstallDir "$DESKTOP\ALTA"
!define ALTADIR "${__FILEDIR__}\..\.."
# 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
File "${ALTADIR}\sources\build\*.exe"
SetOutPath $INSTDIR\lib
File "${ALTADIR}\sources\build\core.lib"
SetOutPath $INSTDIR\plugins
File "${ALTADIR}\sources\build\nonlinear*.dll"
File "${ALTADIR}\sources\build\rational*.dll"
File "${ALTADIR}\sources\build\data*.dll"
SetOutPath $INSTDIR\python
File "${ALTADIR}\sources\build\alta.dll"
# 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
!include EnvVarUpdate.nsh
!include "MUI2.nsh"
!include "winmessages.nsh"
# Name of the installer
Name "ALTA"
Outfile "ALTA.exe"
InstallDir "$DESKTOP\ALTA"
!define ALTADIR "${__FILEDIR__}\..\.."
# 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
File "${ALTADIR}\build\softs\*.exe"
SetOutPath $INSTDIR\lib
File "${ALTADIR}\build\core\core.lib"
SetOutPath $INSTDIR\plugins
File "${ALTADIR}\build\plugins\nonlinear*.dll"
File "${ALTADIR}\build\plugins\rational*.dll"
File "${ALTADIR}\build\plugins\data*.dll"
SetOutPath $INSTDIR\python
File "${ALTADIR}\build\python\alta.dll"
# 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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment