~ubuntu-branches/ubuntu/saucy/bluefish/saucy

« back to all changes in this revision

Viewing changes to win32/bluefish.nsi

  • Committer: Package Import Robot
  • Author(s): Daniel Leidert
  • Date: 2013-05-09 14:36:58 UTC
  • mfrom: (17.1.1 experimental)
  • Revision ID: package-import@ubuntu.com-20130509143658-kgqxj5c23oi0lk20
Tags: 2.2.4-2
* debian/control (Standards-Version): Bumped to 3.9.4.
* debian/copyright: Updated.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
; Bluefish Windows NSIS Install Script
3
3
; [bluefish.nsi]
4
4
5
 
;  Copyright (C) 2009-2012 The Bluefish Developers
 
5
;  Copyright (C) 2009-2013 The Bluefish Developers
6
6
;   Shawn Novak <Kernel86@gmail.com>
7
7
;   Daniel Leidert <daniel.leidert@wgdd.de>
8
8
;----------------------------------------------
15
15
!include "WinVer.nsh"
16
16
!include "WinMessages.nsh"
17
17
!include "LogicLib.nsh"
 
18
!define LOGICLIB_SECTIONCMP
18
19
!include "nsDialogs.nsh"
19
20
!include "StrFunc.nsh"
20
21
${StrLoc}
64
65
        OutFile         "${PRODUCT}-${VERSION}-setup.exe"
65
66
!endif
66
67
 
 
68
!define PYTHON_MIN_VERSION "2.7.0"
 
69
!define PYTHON_URL "http://www.python.org/ftp/python/2.7.3"
 
70
!define PYTHON_FILENAME "python-2.7.3.msi"
 
71
!define PYTHON_SIZE "15868"
 
72
 
67
73
!define AS_DICT_URL     "http://www.muleslow.net/files/aspell/lang"
68
74
 
69
75
!define REG_USER_SET    "Software\${PRODUCT}"
75
81
;----------------------------------------------
76
82
Var HKEY
77
83
Var GTK_STATUS
 
84
Var PYTHON_STATUS
78
85
Var StartMenuFolder
79
86
 
80
87
Var FA_Dialog
122
129
 
123
130
; Installer version information
124
131
;----------------------------------------------
125
 
VIProductVersion "2.2.3.0"
 
132
VIProductVersion "2.2.4.0"
126
133
VIAddVersionKey "ProductName" "${PRODUCT}"
127
134
VIAddVersionKey "FileVersion" "${VERSION}"
128
135
VIAddVersionKey "ProductVersion" "${VERSION}"
264
271
        File /r "build\share\enchant\*"
265
272
 
266
273
        SetOutPath "$INSTDIR\share\locale"
267
 
        File /r /x "*_charmap.mo" /x "*_entities.mo" /x "*_htmlbar.mo" /x "*_infbrowser.mo" /x "*_snippets.mo" /x "*_zencoding.mo" "build\share\locale\*"
 
274
        File /r /x "*_charmap.mo" /x "*_entities.mo" /x "*_htmlbar.mo" /x "*_infbrowser.mo" /x "*_snippets.mo" /x "*_vcs.mo" /x "*_zencoding.mo" "build\share\locale\*"
268
275
 
269
276
        SetOutPath "$INSTDIR"
270
277
        WriteUninstaller "$INSTDIR\${UNINSTALL_EXE}"
320
327
        SetOverwrite off
321
328
SectionEnd
322
329
 
323
 
Section "-GTK+ Installer" SecGTK
324
 
        ${If} $GTK_STATUS == ""
325
 
                IfFileExists "$EXEDIR\redist\${GTK_FILENAME}" 0 +13
326
 
                        ${StrRep} $R1 "$(DOWN_LOCAL)" "%s" "${GTK_FILENAME}"
327
 
                        DetailPrint "$R1"
328
 
                        md5dll::GetMD5File "$EXEDIR\redist\${GTK_FILENAME}"
329
 
                        Pop $R0
330
 
                        ${If} $R0 == ${MD5_${GTK_FILENAME}}
331
 
                                DetailPrint "$(DOWN_CHKSUM)"
332
 
                                ExecWait '"$EXEDIR\redist\${GTK_FILENAME}" /S /sideeffects=no /dllpath=root /D=$INSTDIR'
333
 
                                Goto +30 ; Jump to setting version
334
 
                        ${Else}
335
 
                                DetailPrint "$(DOWN_CHKSUM_ERROR)"
336
 
                                Goto +2 ; Jump to '${EndIf}+1
337
 
                        ${EndIf}
338
 
 
339
 
                IntFmt $R1 "%u" 0
340
 
                IntCmp $R1 0 +3 +3 0
341
 
                        DetailPrint "Download Retry $R1 of 5..."
342
 
                        DetailPrint "$(GTK_DOWNLOAD) (${GTK_URL}/${GTK_FILENAME})"
343
 
                Delete "$TEMP\${GTK_FILENAME}" ; Should never happen but just in case
344
 
                inetc::get /TRANSLATE "$(INETC_DOWN)" "$(INETC_CONN)" "$(INETC_TSEC)" "$(INETC_TMIN)" "$(INETC_THOUR)" "$(INETC_TPLUR)" "$(INETC_PROGRESS)" "$(INETC_REMAIN)" "${GTK_URL}/${GTK_FILENAME}" "$TEMP\${GTK_FILENAME}"
345
 
                Pop $R0
346
 
                        StrCmp $R0 "OK" +14
347
 
                        StrCmp $R0 "Terminated" +11
348
 
                        StrCmp $R0 "Cancelled" +10
349
 
                        StrCmp $R0 "Transfer Error" +6
350
 
                        StrCmp $R0 "Connection Error" +5
351
 
                        StrCmp $R0 "SendRequest Error" +4
352
 
                        StrCmp $R0 "File Not Found (404)" +3
353
 
                        StrCmp $R0 "Request Error" +2
354
 
                        StrCmp $R0 "Server Error" +1
355
 
                        IntCmp $R1 5 +3 0 0
356
 
                                IntOp $R1 $R1 + 1
357
 
                                Goto -16
358
 
                                MessageBox MB_OK|MB_ICONEXCLAMATION "$(GTK_FAILED) $R0$\n$\n$(GTK_REQUIRED)"
359
 
                                Return
360
 
                DetailPrint "$(GTK_INSTALL) (${GTK_FILENAME})"
361
 
                ExecWait '"$TEMP\${GTK_FILENAME}" /S /sideeffects=no /dllpath=root /D=$INSTDIR'
362
 
                Delete "$TEMP\${GTK_FILENAME}"
363
 
 
364
 
                IfFileExists "$INSTDIR\${UNINSTALL_GTK}" 0 -6 ; If the uninstaller exists install completed successfully, otherwise display an error
365
 
                        ${If} $HKEY == "Classic"
366
 
                                WriteRegStr HKCU "${REG_USER_SET}" "GTK" "${GTK_VERSION}"
367
 
                        ${Else}
368
 
                                WriteRegStr HKLM "${REG_USER_SET}" "GTK" "${GTK_VERSION}"
369
 
                        ${EndIf}
370
 
        ${EndIf}
371
 
SectionEnd
 
330
SectionGroup "$(SECT_DEPENDS)" SecDepends
 
331
        Section "GTK+ 2.24.8" SecGTK
 
332
                SectionIn 1 RO
 
333
                ${If} $GTK_STATUS == ""
 
334
                        IfFileExists "$INSTDIR\${UNINSTALL_GTK}" +3 0 ; Uninstall previous version
 
335
                                DetailPrint "$(GTK_UNINSTALL)"
 
336
                                ExecWait '"$INSTDIR\${UNINSTALL_GTK}" /S /sideeffects=no /dllpath=root /remove_config=yes'
 
337
        
 
338
                        IfFileExists "$EXEDIR\redist\${GTK_FILENAME}" 0 GtkInstDown
 
339
                                ${StrRep} $R1 "$(DOWN_LOCAL)" "%s" "${GTK_FILENAME}"
 
340
                                DetailPrint "$R1"
 
341
                                md5dll::GetMD5File "$EXEDIR\redist\${GTK_FILENAME}"
 
342
                                Pop $R0
 
343
                                ${If} $R0 == ${MD5_${GTK_FILENAME}}
 
344
                                        DetailPrint "$(DOWN_CHKSUM)"
 
345
                                        ExecWait '"$EXEDIR\redist\${GTK_FILENAME}" /S /sideeffects=no /dllpath=root /D=$INSTDIR'
 
346
                                        Goto GtkInstSetVer ; Jump to setting version
 
347
                                ${Else}
 
348
                                        DetailPrint "$(DOWN_CHKSUM_ERROR)"
 
349
                                        Goto GtkInstDown ; Jump to '${EndIf}+1
 
350
                                ${EndIf}
 
351
        
 
352
        GtkInstDown:
 
353
                        IntFmt $R1 "%u" 0
 
354
                        IntCmp $R1 0 +3 +3 0
 
355
        GtkInstDownRetry:
 
356
                                DetailPrint "Download Retry $R1 of 5..."
 
357
                                DetailPrint "$(GTK_DOWNLOAD) (${GTK_URL}/${GTK_FILENAME})"
 
358
                        Delete "$TEMP\${GTK_FILENAME}" ; Should never happen but just in case
 
359
                        inetc::get /TRANSLATE "$(INETC_DOWN)" "$(INETC_CONN)" "$(INETC_TSEC)" "$(INETC_TMIN)" "$(INETC_THOUR)" "$(INETC_TPLUR)" "$(INETC_PROGRESS)" "$(INETC_REMAIN)" "${GTK_URL}/${GTK_FILENAME}" "$TEMP\${GTK_FILENAME}"
 
360
                        Pop $R0
 
361
                                StrCmp $R0 "OK" +14
 
362
                                StrCmp $R0 "Terminated" +11
 
363
                                StrCmp $R0 "Cancelled" +10
 
364
                                StrCmp $R0 "Transfer Error" +6
 
365
                                StrCmp $R0 "Connection Error" +5
 
366
                                StrCmp $R0 "SendRequest Error" +4
 
367
                                StrCmp $R0 "File Not Found (404)" +3
 
368
                                StrCmp $R0 "Request Error" +2
 
369
                                StrCmp $R0 "Server Error" +1
 
370
                                IntCmp $R1 5 +3 0 0
 
371
                                        IntOp $R1 $R1 + 1
 
372
                                        Goto GtkInstDownRetry
 
373
                                        MessageBox MB_OK|MB_ICONEXCLAMATION "$(GTK_FAILED) $R0$\n$\n$(GTK_REQUIRED)"
 
374
                                        Return
 
375
                        DetailPrint "$(GTK_INSTALL) (${GTK_FILENAME})"
 
376
                        ExecWait '"$TEMP\${GTK_FILENAME}" /S /sideeffects=no /dllpath=root /D=$INSTDIR'
 
377
                        Delete "$TEMP\${GTK_FILENAME}"
 
378
        
 
379
        GtkInstSetVer:
 
380
                        IfFileExists "$INSTDIR\${UNINSTALL_GTK}" 0 -6 ; If the uninstaller exists install completed successfully, otherwise display an error
 
381
                                ${If} $HKEY == "Classic"
 
382
                                        WriteRegStr HKCU "${REG_USER_SET}" "GTK" "${GTK_VERSION}"
 
383
                                ${Else}
 
384
                                        WriteRegStr HKLM "${REG_USER_SET}" "GTK" "${GTK_VERSION}"
 
385
                                ${EndIf}
 
386
                ${EndIf}
 
387
        SectionEnd
 
388
        Section /o "Python 2.7" SecPython
 
389
                ${If} $PYTHON_STATUS == ""
 
390
                        IfFileExists "$EXEDIR\redist\${PYTHON_FILENAME}" 0 PythonInstDown
 
391
                                ${StrRep} $R1 "$(DOWN_LOCAL)" "%s" "${PYTHON_FILENAME}"
 
392
                                DetailPrint "$R1"
 
393
                                md5dll::GetMD5File "$EXEDIR\redist\${PYTHON_FILENAME}"
 
394
                                Pop $R0
 
395
                                ${If} $R0 == ${MD5_${PYTHON_FILENAME}}
 
396
                                        DetailPrint "$(DOWN_CHKSUM)"
 
397
                                        ExecWait 'msiexec /i "$EXEDIR\redist\${PYTHON_FILENAME}"'
 
398
                                ${Else}
 
399
                                        DetailPrint "$(DOWN_CHKSUM_ERROR)"
 
400
                                        Goto PythonInstDown ; Jump to '${EndIf}+1
 
401
                                ${EndIf}
 
402
        
 
403
        PythonInstDown:
 
404
                        IntFmt $R1 "%u" 0
 
405
                        IntCmp $R1 0 +3 +3 0
 
406
        PythonInstDownRetry:
 
407
                                DetailPrint "Download Retry $R1 of 5..."
 
408
                                DetailPrint "$(PYTHON_DOWNLOAD) (${PYTHON_URL}/${PYTHON_FILENAME})"
 
409
                        Delete "$TEMP\${PYTHON_FILENAME}" ; Should never happen but just in case
 
410
                        inetc::get /TRANSLATE "$(INETC_DOWN)" "$(INETC_CONN)" "$(INETC_TSEC)" "$(INETC_TMIN)" "$(INETC_THOUR)" "$(INETC_TPLUR)" "$(INETC_PROGRESS)" "$(INETC_REMAIN)" "${PYTHON_URL}/${PYTHON_FILENAME}" "$TEMP\${PYTHON_FILENAME}"
 
411
                        Pop $R0
 
412
                                StrCmp $R0 "OK" +14
 
413
                                StrCmp $R0 "Terminated" +11
 
414
                                StrCmp $R0 "Cancelled" +10
 
415
                                StrCmp $R0 "Transfer Error" +6
 
416
                                StrCmp $R0 "Connection Error" +5
 
417
                                StrCmp $R0 "SendRequest Error" +4
 
418
                                StrCmp $R0 "File Not Found (404)" +3
 
419
                                StrCmp $R0 "Request Error" +2
 
420
                                StrCmp $R0 "Server Error" +1
 
421
                                IntCmp $R1 5 +3 0 0
 
422
                                        IntOp $R1 $R1 + 1
 
423
                                        Goto PythonInstDownRetry
 
424
                                        MessageBox MB_OK|MB_ICONEXCLAMATION "$(PYTHON_FAILED) $R0$\n$\n$(PYTHON_REQUIRED)"
 
425
                                        Return
 
426
                        DetailPrint "$(PYTHON_INSTALL) (${PYTHON_FILENAME})"
 
427
                        ExecWait 'msiexec /i "$TEMP\${PYTHON_FILENAME}"'
 
428
                        Delete "$TEMP\${PYTHON_FILENAME}"
 
429
                ${EndIf}
 
430
        SectionEnd
 
431
SectionGroupEnd
372
432
 
373
433
SectionGroup "$(SECT_PLUGINS)" SecPlugins
374
434
        SetOverwrite on
378
438
                SetOutPath "$INSTDIR\lib\${PACKAGE}"
379
439
                File "build\lib\${PACKAGE}\charmap.dll"
380
440
                SetOutPath "$INSTDIR\share\locale"
381
 
                File /r /x "${PACKAGE}.mo" /x "*_about.mo" /x "*_entities.mo" /x "*_htmlbar.mo" /x "*_infbrowser.mo" /x "*_snippets.mo" /x "*_zencoding.mo" "build\share\locale\*"
 
441
                File /r /x "${PACKAGE}.mo" /x "*_about.mo" /x "*_entities.mo" /x "*_htmlbar.mo" /x "*_infbrowser.mo" /x "*_snippets.mo" /x "*_vcs.mo" /x "*_zencoding.mo" "build\share\locale\*"
382
442
        SectionEnd
383
443
        Section "$(PLUG_ENTITIES)" SecPlEntities
384
444
                SetOutPath "$INSTDIR\lib\${PACKAGE}"
385
445
                File "build\lib\${PACKAGE}\entities.dll"
386
446
                SetOutPath "$INSTDIR\share\locale"
387
 
                File /r /x "${PACKAGE}.mo" /x "*_about.mo" /x "*_charmap.mo" /x "*_htmlbar.mo" /x "*_infbrowser.mo" /x "*_snippets.mo" /x "*_zencoding.mo" "build\share\locale\*"
 
447
                File /r /x "${PACKAGE}.mo" /x "*_about.mo" /x "*_charmap.mo" /x "*_htmlbar.mo" /x "*_infbrowser.mo" /x "*_snippets.mo" /x "*_vcs.mo" /x "*_zencoding.mo" "build\share\locale\*"
388
448
        SectionEnd
389
449
        Section "$(PLUG_HTMLBAR)" SecPlHTMLbar
390
450
                SetOutPath "$INSTDIR\lib\${PACKAGE}"
392
452
                SetOutPath "$INSTDIR\share\${PACKAGE}\plugins\htmlbar"
393
453
                File /r "build\share\${PACKAGE}\plugins\htmlbar\*"
394
454
                SetOutPath "$INSTDIR\share\locale"
395
 
                File /r /x "${PACKAGE}.mo" /x "*_about.mo" /x "*_charmap.mo" /x "*_entities.mo" /x "*_infbrowser.mo" /x "*_snippets.mo" /x "*_zencoding.mo" "build\share\locale\*"
 
455
                File /r /x "${PACKAGE}.mo" /x "*_about.mo" /x "*_charmap.mo" /x "*_entities.mo" /x "*_infbrowser.mo" /x "*_snippets.mo" /x "*_vcs.mo" /x "*_zencoding.mo" "build\share\locale\*"
396
456
        SectionEnd
397
457
        Section "$(PLUG_INFBROWSER)" SecPlInfBrowser
398
458
                SetOutPath "$INSTDIR\lib\${PACKAGE}"
399
459
                File "build\lib\${PACKAGE}\infbrowser.dll"
400
460
                SetOutPath "$INSTDIR\share\locale"
401
 
                File /r /x "${PACKAGE}.mo" /x "*_about.mo" /x "*_charmap.mo" /x "*_entities.mo" /x "*_htmlbar.mo" /x "*_snippets.mo" /x "*_zencoding.mo" "build\share\locale\*"
 
461
                File /r /x "${PACKAGE}.mo" /x "*_about.mo" /x "*_charmap.mo" /x "*_entities.mo" /x "*_htmlbar.mo" /x "*_snippets.mo" /x "*_vcs.mo" /x "*_zencoding.mo" "build\share\locale\*"
402
462
        SectionEnd
403
463
        Section "$(PLUG_SNIPPETS)" SecPlSnippets
404
464
                SetOutPath "$INSTDIR\lib\${PACKAGE}"
405
465
                File "build\lib\${PACKAGE}\snippets.dll"
406
466
                SetOutPath "$INSTDIR\share\locale"
407
 
                File /r /x "${PACKAGE}.mo" /x "*_about.mo" /x "*_charmap.mo" /x "*_entities.mo" /x "*_htmlbar.mo" /x "*_infbrowser.mo" /x "*_zencoding.mo" "build\share\locale\*"
 
467
                File /r /x "${PACKAGE}.mo" /x "*_about.mo" /x "*_charmap.mo" /x "*_entities.mo" /x "*_htmlbar.mo" /x "*_infbrowser.mo" /x "*_vcs.mo" /x "*_zencoding.mo" "build\share\locale\*"
408
468
        SectionEnd
409
 
;       Section "$(PLUG_ZENDCODING)" SecPlZendcoding
 
469
;       Section "$(PLUG_VCS)" SecPlVcs
410
470
;               SetOutPath "$INSTDIR\lib\${PACKAGE}"
411
 
;               File "build\lib\${PACKAGE}\zendcoding.dll"
412
 
;               SetOutPath "$INSTDIR\share\${PACKAGE}\plugins\zendcoding"
413
 
;               File /r "build\share\${PACKAGE}\plugins\zendcoding\*"
 
471
;               File "build\lib\${PACKAGE}\vcs.dll"
414
472
;               SetOutPath "$INSTDIR\share\locale"
415
 
;               File /r /x "${PACKAGE}.mo" /x "*_about.mo" /x "*_charmap.mo" /x "*_entities.mo" /x "*_htmlbar.mo" /x "*_infbrowser.mo" /x "*_snippets.mo" "build\share\locale\*"
 
473
;               File /nonfatal /r /x "${PACKAGE}.mo" /x "*_about.mo" /x "*_charmap.mo" /x "*_entities.mo" /x "*_htmlbar.mo" /x "*_infbrowser.mo" /x "*_snippets.mo" /x "*_zencoding.mo" "build\share\locale\*"
416
474
;       SectionEnd
 
475
        Section /o "$(PLUG_ZENCODING)" SecPlZencoding
 
476
                SetOutPath "$INSTDIR\lib\${PACKAGE}"
 
477
                File "build\lib\${PACKAGE}\zencoding.dll"
 
478
                SetOutPath "$INSTDIR\share\${PACKAGE}\plugins\zencoding"
 
479
                File /r "build\share\${PACKAGE}\plugins\zencoding\*"
 
480
                SetOutPath "$INSTDIR\share\locale"
 
481
                File /r /x "${PACKAGE}.mo" /x "*_about.mo" /x "*_charmap.mo" /x "*_entities.mo" /x "*_htmlbar.mo" /x "*_infbrowser.mo" /x "*_snippets.mo" /x "*_vcs.mo" "build\share\locale\*"
 
482
        SectionEnd
417
483
        SetOverwrite off
418
484
SectionGroupEnd
419
485
 
634
700
                SectionSetSize ${SecGTK} ${GTK_SIZE}    ; 7.54MB Download
635
701
        ${EndIf}
636
702
 
 
703
        Call PythonVersionCheck
 
704
        ${If} $PYTHON_STATUS == ""
 
705
                SectionSetSize ${SecPython} ${PYTHON_SIZE}      ; 15.1MB Download
 
706
        ${Else} ; Mark as enabled and readonly if already installed
 
707
                !insertmacro SelectSection ${SecPython}
 
708
                Push $0
 
709
                        SectionGetFlags ${SecPython} $0
 
710
                        IntOp $0 $0 | ${SF_RO}
 
711
                        SectionSetFlags ${SecPython} $0
 
712
                Pop $0
 
713
        ${EndIf}
 
714
 
637
715
        SectionSetSize ${SecLangBg} 2501                ; 842KB Download
638
716
        SectionSetSize ${SecLangCs} 6640                ; 2.21MB Download
639
717
        SectionSetSize ${SecLangDa} 12394               ; 3.86MB Download
919
997
        Pop $R0
920
998
FunctionEnd
921
999
 
 
1000
Function .onSelChange
 
1001
        ${If} ${SectionIsSelected} ${SecPlZencoding}
 
1002
        ${AndIfNot} ${SectionIsSelected} ${SecPython}
 
1003
                !insertmacro SelectSection ${SecPython}
 
1004
        ${EndIf}
 
1005
FunctionEnd
 
1006
 
922
1007
 
923
1008
; Uninstaller Functions
924
1009
;----------------------------------------------