Subversion Repositories gelsvn

Rev

Rev 241 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
239 bj 1
!include "LogicLib.nsh" 
242 bj 2
!include "WinMessages.NSH"
3
 
239 bj 4
; The name of the installer
5
Name "GEL Externals"
6
 
7
; The file to write
8
OutFile "GELexternals.exe"
9
 
10
; The default installation directory
11
InstallDir $DESKTOP\test
12
 
13
;--------------------------------
14
 
15
; Pages
16
 
17
Page directory
18
Page components
19
 
240 bj 20
InstType "Externals only"
21
InstType "Full"
239 bj 22
 
23
Section "Externals" Externals
24
SectionIn 1 2
25
SectionEnd
26
 
27
Section "GEL binary (ver. 0.1)" GEL
240 bj 28
SectionIn 2
239 bj 29
SectionEnd
30
 
31
 
32
 
33
Page instfiles
34
 
35
;--------------------------------
36
 
37
Section ""
38
 
39
  # Get flags of first section (which is index #0) into register $0
40
  SectionGetFlags ${Externals} $0
41
 
241 bj 42
  # Get flags of second section (which is index #1) into register $1
239 bj 43
  SectionGetFlags ${GEL} $1
44
 
241 bj 45
  ;MessageBox MB_OK "Externals: $0 $\r$\n GEL: $1 $\r$\n "
239 bj 46
 
47
  ${If} $0 = 1
48
    SetOutPath $INSTDIR\bin
49
    File externals\bin\*.dll 
50
 
51
    SetOutPath $INSTDIR\lib
52
    File externals\lib\*.lib 
53
 
54
    SetOutPath $INSTDIR
55
    File /r externals\include
56
  ${EndIf}
57
 
58
  ${If} $1 = 1
59
    SetOutPath $INSTDIR\lib
60
    File current\lib\*.lib 
61
 
62
    SetOutPath $INSTDIR
63
    File /r current\include
64
  ${EndIf}
65
 
242 bj 66
  # Create Environment variables
67
  WriteRegExpandStr HKCU "Environment" "GEL_INCLUDE" "$INSTDIR\include"
68
  WriteRegExpandStr HKCU "Environment" "GEL_LIB" "$INSTDIR\lib"
69
  WriteRegExpandStr HKCU "Environment" "GEL_BIN" "$INSTDIR\bin"
239 bj 70
 
242 bj 71
  # Add %GEL_BIN% to path
72
  ReadRegStr $1 HKCU "Environment" "PATH"
73
  StrCpy $2 $1 1 -1 # copy last char
74
  StrCmp $2 ";" 0 +2 # if last char == ;
75
    StrCpy $1 $1 -1 # remove last char
76
  StrCmp $1 "" AddToPath_NTdoIt
77
    StrCpy $0 "$1;%GEL_BIN%"
78
  AddToPath_NTdoIt:
79
    WriteRegExpandStr HKCU "Environment" "PATH" $0
80
    SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
239 bj 81
 
242 bj 82
 
239 bj 83
SectionEnd ; end the section