summaryrefslogtreecommitdiffstats
path: root/kjsembed/qjsembed.nsi
blob: 10b07e4394dafb830380679f49f5d4b9e50f8b10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
!define VER_MAJOR 1
!define VER_MINOR 0
!define VER_FILE 10
!define VER_DISPLAY "1.0 ${__TIMESTAMP__}"
!define APP_NAME TQJSEmbed
!define APP_NAME_LC qjsembed


Outfile ${APP_NAME}-${VER_FILE}.exe
SetCompressor lzma

InstallDir $PROGRAMFILES\${APP_NAME}
InstallDirRegKey HKLM Software\SourceXtreme\${APP_NAME} ""

!include "Sections.nsh"
!include "MUI.nsh"

Name "${APP_NAME}"
Caption "${APP_NAME} ${VER_DISPLAY} Setup"
XPStyle on

!define MUI_ABORTWARNING
!define MUI_HEADERIMAGE 

!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "lgpl.txt"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
 
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"



Section "${APP_NAME} SDK (Required)" secSDK
        SectionIn RO
  SetDetailsPrint textonly
  DetailPrint "${APP_NAME} static library for embedding into Qt applications."
  SetDetailsPrint listonly

  SetOutPath "$WINDIR"
  

  SetOutPath "$INSTDIR"
  File lgpl.txt
  File ReadMe.txt
  SetOutPath "$INSTDIR"
  File kjsembed\qjsembed.dll
  SetOutPath "$INSTDIR\lib"
  File kjsembed\qjsembed.lib
  SetOutPath "$INSTDIR\include"
  File kjs\completion.h
  File kjs\list.h  
  File kjs\reference.h
  File kjs\ustring.h
  File kjs\function.h
  File kjs\lookup.h
  File kjs\reference_list.h
  File kjs\value.h
  File kjs\global.h
  File kjs\object.h
  File kjs\scope_chain.h
  File kjs\identifier.h
  File kjs\operations.h
  File kjs\simple_number.h
  File kjs\interpreter.h
  File kjs\property_map.h
  File kjs\types.h

  File kjsembed\kjsembedpart.h
  File kjsembed\jsconsolewidget.h
  File kjsembed\jssecuritypolicy.h


  ; Write the installation path into the registry
  WriteRegStr HKLM Software\SourceXtreme\${APP_NAME} "Install_Dir" "$INSTDIR"

  ; Write the uninstall keys for Windows
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}" "DisplayName" "${APP_NAME} ${VER_DISPLAY}"
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}" "DisplayVersion" "${VER_DISPLAY}"

  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}" "UninstallString" '"$INSTDIR\uninstall.exe"'
  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}" "NoModify" 1
  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}" "NoRepair" 1
  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}" "VersionMajor" "${VER_MAJOR}"
  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}" "VersionMinor" "${VER_MINOR}"
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}" "URLInfoAbout" "http://www.sourcextreme.com/projects/${APP_NAME_LC}"
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}" "Publisher" "SourceXtreme, Inc"
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}" "HelpLink" "oss@sourcextreme.com"

  WriteUninstaller "uninstall.exe"

SectionEnd

Section "${APP_NAME} Runtime" secRuntime
  SetOutPath "$INSTDIR"
  File qjscmd\qjscmd.exe
  File qjscmdw\qjscmdw.exe
  File stdlib\cmdline.js
  File "$%TQTDIR%\bin\tqt-mt*.dll"
SectionEnd

Section "${APP_NAME} Source" secSrc
  SetOutPath "$INSTDIR\source"
  File *.pro
  File *.pri
  File lgpl.txt
  File readme.txt
  File todo.txt


  SetOutPath "$INSTDIR\source\pcre"
  File pcre\*.pro
  File pcre\*.c
  File pcre\*.h
  
  SetOutPath "$INSTDIR\source\kjs"
  File kjs\*.pro
  File kjs\*.cpp
  File kjs\*.h

  SetOutPath "$INSTDIR\source\builtins"
  File builtins\*.pro
  File builtins\*.cpp
  File builtins\*.h

  SetOutPath "$INSTDIR\source\qtbindings"
  File qtbindings\*.pro
  File qtbindings\*.cpp
  File qtbindings\*.h

  SetOutPath "$INSTDIR\source\kjsembed"
  File kjsembed\*.pro
  File kjsembed\*.cpp
  File kjsembed\*.h

  SetOutPath "$INSTDIR\source\qjscmd"
  File qjscmd\*.pro
  File qjscmd\*.cpp

  
  SetOutPath "$INSTDIR\source\stdlib"
  File stdlib\*.js

  SetOutPath "$INSTDIR\source\tests"
  File tests\*.js
  File tests\*.ui
  
SectionEnd

; Optional section (can be disabled by the user)
Section "Start Menu Shortcuts" secMenu

  SetOutPath "$INSTDIR"
  CreateDirectory "$SMPROGRAMS\${APP_NAME}"
  CreateShortCut "$SMPROGRAMS\${APP_NAME}\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
  CreateShortCut "$SMPROGRAMS\${APP_NAME}\ReadMe.lnk" "$INSTDIR\ReadMe.txt" "" "$INSTDIR\ReadMe.txt" 0
  CreateShortCut "$SMPROGRAMS\${APP_NAME}\JSConsole.lnk" "$INSTDIR\qjscmdw.exe" "cmdline.js"


; Create internet links
  WriteINIStr "$SMPROGRAMS\${APP_NAME}\${APP_NAME} Webpage.url" "InternetShortcut" "URL" "http://www.sourcextreme.com/projects/${APP_NAME_LC}/"

SectionEnd

;Descriptions

LangString DESC_secSDK 		${LANG_ENGLISH} "${APP_NAME} static library for embedding into Qt applications."
LangString DESC_secRuntime 	${LANG_ENGLISH} "${APP_NAME} runtime for running scripts standalone."
LangString DESC_secMenu 	${LANG_ENGLISH} "Start menu shortcuts."
LangString DESC_secSrc 		${LANG_ENGLISH} "Source for building ${APP_NAME}."

!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${secSDK} $(DESC_secSDK)
!insertmacro MUI_DESCRIPTION_TEXT ${secRuntime} $(DESC_secRuntime)
!insertmacro MUI_DESCRIPTION_TEXT ${secMenu} $(DESC_secMenu)
!insertmacro MUI_DESCRIPTION_TEXT ${secSrc} $(DESC_secSrc)
!insertmacro MUI_FUNCTION_DESCRIPTION_END

; Uninstaller

Section "Uninstall"

  ; Remove registry keys
  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}"
  DeleteRegKey HKLM SOFTWARE\SourceXtreme\${APP_NAME}

  ; Remove files and uninstaller
  Delete "$INSTDIR\*.*"

  ; Remove source
  Delete "$INSTDIR\include\*.*"
  Delete "$INSTDIR\lib\*.*"
  Delete "$INSTDIR\source\pcre\*.*"
  Delete "$INSTDIR\source\kjsembed\*.*"
  Delete "$INSTDIR\source\kjs\*.*"
  Delete "$INSTDIR\source\qtbindings\*.*"
  Delete "$INSTDIR\source\builtins\*.*"
  Delete "$INSTDIR\source\qjscmd\*.*"
  Delete "$INSTDIR\source\tests\*.*"
  Delete "$INSTDIR\source\stdlib\*.*"
  Delete "$INSTDIR\source\*.*"

  Delete "$INSTDIR\src\*.*"
  ; Remove shortcuts, if any
  Delete "$SMPROGRAMS\${APP_NAME}\*.*"

  ; Remove directories used
  RMDir "$SMPROGRAMS\${APP_NAME}"
  RMDir "$INSTDIR\lib"
  RMDir "$INSTDIR\include"
  RMDir "$INSTDIR\source\pcre"
  RMDir "$INSTDIR\source\kjsembed"
  RMDir "$INSTDIR\source\kjs"
  RMDir "$INSTDIR\source\qtbindings"
  RMDir "$INSTDIR\source\builtins"
  RMDir "$INSTDIR\source\qjscmd"
  RMDir "$INSTDIR\source\tests"
  RMDir "$INSTDIR\source\stdlib"
  RMDir "$INSTDIR\source"

  RMDir "$INSTDIR"

SectionEnd