2
# Gramps - a GTK+ based genealogy program
4
# Copyright (C) 2006-2008 Steve Hall <digitect dancingpaper com>
5
# Copyright (C) 2008 Stephen George
7
# This program is free software; you can redistribute it and/or modify
8
# it under the terms of the GNU General Public License as published by
9
# the Free Software Foundation; either version 2 of the License, or
10
# (at your option) any later version.
12
# This program is distributed in the hope that it will be useful,
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU General Public License for more details.
17
# You should have received a copy of the GNU General Public License
18
# along with this program; if not, write to the Free Software
19
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23
# Description: Nullsoft Installer (NSIS) file to build Windows installer:
25
# Requires: NSIS version 2.0 or later.
27
# o WARNING: if you make changes to this script, look out for $INSTDIR
28
# to be valid, because this line is very dangerous: RMDir /r $INSTDIR
29
# o WARNING: Except the uninstaller. That re-paths for some reason.
34
# o More refined dependency checking (versioning)
35
# o Add .gramps and .gpkg as extensions
36
# * => Need separate icons for them?
39
# Installer Attributes
40
# 0. Base Settings {{{1
43
!define GRAMPS_VER_MAJOR $%VERSION%
44
!define GRAMPS_VER_MINOR $%VERSIONSUB%
45
!define GRAMPS_VER_POINT $%VERSIONPT%
46
!define GRAMPS_VER_BUILD $%VERSIONBUILD%
48
; HM NIS Edit Wizard helper defines
49
!define PRODUCT_NAME "GRAMPS"
50
!define PRODUCT_VERSION ${GRAMPS_VER_MAJOR}.${GRAMPS_VER_MINOR}.${GRAMPS_VER_POINT}-${GRAMPS_VER_BUILD}
51
!define PRODUCT_PUBLISHER "The GRAMPS project"
52
!define PRODUCT_WEB_SITE "http://gramps-project.org"
53
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
54
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
56
!define DESKTOP_LINK "$DESKTOP\${PRODUCT_NAME} ${PRODUCT_VERSION}.lnk"
58
# adds Native Language Support
63
OutFile gramps-${PRODUCT_VERSION}.exe
65
# self ensure we don't have a corrupted file
70
# zlib good, bzip2 better, lzma best (and slowest, whew.)
72
# reference existing store if possible
73
SetDatablockOptimize on
75
# comment next line if you don't have UPX (http://upx.sourceforge.net)
76
!packhdr temp.dat "upx --best --compress-icons=0 temp.dat"
80
# don't allow installation into C:\ directory
81
AllowRootDirInstall false
83
# install details color scheme
84
InstallColors /windows
91
# default install path
92
InstallDir $PROGRAMFILES\gramps
94
# Remember install folder
95
InstallDirRegKey HKCU "Software\${PRODUCT_NAME}" ""
97
# Remember the installer language
98
!define MUI_LANGDLL_REGISTRY_ROOT "HKCU"
99
!define MUI_LANGDLL_REGISTRY_KEY "Software\${PRODUCT_NAME}"
100
!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
102
# types of installs we can perform
109
# 1. Header file (Begin Modern User Interface) {{{1
112
# 2. Interface Configuration {{{1
114
# installer/uninstaller icons (these must match in size!)
115
#!define MUI_ICON "classic-install.ico"
116
#!define MUI_UNICON "classic-uninstall.ico"
118
# splash, header graphics (same for both!)
119
!define MUI_HEADERIMAGE
120
#!define MUI_HEADERIMAGE_BITMAP "win.bmp"
121
#!define MUI_WELCOMEFINISHPAGE_BITMAP "nsis-splash.bmp"
123
!define MUI_LICENSEPAGE_BUTTON $(^AgreeBtn)
124
!define MUI_LICENSEPAGE_RADIOBUTTONS
125
!define MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_ACCEPT $(^AcceptBtn)
126
!define MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_DECLINE $(^DontAcceptBtn)
128
#!define MUI_COMPONENTSPAGE_CHECKBITMAP "nsis-checkboxes.bmp"
129
# use small description box below components (not adjacent)
130
!define MUI_COMPONENTSPAGE_SMALLDESC
132
!define MUI_DIRECTORYPAGE_TEXT_TOP $(^DirText)
133
!define MUI_DIRECTORYPAGE_TEXT_DESTINATION $(^DirBrowseText)
134
!define MUI_DIRECTORYPAGE_VERIFYONLEAVE
136
!define MUI_FINISHPAGE_RUN "$3"
137
!define MUI_FINISHPAGE_RUN_PARAMETERS "$\"$INSTDIR\gramps.py$\""
139
!define MUI_ABORTWARNING
143
!insertmacro MUI_PAGE_WELCOME
145
!insertmacro MUI_PAGE_LICENSE "..\COPYING"
147
!insertmacro MUI_PAGE_COMPONENTS
148
!insertmacro MUI_PAGE_DIRECTORY
149
!insertmacro MUI_PAGE_INSTFILES
150
!insertmacro MUI_PAGE_FINISH
155
!insertmacro MUI_UNPAGE_CONFIRM
156
!insertmacro MUI_UNPAGE_INSTFILES
158
# 4. Custom functions {{{1
160
# 5. Language files {{{1
162
# TODO: These are pretty badly broken at the moment.
163
# Note: This appears to be due to building on Win95 which does not
165
# (http://nsis.sf.net/archive/nsisweb.php?page=247&instances=0,235)
167
# So what happens if we use only ASCII?
169
#!insertmacro MUI_LANGUAGE "Arabic"
170
#!insertmacro MUI_LANGUAGE "Bulgarian"
171
#!insertmacro MUI_LANGUAGE "Catalan"
172
#!insertmacro MUI_LANGUAGE "Croatian"
173
#!insertmacro MUI_LANGUAGE "Czech"
174
#!insertmacro MUI_LANGUAGE "Default"
175
#!insertmacro MUI_LANGUAGE "Estonian"
176
#!insertmacro MUI_LANGUAGE "Farsi"
177
#!insertmacro MUI_LANGUAGE "Finnish"
178
#!insertmacro MUI_LANGUAGE "Greek"
179
#!insertmacro MUI_LANGUAGE "Hebrew"
180
#!insertmacro MUI_LANGUAGE "Hungarian"
181
#!insertmacro MUI_LANGUAGE "Indonesian"
182
#!insertmacro MUI_LANGUAGE "Japanese"
183
#!insertmacro MUI_LANGUAGE "Korean"
184
#!insertmacro MUI_LANGUAGE "Latvian"
185
#!insertmacro MUI_LANGUAGE "Lithuanian"
186
#!insertmacro MUI_LANGUAGE "Macedonian"
187
#!insertmacro MUI_LANGUAGE "Norwegian"
188
#!insertmacro MUI_LANGUAGE "Polish"
189
#!insertmacro MUI_LANGUAGE "Romanian"
190
#!insertmacro MUI_LANGUAGE "Russian"
191
#!insertmacro MUI_LANGUAGE "Serbian"
192
#!insertmacro MUI_LANGUAGE "SerbianLatin"
193
#!insertmacro MUI_LANGUAGE "SimpChinese"
194
#!insertmacro MUI_LANGUAGE "Slovak"
195
#!insertmacro MUI_LANGUAGE "Slovenian"
196
#!insertmacro MUI_LANGUAGE "Swedish"
197
#!insertmacro MUI_LANGUAGE "Thai"
198
#!insertmacro MUI_LANGUAGE "TradChinese"
199
#!insertmacro MUI_LANGUAGE "Turkish"
200
#!insertmacro MUI_LANGUAGE "Ukrainian"
202
!insertmacro MUI_LANGUAGE "Danish"
203
!insertmacro MUI_LANGUAGE "Dutch"
204
!insertmacro MUI_LANGUAGE "English"
205
!insertmacro MUI_LANGUAGE "French"
206
!insertmacro MUI_LANGUAGE "German"
207
!insertmacro MUI_LANGUAGE "Italian"
208
!insertmacro MUI_LANGUAGE "Portuguese"
209
!insertmacro MUI_LANGUAGE "PortugueseBR"
210
!insertmacro MUI_LANGUAGE "Spanish"
212
# 6. Reserve Files {{{1
217
######################################################################
219
Section "Program files (required)" Main
230
#File /r ..\nsis\gramps.ico
231
WriteRegStr HKLM "SOFTWARE\${PRODUCT_NAME}" "" "$INSTDIR"
232
WriteRegStr HKLM "SOFTWARE\${PRODUCT_NAME}" "version" ${PRODUCT_VERSION}
236
# Menus and shortcuts {{{1
238
SubSection "Menus and shortcuts" MenusAndIcons
240
Section "Add GRAMPS to the Start Menu" MenuStart
242
# determines "Start In" location for shortcuts
247
IfFileExists "$SMPROGRAMS\$0" 0 skipStartMenuRemove
248
RMDir /r "$SMPROGRAMS\$0\"
251
CreateDirectory "$SMPROGRAMS\$0\"
252
CreateShortCut "$SMPROGRAMS\$0\GRAMPS ${PRODUCT_VERSION}.lnk" "$3" "$\"$INSTDIR\gramps.py$\"" "$INSTDIR\images\ped24.ico" "0" "" "" "GRAMPS"
253
WriteINIStr "$SMPROGRAMS\$0\GRAMPS Website.url" "InternetShortcut" "URL" "http://www.gramps-project.org/"
254
CreateShortCut "$SMPROGRAMS\$0\Uninstall GRAMPS.lnk" "$\"$INSTDIR\uninstall.exe$\"" "" "" "0" "" "" "Uninstall GRAMPS"
258
Section "Add Desktop icon" Desktop
260
# determines "Start In" location for shortcuts
262
CreateShortCut "${DESKTOP_LINK}" "$3" "$\"$INSTDIR\gramps.py$\"" "$INSTDIR\images\ped24.ico" "0" "" "" "GRAMPS"
267
# Language Files {{{1
269
Section "Language Files" LangFiles
273
#CreateDirectory $INSTDIR\lang
277
#MessageBox MB_OK "Setting up languages..."
281
; -t :: setup the language files
284
; pythonw grampsSetup.py -c -t
285
#Exec '"$3" $\"$INSTDIR\grampsSetup.py -c -t -r$\"'
289
# File Association {{{1
291
# FileAssoc.nsh macro {{{2
293
; FileAssoc.nsh (http://nsis.sourceforge.net/FileAssoc)
294
; File association helper macros
297
; Features automatic backup system and UPDATEFILEASSOC macro for
298
; shell change notification.
301
; To associate a file with an application so you can double-click it in explorer, use
302
; the APP_ASSOCIATE macro like this:
305
; !insertmacro APP_ASSOCIATE \
308
; "myapp tiny description" \
309
; "$INSTDIR\myapp.exe,0" \
310
; "Open with myapp" \
311
; "$INSTDIR\myapp.exe $\"%1$\""
313
; Never insert the APP_ASSOCIATE macro multiple times, it is only ment
314
; to associate an application with a single file and using the
315
; the "open" verb as default. To add more verbs (actions) to a file
316
; use the APP_ASSOCIATE_ADDVERB macro.
319
; !insertmacro APP_ASSOCIATE_ADDVERB "myapp.textfile" "edit" "Edit with myapp" \
320
; "$INSTDIR\myapp.exe /edit $\"%1$\""
322
; To have access to more options when registering the file association use the
323
; APP_ASSOCIATE_EX macro. Here you can specify the verb and what verb is to be the
324
; standard action (default verb).
326
; And finally: To remove the association from the registry use the APP_UNASSOCIATE
327
; macro. Here is another example just to wrap it up:
328
; !insertmacro APP_UNASSOCIATE "txt" "myapp.textfile"
331
; When defining your file class string always use the short form of your application title
332
; then a period (dot) and the type of file. This keeps the file class sort of unique.
339
; The registry key layout for a file association is:
341
; <applicationID> = <"description">
343
; <verb> = <"menu-item text">
344
; command = <"command string">
347
!macro APP_ASSOCIATE EXT FILECLASS DESCRIPTION ICON COMMANDTEXT COMMAND
348
; Backup the previously associated file class
349
ReadRegStr $R0 HKCR ".${EXT}" ""
350
WriteRegStr HKCR ".${EXT}" "${FILECLASS}_backup" "$R0"
352
WriteRegStr HKCR ".${EXT}" "" "${FILECLASS}"
353
WriteRegStr HKCR "${FILECLASS}" "" `${DESCRIPTION}`
354
WriteRegStr HKCR "${FILECLASS}\DefaultIcon" "" `${ICON}`
355
WriteRegStr HKCR "${FILECLASS}\shell" "" "open"
356
WriteRegStr HKCR "${FILECLASS}\shell\open" "" `${COMMANDTEXT}`
357
WriteRegStr HKCR "${FILECLASS}\shell\open\command" "" `${COMMAND}`
360
!macro APP_ASSOCIATE_EX EXT FILECLASS DESCRIPTION ICON VERB DEFAULTVERB SHELLNEW COMMANDTEXT COMMAND
361
; Backup the previously associated file class
362
ReadRegStr $R0 HKCR ".${EXT}" ""
363
WriteRegStr HKCR ".${EXT}" "${FILECLASS}_backup" "$R0"
365
WriteRegStr HKCR ".${EXT}" "" "${FILECLASS}"
366
StrCmp "${SHELLNEW}" "0" +2
367
WriteRegStr HKCR ".${EXT}\ShellNew" "NullFile" ""
369
WriteRegStr HKCR "${FILECLASS}" "" `${DESCRIPTION}`
370
WriteRegStr HKCR "${FILECLASS}\DefaultIcon" "" `${ICON}`
371
WriteRegStr HKCR "${FILECLASS}\shell" "" `${DEFAULTVERB}`
372
WriteRegStr HKCR "${FILECLASS}\shell\${VERB}" "" `${COMMANDTEXT}`
373
WriteRegStr HKCR "${FILECLASS}\shell\${VERB}\command" "" `${COMMAND}`
376
!macro APP_ASSOCIATE_ADDVERB FILECLASS VERB COMMANDTEXT COMMAND
377
WriteRegStr HKCR "${FILECLASS}\shell\${VERB}" "" `${COMMANDTEXT}`
378
WriteRegStr HKCR "${FILECLASS}\shell\${VERB}\command" "" `${COMMAND}`
381
!macro APP_ASSOCIATE_REMOVEVERB FILECLASS VERB
382
DeleteRegKey HKCR `${FILECLASS}\shell\${VERB}`
386
!macro APP_UNASSOCIATE EXT FILECLASS
387
; Backup the previously associated file class
388
ReadRegStr $R0 HKCR ".${EXT}" `${FILECLASS}_backup`
389
WriteRegStr HKCR ".${EXT}" "" "$R0"
391
DeleteRegKey HKCR `${FILECLASS}`
394
!macro APP_ASSOCIATE_GETFILECLASS OUTPUT EXT
395
ReadRegStr ${OUTPUT} HKCR ".${EXT}" ""
399
; !defines for use with SHChangeNotify
400
!ifdef SHCNE_ASSOCCHANGED
401
!undef SHCNE_ASSOCCHANGED
403
!define SHCNE_ASSOCCHANGED 0x08000000
407
!define SHCNF_FLUSH 0x1000
409
!macro UPDATEFILEASSOC
410
; Using the system.dll plugin to call the SHChangeNotify Win32 API function so we
411
; can update the shell.
412
System::Call "shell32::SHChangeNotify(i,i,i,i) (${SHCNE_ASSOCCHANGED}, ${SHCNF_FLUSH}, 0, 0)"
419
Section "File Association" FileAssoc
421
# depends on FileAssoc.nsh, by Saivert (http://nsis.sourceforge.net/FileAssoc)
424
!insertmacro APP_ASSOCIATE \
426
"application/x-gramps-database" \
427
"GRAMPS database file" \
428
"$INSTDIR\images\ped24.ico" \
430
"$\"$3$\" $\"$INSTDIR\gramps.py$\" $\"%1$\""
433
!insertmacro APP_ASSOCIATE \
435
"application/x-gramps-file" \
436
"GRAMPS application file" \
437
"$INSTDIR\images\ped24.ico" \
439
"$\"$3$\" $\"$INSTDIR\gramps.py$\" $\"%1$\""
442
!insertmacro APP_ASSOCIATE \
444
"application/x-gramps-package" \
445
"GRAMPS package file" \
446
"$INSTDIR\images\ped24.ico" \
448
"$\"$3$\" $\"$INSTDIR\gramps.py$\" $\"%1$\""
451
!insertmacro APP_ASSOCIATE \
453
"application/x-gramps-gedcom" \
454
"GEnealogical Data COMmunication (GEDCOM) file" \
455
"$INSTDIR\images\ped24.ico" \
457
"$\"$3$\" $\"$INSTDIR\gramps.py$\" $\"%1$\""
462
######################################################################
467
MessageBox MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2 \
468
"Completely remove installation? $\n\
469
(Delete folder $INSTDIR ) " \
470
IDNO unQuit IDYES unContinue
480
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
482
DeleteRegKey HKLM "SOFTWARE\${PRODUCT_NAME}"
491
#####################################################################
495
#MessageBox MB_OK "Testing dependencies..."
497
; look for pythonw.exe
498
; NOTE: This is set to $3 if it exists.
501
SearchPath $3 pythonw.exe
502
#MessageBox MB_OK "DEBUG: Testing pythonw.exe on path...$\n$\nFound: $\"$3$\""
503
IfFileExists $3 HavePython 0
505
; registry keys (these are confirmed possibilities)
507
ReadRegStr $3 HKLM 'SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\python.exe' ""
508
StrCpy $3 "$3pythonw.exe" ; append "pythonw.exe"
509
IfFileExists $3 HavePython 0
510
; reg key (updated on 2.5 upgrade)
511
ReadRegStr $3 HKCR 'Python.File\shell\open\command' ""
512
StrCpy $3 "$3pythonw.exe" ; append "pythonw.exe"
513
IfFileExists $3 HavePython 0
514
; reg key (updated on 2.5 upgrade)
515
ReadRegStr $3 HKCU 'Software\Classes\Python.File\shell\open\command' ""
516
StrCpy $3 "$3pythonw.exe" ; append "pythonw.exe"
517
IfFileExists $3 HavePython 0
519
ReadRegStr $3 HKCU 'Software\Microsoft\Windows\Current version\App Paths\Python.exe' ""
520
StrCpy $3 "$3pythonw.exe" ; append "pythonw.exe"
521
IfFileExists $3 HavePython 0
523
ReadRegStr $3 HKCU 'Software\Microsoft\Windows\ShellNoRoam\MUICache (data:python)' ""
524
StrCpy $3 "$3pythonw.exe" ; append "pythonw.exe"
525
IfFileExists $3 HavePython 0
526
; reg key (Python version 2.5)
527
ReadRegStr $3 HKCU 'Software\Python\PythonCore\2.5\InstallPath' ""
528
StrCpy $3 "$3pythonw.exe" ; append "pythonw.exe"
529
IfFileExists $3 HavePython 0
530
; reg key (Python version 2.4)
531
ReadRegStr $3 HKCU 'Software\Python\PythonCore\2.4\InstallPath' ""
532
StrCpy $3 "$3pythonw.exe" ; append "pythonw.exe"
533
IfFileExists $3 HavePython 0
534
# these hold compound paths
535
#; reg key (Python version 2.5)
536
#ReadRegStr $3 HKCU 'Software\Python\PythonCore\2.5\PythonPath' ""
537
#StrCpy $3 "$3pythonw.exe" ; append "pythonw.exe"
538
#IfFileExists $3 HavePython 0
539
#; reg key (Python version 2.4)
540
#ReadRegStr $3 HKCU 'Software\Python\PythonCore\2.4\PythonPath' ""
541
#StrCpy $3 "$3pythonw.exe" ; append "pythonw.exe"
542
#IfFileExists $3 HavePython 0
544
; Keys not prone to be properly updated on upgrades
546
ReadRegStr $3 HKCR 'Applications\python.exe\shell\open\command' ""
547
StrCpy $3 "$3pythonw.exe" ; append "pythonw.exe"
548
IfFileExists $3 HavePython 0
549
; reg key (not updated on 2.5 upgrade)
550
ReadRegStr $3 HKLM 'SOFTWARE\Python\PythonCore\2.5\PythonPath' ""
551
StrCpy $3 "$3pythonw.exe" ; append "pythonw.exe"
552
IfFileExists $3 HavePython 0
554
ReadRegStr $3 HKLM 'SOFTWARE\Python\PythonCore\2.4\PythonPath' ""
555
StrCpy $3 "$3pythonw.exe" ; append "pythonw.exe"
556
IfFileExists $3 HavePython 0
558
ReadRegStr $3 HKLM 'SOFTWARE\Python\PythonCore\2.5' ""
559
StrCpy $3 "$3pythonw.exe" ; append "pythonw.exe"
560
IfFileExists $3 HavePython 0
562
ReadRegStr $3 HKLM 'SOFTWARE\Python\PythonCore\2.4' ""
563
StrCpy $3 "$3pythonw.exe" ; append "pythonw.exe"
564
IfFileExists $3 HavePython 0
566
ReadRegStr $3 HKLM 'SOFTWARE\Python\PythonCore\2.5\InstallPath' ""
567
StrCpy $3 "$3pythonw.exe" ; append "pythonw.exe"
568
IfFileExists $3 HavePython 0
570
ReadRegStr $3 HKLM 'SOFTWARE\Python\PythonCore\2.4\InstallPath' ""
571
StrCpy $3 "$3pythonw.exe" ; append "pythonw.exe"
572
IfFileExists $3 HavePython 0
575
; TODO: request path from user/browse (can NSIS do this?)
576
#MessageBox MB_OK "GRAMPS requires Python to be installed, please see:$\n \
578
# http://gramps-project.org/windows/ $\n \
580
# for installation help. Unable to continue installation."
582
MessageBox MB_OK "Python not found."
591
; set INI output location ($1)
592
StrCpy $1 "$TEMP\gramps-install.ini"
595
ExecWait '"$3" $TEMP\gcheck.py $1'
598
IfFileExists $1 YesINI 0
599
#MessageBox MB_OK "Dependency test INI creation failed, unable to continue."
601
MessageBox MB_OK "Dependency test INI creation failed."
605
; verify environment test results
607
ReadINIStr $0 $1 tests gtk
608
StrCmp $0 "yes" HaveGTK 0
610
; TODO: if no, perhaps just have GTK+ installed, check registry
612
ReadRegStr $3 HKCU 'Environment\GTK_BASEPATH' ""
613
IfFileExists $3\*.* NoHavePyGTK 0
615
ReadRegStr $3 HKCU 'Software\GTK\2.0\Path' ""
616
IfFileExists $3\*.* NoHavePyGTK 0
618
ReadRegStr $3 HKLM 'Software\GTK\2.0\Path' ""
619
IfFileExists $3\*.* NoHavePyGTK 0
621
ReadRegStr $3 HKLM 'Software\GTK\2.0\DllPath' ""
622
IfFileExists $3\*.* NoHavePyGTK 0
624
; if we make it this far, we don't have GTK+
625
#MessageBox MB_OK "GRAMPS requires GTK+ and PyGTK to be installed, please see:$\n \
627
# http://gramps-project.org/windows/ $\n \
629
# for installation help. Unable to continue installation."
631
MessageBox MB_OK "GTK+ and PyGTK not found."
635
#MessageBox MB_OK "PyGTK import failed (GTK+ found on system), please see:$\n \
637
# http://gramps-project.org/windows/ $\n \
639
# for installation help. Unable to continue installation."
641
MessageBox MB_OK "PyGTK not found."
646
# NOTE: we can not detect just pygtk via gcheck.py
649
ReadINIStr $0 $1 tests glade
650
StrCmp $0 "yes" Haveglade 0
651
#MessageBox MB_OK "glade not installed, unable to continue."
653
MessageBox MB_OK "Glade not found."
657
ReadINIStr $0 $1 tests pycairo
658
StrCmp $0 "yes" Havepycairo 0
659
#MessageBox MB_OK "pycairo not installed, unable to continue."
661
MessageBox MB_OK "pycairo not found."
665
#!insertmacro MUI_LANGDLL_DISPLAY
667
StrCmp $4 "flag" +1 DependantsOK
668
MessageBox MB_OK "At least one dependency was not found, unable to continue."
675
# default install directory ($INSTDIR)
676
StrCpy $INSTDIR $PROGRAMFILES\gramps
680
Function .onInstSuccess
683
WriteUninstaller $INSTDIR\uninstall.exe
684
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
685
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninstall.exe"
686
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
687
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
688
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
689
#Does not display icon on win2000? WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\images\ped24.ico"
692
Function .onInstFailed
693
MessageBox MB_OK|MB_ICONEXCLAMATION "Installation failed."
696
Function RemovePrevious
697
#check if gramps exists in registry
699
Var /GLOBAL PreviousPath
700
ReadRegStr $PreviousPath HKLM "SOFTWARE\${PRODUCT_NAME}" ""
701
# do some tests to find an installed version
702
ifErrors NoPreviousVersion
703
IfFileExists $PreviousPath\uninstall.exe 0 NoPreviousVersion #Check uninstall.exe from previous version exists on HD
704
Var /GLOBAL PreviousVersion
705
ReadRegStr $PreviousVersion HKLM "SOFTWARE\${PRODUCT_NAME}" "Version"
706
# query OK to delete old version
707
MessageBox MB_OKCANCEL|MB_ICONQUESTION|MB_DEFBUTTON2 \
708
"${PRODUCT_NAME} $PreviousVersion is already installed$\n$\nClick 'OK' to uninstall previous version or 'Cancel' to continue anyway" \
709
IDCANCEL NoPreviousVersion
710
# uninstall old version
711
CopyFiles $PreviousPath\uninstall.exe $TEMP
712
ExecWait '"$TEMP\uninstall.exe" _?=$PreviousPath' $0
713
StrCpy $INSTDIR $PreviousPath #set the previous path as the default install path <= worth while or not?
714
;DetailPrint "uninstaller set error level $0"
718
Function WarnDirExists
719
# warn if dir already exists
720
IfFileExists $INSTDIR\*.* DirExists DirExistsOK
722
MessageBox MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2 \
723
"Install over existing installation?" \
730
#####################################################################
732
Function un.onUnInstSuccess
736
Function un.StartMenu
738
IfFileExists "$SMPROGRAMS\GRAMPS" 0 unStartMenuFine
739
RMDir /r "$SMPROGRAMS\GRAMPS\"
746
IfFileExists "${DESKTOP_LINK}" 0 unNoDesktop
747
Delete "${DESKTOP_LINK}"
753
# 8. Section Descriptions {{{1
754
######################################################################
757
LangString DESC_Main ${LANG_ENGLISH} "Main program files (required)."
758
LangString DESC_MenusAndIcons ${LANG_ENGLISH} "General Desktop and Start Menu shortcut options."
759
LangString DESC_Desktop ${LANG_ENGLISH} "Add icon to the Desktop."
760
LangString DESC_MenuStart ${LANG_ENGLISH} "Add icons to the Start Menu."
761
LangString DESC_LangFiles ${LANG_ENGLISH} "Set up non-English languages."
762
LangString DESC_FileAssoc ${LANG_ENGLISH} "Associate GRAMPS with .grdb, .gramps, .gpkg, and .ged files."
764
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
766
!insertmacro MUI_DESCRIPTION_TEXT ${Main} $(DESC_Main)
767
!insertmacro MUI_DESCRIPTION_TEXT ${MenusAndIcons} $(DESC_MenusAndIcons)
768
!insertmacro MUI_DESCRIPTION_TEXT ${Desktop} $(DESC_Desktop)
769
!insertmacro MUI_DESCRIPTION_TEXT ${MenuStart} $(DESC_MenuStart)
770
!insertmacro MUI_DESCRIPTION_TEXT ${LangFiles} $(DESC_LangFiles)
771
!insertmacro MUI_DESCRIPTION_TEXT ${FileAssoc} $(DESC_FileAssoc)
773
!insertmacro MUI_FUNCTION_DESCRIPTION_END
776
# vim:foldmethod=marker:noexpandtab