~ubuntu-branches/debian/stretch/openbabel/stretch

« back to all changes in this revision

Viewing changes to windows-vc2005/Distribution/NSISScriptToCreateInstaller.nsi

  • Committer: Bazaar Package Importer
  • Author(s): Michael Banck
  • Date: 2008-07-22 23:54:58 UTC
  • mfrom: (3.1.10 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080722235458-3o606czluviz4akx
Tags: 2.2.0-2
* Upload to unstable.
* debian/control: Updated descriptions.
* debian/patches/gauss_cube_format.patch: New patch, makes the 
  gaussian cube format available again.
* debian/rules (DEB_DH_MAKESHLIBS_ARGS_libopenbabel3): Removed.
* debian/rules (DEB_CONFIGURE_EXTRA_FLAGS): Likewise.
* debian/libopenbabel3.install: Adjust formats directory to single 
  version hierarchy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
;NSIS Modern User Interface
 
2
;Installer for Open Babel
 
3
 
 
4
;--------------------------------
 
5
;Include Modern UI
 
6
 
 
7
  !include "MUI.nsh"
 
8
 
 
9
; ======================================
 
10
; The main part of this script starts at
 
11
; around line 455
 
12
; ======================================
 
13
 
 
14
;--------------------------------
 
15
;AddToPath functions taken from "Path Manipulation" on NSIS wiki
 
16
 
 
17
!ifndef _AddToPath_nsh
 
18
!define _AddToPath_nsh
 
19
 
 
20
!verbose 3
 
21
!include "WinMessages.NSH"
 
22
!verbose 4
 
23
 
 
24
!ifndef WriteEnvStr_RegKey
 
25
  !ifdef ALL_USERS
 
26
    !define WriteEnvStr_RegKey \
 
27
       'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"'
 
28
  !else
 
29
    !define WriteEnvStr_RegKey 'HKCU "Environment"'
 
30
  !endif
 
31
!endif
 
32
 
 
33
; AddToPath - Adds the given dir to the search path.
 
34
;        Input - head of the stack
 
35
;        Note - Win9x systems requires reboot
 
36
 
 
37
Function AddToPath
 
38
  Exch $0
 
39
  Push $1
 
40
  Push $2
 
41
  Push $3
 
42
 
 
43
  # don't add if the path doesn't exist
 
44
  IfFileExists "$0\*.*" "" AddToPath_done
 
45
 
 
46
  ReadEnvStr $1 PATH
 
47
  Push "$1;"
 
48
  Push "$0;"
 
49
  Call StrStr
 
50
  Pop $2
 
51
  StrCmp $2 "" "" AddToPath_done
 
52
  Push "$1;"
 
53
  Push "$0\;"
 
54
  Call StrStr
 
55
  Pop $2
 
56
  StrCmp $2 "" "" AddToPath_done
 
57
  GetFullPathName /SHORT $3 $0
 
58
  Push "$1;"
 
59
  Push "$3;"
 
60
  Call StrStr
 
61
  Pop $2
 
62
  StrCmp $2 "" "" AddToPath_done
 
63
  Push "$1;"
 
64
  Push "$3\;"
 
65
  Call StrStr
 
66
  Pop $2
 
67
  StrCmp $2 "" "" AddToPath_done
 
68
 
 
69
  Call IsNT
 
70
  Pop $1
 
71
  StrCmp $1 1 AddToPath_NT
 
72
    ; Not on NT
 
73
    StrCpy $1 $WINDIR 2
 
74
    FileOpen $1 "$1\autoexec.bat" a
 
75
    FileSeek $1 -1 END
 
76
    FileReadByte $1 $2
 
77
    IntCmp $2 26 0 +2 +2 # DOS EOF
 
78
      FileSeek $1 -1 END # write over EOF
 
79
    FileWrite $1 "$\r$\nSET PATH=%PATH%;$3$\r$\n"
 
80
    FileClose $1
 
81
    SetRebootFlag true
 
82
    Goto AddToPath_done
 
83
 
 
84
  AddToPath_NT:
 
85
    ReadRegStr $1 ${WriteEnvStr_RegKey} "PATH"
 
86
    StrCmp $1 "" AddToPath_NTdoIt
 
87
      Push $1
 
88
      Call Trim
 
89
      Pop $1
 
90
      StrCpy $0 "$1;$0"
 
91
    AddToPath_NTdoIt:
 
92
      WriteRegExpandStr ${WriteEnvStr_RegKey} "PATH" $0
 
93
      SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
 
94
 
 
95
  AddToPath_done:
 
96
    Pop $3
 
97
    Pop $2
 
98
    Pop $1
 
99
    Pop $0
 
100
FunctionEnd
 
101
 
 
102
; RemoveFromPath - Remove a given dir from the path
 
103
;     Input: head of the stack
 
104
 
 
105
Function un.RemoveFromPath
 
106
  Exch $0
 
107
  Push $1
 
108
  Push $2
 
109
  Push $3
 
110
  Push $4
 
111
  Push $5
 
112
  Push $6
 
113
 
 
114
  IntFmt $6 "%c" 26 # DOS EOF
 
115
 
 
116
  Call un.IsNT
 
117
  Pop $1
 
118
  StrCmp $1 1 unRemoveFromPath_NT
 
119
    ; Not on NT
 
120
    StrCpy $1 $WINDIR 2
 
121
    FileOpen $1 "$1\autoexec.bat" r
 
122
    GetTempFileName $4
 
123
    FileOpen $2 $4 w
 
124
    GetFullPathName /SHORT $0 $0
 
125
    StrCpy $0 "SET PATH=%PATH%;$0"
 
126
    Goto unRemoveFromPath_dosLoop
 
127
 
 
128
    unRemoveFromPath_dosLoop:
 
129
      FileRead $1 $3
 
130
      StrCpy $5 $3 1 -1 # read last char
 
131
      StrCmp $5 $6 0 +2 # if DOS EOF
 
132
        StrCpy $3 $3 -1 # remove DOS EOF so we can compare
 
133
      StrCmp $3 "$0$\r$\n" unRemoveFromPath_dosLoopRemoveLine
 
134
      StrCmp $3 "$0$\n" unRemoveFromPath_dosLoopRemoveLine
 
135
      StrCmp $3 "$0" unRemoveFromPath_dosLoopRemoveLine
 
136
      StrCmp $3 "" unRemoveFromPath_dosLoopEnd
 
137
      FileWrite $2 $3
 
138
      Goto unRemoveFromPath_dosLoop
 
139
      unRemoveFromPath_dosLoopRemoveLine:
 
140
        SetRebootFlag true
 
141
        Goto unRemoveFromPath_dosLoop
 
142
 
 
143
    unRemoveFromPath_dosLoopEnd:
 
144
      FileClose $2
 
145
      FileClose $1
 
146
      StrCpy $1 $WINDIR 2
 
147
      Delete "$1\autoexec.bat"
 
148
      CopyFiles /SILENT $4 "$1\autoexec.bat"
 
149
      Delete $4
 
150
      Goto unRemoveFromPath_done
 
151
 
 
152
  unRemoveFromPath_NT:
 
153
    ReadRegStr $1 ${WriteEnvStr_RegKey} "PATH"
 
154
    StrCpy $5 $1 1 -1 # copy last char
 
155
    StrCmp $5 ";" +2 # if last char != ;
 
156
      StrCpy $1 "$1;" # append ;
 
157
    Push $1
 
158
    Push "$0;"
 
159
    Call un.StrStr ; Find `$0;` in $1
 
160
    Pop $2 ; pos of our dir
 
161
    StrCmp $2 "" unRemoveFromPath_done
 
162
      ; else, it is in path
 
163
      # $0 - path to add
 
164
      # $1 - path var
 
165
      StrLen $3 "$0;"
 
166
      StrLen $4 $2
 
167
      StrCpy $5 $1 -$4 # $5 is now the part before the path to remove
 
168
      StrCpy $6 $2 "" $3 # $6 is now the part after the path to remove
 
169
      StrCpy $3 $5$6
 
170
 
 
171
      StrCpy $5 $3 1 -1 # copy last char
 
172
      StrCmp $5 ";" 0 +2 # if last char == ;
 
173
        StrCpy $3 $3 -1 # remove last char
 
174
 
 
175
      WriteRegExpandStr ${WriteEnvStr_RegKey} "PATH" $3
 
176
      SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
 
177
 
 
178
  unRemoveFromPath_done:
 
179
    Pop $6
 
180
    Pop $5
 
181
    Pop $4
 
182
    Pop $3
 
183
    Pop $2
 
184
    Pop $1
 
185
    Pop $0
 
186
FunctionEnd
 
187
 
 
188
 
 
189
 
 
190
; AddToEnvVar - Adds the given value to the given environment var
 
191
;        Input - head of the stack $0 environement variable $1=value to add
 
192
;        Note - Win9x systems requires reboot
 
193
 
 
194
Function AddToEnvVar
 
195
 
 
196
  Exch $1 ; $1 has environment variable value
 
197
  Exch
 
198
  Exch $0 ; $0 has environment variable name
 
199
 
 
200
  DetailPrint "Adding $1 to $0"
 
201
  Push $2
 
202
  Push $3
 
203
  Push $4
 
204
 
 
205
 
 
206
  ReadEnvStr $2 $0
 
207
  Push "$2;"
 
208
  Push "$1;"
 
209
  Call StrStr
 
210
  Pop $3
 
211
  StrCmp $3 "" "" AddToEnvVar_done
 
212
 
 
213
  Push "$2;"
 
214
  Push "$1\;"
 
215
  Call StrStr
 
216
  Pop $3
 
217
  StrCmp $3 "" "" AddToEnvVar_done
 
218
  
 
219
 
 
220
  Call IsNT
 
221
  Pop $2
 
222
  StrCmp $2 1 AddToEnvVar_NT
 
223
    ; Not on NT
 
224
    StrCpy $2 $WINDIR 2
 
225
    FileOpen $2 "$2\autoexec.bat" a
 
226
    FileSeek $2 -1 END
 
227
    FileReadByte $2 $3
 
228
    IntCmp $3 26 0 +2 +2 # DOS EOF
 
229
      FileSeek $2 -1 END # write over EOF
 
230
    FileWrite $2 "$\r$\nSET $0=%$0%;$4$\r$\n"
 
231
    FileClose $2
 
232
    SetRebootFlag true
 
233
    Goto AddToEnvVar_done
 
234
 
 
235
  AddToEnvVar_NT:
 
236
    ReadRegStr $2 ${WriteEnvStr_RegKey} $0
 
237
    StrCpy $3 $2 1 -1 # copy last char
 
238
    StrCmp $3 ";" 0 +2 # if last char == ;
 
239
      StrCpy $2 $2 -1 # remove last char
 
240
    StrCmp $2 "" AddToEnvVar_NTdoIt
 
241
      StrCpy $1 "$2;$1"
 
242
    AddToEnvVar_NTdoIt:
 
243
      WriteRegExpandStr ${WriteEnvStr_RegKey} $0 $1
 
244
      SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
 
245
 
 
246
  AddToEnvVar_done:
 
247
    Pop $4
 
248
    Pop $3
 
249
    Pop $2
 
250
    Pop $0
 
251
    Pop $1
 
252
 
 
253
FunctionEnd
 
254
 
 
255
; RemoveFromEnvVar - Remove a given value from a environment var
 
256
;     Input: head of the stack
 
257
 
 
258
Function un.RemoveFromEnvVar
 
259
 
 
260
  Exch $1 ; $1 has environment variable value
 
261
  Exch
 
262
  Exch $0 ; $0 has environment variable name
 
263
 
 
264
  DetailPrint "Removing $1 from $0"
 
265
  Push $2
 
266
  Push $3
 
267
  Push $4
 
268
  Push $5
 
269
  Push $6
 
270
  Push $7
 
271
 
 
272
  IntFmt $7 "%c" 26 # DOS EOF
 
273
 
 
274
  Call un.IsNT
 
275
  Pop $2
 
276
  StrCmp $2 1 unRemoveFromEnvVar_NT
 
277
    ; Not on NT
 
278
    StrCpy $2 $WINDIR 2
 
279
    FileOpen $2 "$2\autoexec.bat" r
 
280
    GetTempFileName $5
 
281
    FileOpen $3 $5 w
 
282
    GetFullPathName /SHORT $1 $1
 
283
    StrCpy $1 "SET $0=%$0%;$1"
 
284
    Goto unRemoveFromEnvVar_dosLoop
 
285
 
 
286
    unRemoveFromEnvVar_dosLoop:
 
287
      FileRead $2 $4
 
288
      StrCpy $6 $4 1 -1 # read last char
 
289
      StrCmp $6 $7 0 +2 # if DOS EOF
 
290
        StrCpy $4 $4 -1 # remove DOS EOF so we can compare
 
291
      StrCmp $4 "$1$\r$\n" unRemoveFromEnvVar_dosLoopRemoveLine
 
292
      StrCmp $4 "$1$\n" unRemoveFromEnvVar_dosLoopRemoveLine
 
293
      StrCmp $4 "$1" unRemoveFromEnvVar_dosLoopRemoveLine
 
294
      StrCmp $4 "" unRemoveFromEnvVar_dosLoopEnd
 
295
      FileWrite $3 $4
 
296
      Goto unRemoveFromEnvVar_dosLoop
 
297
      unRemoveFromEnvVar_dosLoopRemoveLine:
 
298
        SetRebootFlag true
 
299
        Goto unRemoveFromEnvVar_dosLoop
 
300
 
 
301
    unRemoveFromEnvVar_dosLoopEnd:
 
302
      FileClose $3
 
303
      FileClose $2
 
304
      StrCpy $2 $WINDIR 2
 
305
      Delete "$2\autoexec.bat"
 
306
      CopyFiles /SILENT $5 "$2\autoexec.bat"
 
307
      Delete $5
 
308
      Goto unRemoveFromEnvVar_done
 
309
 
 
310
  unRemoveFromEnvVar_NT:
 
311
    ReadRegStr $2 ${WriteEnvStr_RegKey} $0
 
312
    StrCpy $6 $2 1 -1 # copy last char
 
313
    StrCmp $6 ";" +2 # if last char != ;
 
314
      StrCpy $2 "$2;" # append ;
 
315
    Push $2
 
316
    Push "$1;"
 
317
    Call un.StrStr ; Find `$1;` in $2
 
318
    Pop $3 ; pos of our dir
 
319
    StrCmp $3 "" unRemoveFromEnvVar_done
 
320
      ; else, it is in path
 
321
      # $1 - path to add
 
322
      # $2 - path var
 
323
      StrLen $4 "$1;"
 
324
      StrLen $5 $3
 
325
      StrCpy $6 $2 -$5 # $6 is now the part before the path to remove
 
326
      StrCpy $7 $3 "" $4 # $7 is now the part after the path to remove
 
327
      StrCpy $4 $6$7
 
328
 
 
329
      StrCpy $6 $4 1 -1 # copy last char
 
330
      StrCmp $6 ";" 0 +2 # if last char == ;
 
331
      StrCpy $4 $4 -1 # remove last char
 
332
 
 
333
      WriteRegExpandStr ${WriteEnvStr_RegKey} $0 $4
 
334
      SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
 
335
 
 
336
  unRemoveFromEnvVar_done:
 
337
    Pop $7
 
338
    Pop $6
 
339
    Pop $5
 
340
    Pop $4
 
341
    Pop $3
 
342
    Pop $2
 
343
    Pop $1
 
344
    Pop $0
 
345
FunctionEnd
 
346
 
 
347
 
 
348
 
 
349
 
 
350
!ifndef IsNT_KiCHiK
 
351
!define IsNT_KiCHiK
 
352
 
 
353
###########################################
 
354
#            Utility Functions            #
 
355
###########################################
 
356
 
 
357
; IsNT
 
358
; no input
 
359
; output, top of the stack = 1 if NT or 0 if not
 
360
;
 
361
; Usage:
 
362
;   Call IsNT
 
363
;   Pop $R0
 
364
;  ($R0 at this point is 1 or 0)
 
365
 
 
366
!macro IsNT un
 
367
Function ${un}IsNT
 
368
  Push $0
 
369
  ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
 
370
  StrCmp $0 "" 0 IsNT_yes
 
371
  ; we are not NT.
 
372
  Pop $0
 
373
  Push 0
 
374
  Return
 
375
 
 
376
  IsNT_yes:
 
377
    ; NT!!!
 
378
    Pop $0
 
379
    Push 1
 
380
FunctionEnd
 
381
!macroend
 
382
!insertmacro IsNT ""
 
383
!insertmacro IsNT "un."
 
384
 
 
385
!endif ; IsNT_KiCHiK
 
386
 
 
387
; StrStr
 
388
; input, top of stack = string to search for
 
389
;        top of stack-1 = string to search in
 
390
; output, top of stack (replaces with the portion of the string remaining)
 
391
; modifies no other variables.
 
392
;
 
393
; Usage:
 
394
;   Push "this is a long ass string"
 
395
;   Push "ass"
 
396
;   Call StrStr
 
397
;   Pop $R0
 
398
;  ($R0 at this point is "ass string")
 
399
 
 
400
!macro StrStr un
 
401
Function ${un}StrStr
 
402
Exch $R1 ; st=haystack,old$R1, $R1=needle
 
403
  Exch    ; st=old$R1,haystack
 
404
  Exch $R2 ; st=old$R1,old$R2, $R2=haystack
 
405
  Push $R3
 
406
  Push $R4
 
407
  Push $R5
 
408
  StrLen $R3 $R1
 
409
  StrCpy $R4 0
 
410
  ; $R1=needle
 
411
  ; $R2=haystack
 
412
  ; $R3=len(needle)
 
413
  ; $R4=cnt
 
414
  ; $R5=tmp
 
415
  loop:
 
416
    StrCpy $R5 $R2 $R3 $R4
 
417
    StrCmp $R5 $R1 done
 
418
    StrCmp $R5 "" done
 
419
    IntOp $R4 $R4 + 1
 
420
    Goto loop
 
421
done:
 
422
  StrCpy $R1 $R2 "" $R4
 
423
  Pop $R5
 
424
  Pop $R4
 
425
  Pop $R3
 
426
  Pop $R2
 
427
  Exch $R1
 
428
FunctionEnd
 
429
!macroend
 
430
!insertmacro StrStr ""
 
431
!insertmacro StrStr "un."
 
432
 
 
433
!endif ; _AddToPath_nsh
 
434
 
 
435
Function Trim ; Added by Pelaca
 
436
        Exch $R1
 
437
        Push $R2
 
438
Loop:
 
439
        StrCpy $R2 "$R1" 1 -1
 
440
        StrCmp "$R2" " " RTrim
 
441
        StrCmp "$R2" "$\n" RTrim
 
442
        StrCmp "$R2" "$\r" RTrim
 
443
        StrCmp "$R2" ";" RTrim
 
444
        GoTo Done
 
445
RTrim:  
 
446
        StrCpy $R1 "$R1" -1
 
447
        Goto Loop
 
448
Done:
 
449
        Pop $R2
 
450
        Exch $R1
 
451
FunctionEnd
 
452
 
 
453
;--------------------------------
 
454
;General
 
455
 
 
456
  ;OpenBabel version
 
457
  !define OBVersion 2.2.0Snapshot1
 
458
 
 
459
  ;Name and file
 
460
  Name "OpenBabel ${OBVERSION}"
 
461
  OutFile "OpenBabel${OBVERSION}_Windows_Installer.exe"
 
462
 
 
463
  ;Default installation folder
 
464
  InstallDir "$PROGRAMFILES\OpenBabel-${OBVERSION}"
 
465
  
 
466
  ;Get installation folder from registry if available
 
467
  InstallDirRegKey HKCU "Software\OpenBabel ${OBVERSION}" ""
 
468
 
 
469
;--------------------------------
 
470
;Variables
 
471
 
 
472
  Var MUI_TEMP
 
473
  Var STARTMENU_FOLDER
 
474
 
 
475
;--------------------------------
 
476
;Interface Settings
 
477
 
 
478
  ;!define MUI_ICON "babel.ico"
 
479
  ;!define MUI_UNICON "babel.ico"
 
480
  !define MUI_ABORTWARNING
 
481
  !define MUI_HEADERIMAGE
 
482
  !define MUI_HEADERIMAGE_BITMAP "logo_small.bmp"
 
483
  !define MUI_WELCOMEFINISHPAGE_BITMAP "logo_big.bmp"
 
484
  !define MUI_FINISHPAGE_RUN "$INSTDIR/OBGUII.exe"
 
485
  !define MUI_FINISHPAGE_SHOWREADME "http://openbabel.sourceforge.net/wiki/OpenBabelGUI"
 
486
 
 
487
;--------------------------------
 
488
;Pages
 
489
 
 
490
  !insertmacro MUI_PAGE_WELCOME
 
491
  !insertmacro MUI_PAGE_LICENSE "../../COPYING"
 
492
  !insertmacro MUI_PAGE_DIRECTORY
 
493
 
 
494
  ;Start Menu Folder Page Configuration
 
495
  !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU" 
 
496
  !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\OpenBabel ${OBVERSION}" 
 
497
  !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
 
498
  !insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER
 
499
 
 
500
  !insertmacro MUI_PAGE_INSTFILES
 
501
  !insertmacro MUI_PAGE_FINISH
 
502
  
 
503
  !insertmacro MUI_UNPAGE_CONFIRM
 
504
  !insertmacro MUI_UNPAGE_INSTFILES
 
505
  
 
506
;--------------------------------
 
507
;Languages
 
508
 
 
509
  !insertmacro MUI_LANGUAGE "English"
 
510
 
 
511
;--------------------------------
 
512
;Installer Sections
 
513
 
 
514
Section "Dummy Section" SecDummy
 
515
 
 
516
  SetOutPath "$INSTDIR"
 
517
  
 
518
  ;ADD YOUR OWN FILES HERE...
 
519
  File /r ExampleFiles\150mols.smi
 
520
  File /r ExampleFiles\FourSmallMols.cml
 
521
  File /r ExampleFiles\serotonin.mol
 
522
  File /r ExampleFiles\oxamide.cml
 
523
  File /oname=License.txt ..\..\COPYING
 
524
  File /oname=OBGUII.exe ..\OpenBabelDLL\OBGUII.exe
 
525
  File /oname=OBGUII.exe.manifest ..\OpenBabelDLL\OBGUII.exe.manifest
 
526
  File ..\OpenBabelDLL\OpenBabelDLL.dll
 
527
  File ..\OpenBabelDLL\babel.exe
 
528
  File ..\OBGUII\OpenBabelGUI.html
 
529
  File ..\zlib1.dll
 
530
  File ..\libxml2.dll
 
531
  File ..\iconv.dll
 
532
  File ..\libinchi.dll
 
533
  File ..\..\data\SMARTS_InteLigand.txt
 
534
  File ..\..\data\psa.txt
 
535
  File ..\..\data\mr.txt
 
536
  File ..\..\data\logp.txt
 
537
  File ..\..\data\ghemical.prm
 
538
  File ..\..\data\mmffang.par
 
539
  File ..\..\data\mmffbndk.par
 
540
  File ..\..\data\mmffbond.par
 
541
  File ..\..\data\mmffchg.par
 
542
  File ..\..\data\mmffdef.par
 
543
  File ..\..\data\mmffdfsb.par
 
544
  File ..\..\data\mmffoop.par
 
545
  File ..\..\data\mmffpbci.par
 
546
  File ..\..\data\mmffprop.par
 
547
  File ..\..\data\mmffstbn.par
 
548
  File ..\..\data\mmfftor.par
 
549
  File ..\..\data\mmffvdw.par
 
550
  File ..\..\data\fragments.txt
 
551
  File ..\..\data\plugindefines.txt
 
552
  File ..\..\data\space-groups.txt
 
553
  File ..\..\data\space-groups.xsl
 
554
  File ..\..\data\ringtyp.txt
 
555
  File ..\..\data\UFF.prm
 
556
File vcredist_x86.exe
 
557
  
 
558
  ;Store installation folder
 
559
  WriteRegStr HKCU "Software\OpenBabel ${OBVERSION}" "" $INSTDIR
 
560
  
 
561
  ;Install VC++ 2005 redistributable
 
562
  ExecWait '"$INSTDIR/vcredist_x86.exe" /q:a'
 
563
 
 
564
  ;Create uninstaller
 
565
  WriteUninstaller "$INSTDIR\Uninstall.exe"
 
566
 
 
567
  ;Create shortcuts
 
568
  !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
 
569
    SetOutPath "$DESKTOP" ;side-effect is to set working dir for shortcuts
 
570
    CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
 
571
    CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Open Babel GUI.lnk" "$INSTDIR\OBGUII.exe"
 
572
    CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Guide to using Open Babel GUI (web).lnk" "http://openbabel.sourceforge.net/wiki/OpenBabelGUI" "" "$SYSDIR\winhlp32.exe" 
 
573
    CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Guide to using babel (web).lnk" "http://openbabel.sourceforge.net/wiki/Tutorial:Basic_Usage" "" "$SYSDIR\winhlp32.exe"
 
574
    CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
 
575
  !insertmacro MUI_STARTMENU_WRITE_END
 
576
 
 
577
  ;Add to PATH
 
578
  Push $INSTDIR
 
579
  Call AddToPath
 
580
 
 
581
SectionEnd
 
582
 
 
583
;--------------------------------
 
584
;Descriptions
 
585
 
 
586
  ;Language strings
 
587
  LangString DESC_SecDummy ${LANG_ENGLISH} "A test section."
 
588
 
 
589
  ;Assign language strings to sections
 
590
  !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
 
591
    !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)
 
592
  !insertmacro MUI_FUNCTION_DESCRIPTION_END
 
593
 
 
594
;--------------------------------
 
595
;Uninstaller Section
 
596
 
 
597
Section "Uninstall"
 
598
 
 
599
  ;ADD YOUR OWN FILES HERE...
 
600
  Delete "$INSTDIR\150mols.smi"
 
601
  Delete "$INSTDIR\babel.exe"
 
602
  Delete "$INSTDIR\FourSmallMols.cml"
 
603
  Delete "$INSTDIR\zlib1.dll"
 
604
  Delete "$INSTDIR\SMARTS_InteLigand.txt"
 
605
  Delete "$INSTDIR\psa.txt"
 
606
  Delete "$INSTDIR\mr.txt"
 
607
  Delete "$INSTDIR\logp.txt"
 
608
  Delete "$INSTDIR\ghemical.prm"
 
609
  Delete "$INSTDIR\serotonin.mol"
 
610
  Delete "$INSTDIR\oxamide.cml"
 
611
  Delete "$INSTDIR\OBGUII.exe"
 
612
  Delete "$INSTDIR\OBGUII.exe.manifest"
 
613
  Delete "$INSTDIR\OpenBabelDLL.dll"
 
614
  Delete "$INSTDIR\libxml2.dll"
 
615
  Delete "$INSTDIR\iconv.dll"
 
616
  Delete "$INSTDIR\License.txt"
 
617
  Delete "$INSTDIR\OpenBabelGUI.html"
 
618
  Delete "$INSTDIR\libinchi.dll"
 
619
  Delete "$INSTDIR\Uninstall.exe"
 
620
  Delete "$INSTDIR\vcredist_x86.exe"
 
621
 
 
622
  RMDir "$INSTDIR"
 
623
  !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
 
624
    
 
625
  Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk"
 
626
  Delete "$SMPROGRAMS\$MUI_TEMP\Open Babel GUI.lnk"
 
627
  Delete "$SMPROGRAMS\$MUI_TEMP\Guide to using Open Babel GUI (web).lnk"
 
628
  Delete "$SMPROGRAMS\$MUI_TEMP\Guide to using babel (web).lnk"
 
629
 
 
630
  ;Remove from PATH
 
631
  push $INSTDIR
 
632
  Call un.RemoveFromPath
 
633
  
 
634
  ;Delete empty start menu parent diretories
 
635
  StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP"
 
636
 
 
637
  startMenuDeleteLoop:
 
638
        ClearErrors
 
639
    RMDir $MUI_TEMP
 
640
    GetFullPathName $MUI_TEMP "$MUI_TEMP\.."
 
641
    
 
642
    IfErrors startMenuDeleteLoopDone
 
643
  
 
644
    StrCmp $MUI_TEMP $SMPROGRAMS startMenuDeleteLoopDone startMenuDeleteLoop
 
645
  startMenuDeleteLoopDone:
 
646
 
 
647
  DeleteRegKey /ifempty HKCU "Software\OpenBabel ${OBVERSION}"
 
648
  DeleteRegKey          HKCU "Software\OpenBabelGUI"
 
649
 
 
650
SectionEnd