Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

[bc9e24]: utils / hugin.nsi Maximize Restore History

Download this file

hugin.nsi    310 lines (256 with data), 8.8 kB

  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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
;--------------------------------
!define HUGIN_VERSION "0.7.0 beta4"
!define DISPLAY_NAME "Hugin ${HUGIN_VERSION}"
;!define HAVE_MINGW
;!define NEED_MINGW
;!define HUGIN_EXPERIMENTAL_TOOLS
!define HUGIN_ALLINONE
;--------------------------------
;Include Modern UI
!include "MUI.nsh"
;--------------------------------
# [Installer Attributes]
Name "${DISPLAY_NAME}"
!ifdef HUGIN_ALLINONE
OutFile "hugin-0.6.1_allinone_setup.exe"
!else
OutFile "hugin-0.6.1_setup.exe"
!endif
Caption "${DISPLAY_NAME}"
# [Licence Attributes]
LicenseText "Hugin and PanoramaTools are distributed under the GNU General Public License :"
LicenseData "LICENCE.txt"
# [Directory Selection]
InstallDir "$PROGRAMFILES\hugin"
DirText "Select the directory to install Hugin in:"
# [Additional Installer Settings ]
SetCompress force
SetCompressor lzma
;--------------------------------
;Interface Settings
ShowInstDetails show
AutoCloseWindow false
SilentInstall normal
CRCCheck on
SetCompress auto
SetDatablockOptimize on
;SetOverwrite ifnewer
XPStyle on
ComponentText "Choose components"
# [Background Gradient]
BGGradient off
!define MUI_ABORTWARNING
;--------------------------------
# [Pages]
!insertmacro MUI_PAGE_LICENSE "LICENCE.txt"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!define MUI_FINISHPAGE_RUN "$INSTDIR\hugin.exe"
!define MUI_FINISHPAGE_NOREBOOTSUPPORT
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
;--------------------------------
;Languages
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
# [Files]
Section "Hugin program files"
SectionIn RO
SetOutPath "$INSTDIR"
File "hugin.exe"
File "LICENCE.txt"
File "NEWS.txt"
File "LICENCE_VIGRA.txt"
File "LICENCE_JHEAD.txt"
File "AUTHORS.txt"
File "README_WINDOWS.txt"
File "fulla.exe"
File "nona.exe"
File "nona_gui.exe"
File "autooptimiser.exe"
!ifdef HUGIN_EXPERIMENTAL_TOOLS
File "automatch.exe"
File "autopano_old.exe"
File "panosifter.exe"
File "sift_keypoints.exe"
File "zhang_undistort.exe"
!endif
!ifdef HUGIN_NEED_MINGW
File "mingwm10.dll"
!endif
!ifdef HUGIN_ALLINONE
;File "PTStitcher.exe"
File "panotools/PTblender.exe"
File "panotools/PTinfo.exe"
File "panotools/PTtiffdump.exe"
File "panotools/PTcrop.exe"
File "panotools/PTtiff2psd.exe"
File "panotools/PTOptimizer.exe"
File "panotools/PTmender.exe"
File "panotools/PTuncrop.exe"
File "panotools/PTmasker.exe"
File "panotools/PTroller.exe"
File "panotools/AUTHORS"
File "panotools/ChangeLog"
File "panotools/README"
File "panotools/TODO"
File "panotools/doc/PTblender.readme"
File "panotools/doc/PTmender.readme"
File "panotools/doc/Optimize.txt"
File "panotools/doc/stitch.txt"
File "enblend/README"
File "enblend/ChangeLog"
File "enblend/VIGRA_LICENSE"
File "enblend/enblend.exe"
File "enblend/TODO"
File "enblend/AUTHORS"
File "enblend/INSTALL"
File "enblend/READMEWIN"
File "enblend/COPYING"
File "enblend/NEWS"
;File "autopano.exe"
;WriteRegStr HKCU "Software\hugin\AutoPanoKolor" "AutopanoExe" "$INSTDIR\autopano.exe"
WriteRegStr HKCU "Software\hugin\Enblend" "EnblendExe" "$INSTDIR\enblend\enblend.exe"
WriteRegStr HKCU "Software\hugin\Panotools" "PTStitcherExe" "$INSTDIR\panotools\PTmender.exe"
!endif
SetOutPath "$INSTDIR\locale"
File /r "locale\*"
SetOutPath "$INSTDIR\xrc"
File /r "xrc\*"
; Write the installation path into the registry
WriteRegStr HKLM SOFTWARE\Hugin "Install_Dir" "$INSTDIR"
; Write the uninstall keys for Windows
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Hugin" "DisplayName" "${DISPLAY_NAME}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Hugin" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Hugin" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Hugin" "NoRepair" 1
WriteUninstaller "$INSTDIR\uninstall.exe"
SectionEnd
# [Shortcuts]
Section "Create shortcuts in Start Menu"
;try to read from registry if last installation installed for All Users/Current User
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Hugin\Backup" \
"Shortcuts"
StrCmp $0 "" cont exists
cont:
SetShellVarContext all
MessageBox MB_YESNO "Do you want to install Hugin for all users on this computer ?" IDYES AllUsers
SetShellVarContext current
AllUsers:
StrCpy $0 $SMPROGRAMS
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Hugin\Backup" \
"Shortcuts" "$0"
exists:
CreateDirectory "$0\Hugin"
SetOutPath $INSTDIR
CreateShortCut "$0\Hugin\Hugin.lnk" "$INSTDIR\hugin.exe"
CreateShortCut "$0\Hugin\nona_gui.lnk" "$INSTDIR\nona_gui.exe"
CreateShortCut "$0\Hugin\PanoGLView.lnk" "$INSTDIR\panoglview.exe"
CreateShortCut "$0\Hugin\Uninstall Hugin.lnk" "$INSTDIR\uninstall.exe"
SectionEnd
Section "Create Quick Launch shortcut"
SetShellVarContext current
CreateShortCut "$QUICKLAUNCH\Hugin.lnk" "$INSTDIR\hugin.exe"
SectionEnd
# [File association]
Section "Associate .pto files with Hugin"
StrCpy $0 $INSTDIR\hugin.exe
WriteRegStr HKCR ".pto" "" "Hugin.pto"
WriteRegStr HKCR ".oto" "" "Hugin.pto"
WriteRegStr HKCR "Hugin.pto" "" "Hugin Project File"
WriteRegStr HKCR "Hugin.pto\DefaultIcon" "" '$0,0'
WriteRegStr HKCR "Hugin.pto\Shell\Open\Command" "" '$0 "%1"'
# User report that nona_gui is associated with a double click on
# pto files. I don't know how to specify the priority of the associations
# StrCpy $0 $INSTDIR\nona_gui.exe
# WriteRegStr HKCR ".pto" "" "nona_gui.pto"
# WriteRegStr HKCR "nona_gui.pto\DefaultIcon" "" '$0,0'
# WriteRegStr HKCR "nona_gui.pto\Shell\Open\Command" "" '$0 "%1"'
Call RefreshShellIcons
SectionEnd
;--------------------------------
# [UnInstallation]
UninstallText "This program will uninstall Hugin ${HUGIN_VERSION}, continue ?"
ShowUninstDetails show
Section "Uninstall"
Delete "$INSTDIR\hugin.exe"
Delete "$INSTDIR\nona.exe"
Delete "$INSTDIR\fulla.exe"
Delete "$INSTDIR\nona_gui.exe"
Delete "$INSTDIR\panoglview.exe"
Delete "$INSTDIR\uninstall.exe"
Delete "$INSTDIR\NEWS.txt"
Delete "$INSTDIR\LICENCE.txt"
Delete "$INSTDIR\LICENSE_VIGRA.txt"
Delete "$INSTDIR\LICENSE_JHEAD.txt"
Delete "$INSTDIR\AUTHORS.txt"
Delete "$INSTDIR\README_WINDOWS.txt"
!ifdef HUGIN_NEED_MINGW
File "mingwm10.dll"
!endif
!ifdef HUGIN_EXPERIMENTAL_TOOLS
Delete "$INSTDIR\automatch.exe"
Delete "$INSTDIR\autooptimiser.exe"
Delete "$INSTDIR\autopano_old.exe"
Delete "$INSTDIR\panosifter.exe"
Delete "$INSTDIR\sift_keypoints.exe"
Delete "$INSTDIR\zhang_undistort.exe"
!endif
!ifdef HUGIN_ALLINONE
Delete "$INSTDIR\pano12.dll"
;Delete "$INSTDIR\PTStitcher.exe"
Delete "$INSTDIR\PTOptimizer.exe"
Delete "PTmender.exe"
Delete "PTblender.exe"
Delete "PTtiff2psd.exe"
Delete "PTuncrop.exe"
Delete "PTOptimizer.exe"
;Delete "$INSTDIR\autopano.exe"
Delete "$INSTDIR\enblend.exe"
Delete "$INSTDIR\ENBLEND_README.txt"
Delete "$INSTDIR\ENBLEND_AUTHORS.txt"
Delete "$INSTDIR\ENBLEND_NEWS.txt"
!endif
RMDir /r "$INSTDIR\locale"
RMDir /r "$INSTDIR\xrc"
RMDir "$INSTDIR"
; Remove icons
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Hugin\Backup" \
"Shortcuts"
Delete "$0\Hugin\Hugin.lnk"
Delete "$0\Hugin\nona_gui.lnk"
Delete "$0\Hugin\PanoGLView.lnk"
Delete "$0\Hugin\Uninstall Hugin.lnk"
RMDir "$0\Hugin"
SetShellVarContext current
Delete "$QUICKLAUNCH\Hugin.lnk"
; Remove registry keys
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Hugin"
DeleteRegKey HKLM SOFTWARE\Hugin
; Remove file association
DeleteRegKey HKCR ".pto"
DeleteRegKey HKCR ".oto"
DeleteRegKey HKCR "Hugin.pto"
DeleteRegKey HKCR "nona_gui.pto"
Call un.RefreshShellIcons
SectionEnd
;--------------------------------
; Functions
;http://nsis.sourceforge.net/archive/viewpage.php?pageid=202
;After changing file associations, you can call this macro to refresh the shell immediatly.
;It calls the shell32 function SHChangeNotify. This will force windows to reload your changes from the registry.
!define SHCNE_ASSOCCHANGED 0x08000000
!define SHCNF_IDLIST 0
Function RefreshShellIcons
; By jerome tremblay - april 2003
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v \
(${SHCNE_ASSOCCHANGED}, ${SHCNF_IDLIST}, 0, 0)'
FunctionEnd
Function un.RefreshShellIcons
; By jerome tremblay - april 2003
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v \
(${SHCNE_ASSOCCHANGED}, ${SHCNF_IDLIST}, 0, 0)'
FunctionEnd
;--------------------------------