Contributions from Stephen George:
BUG: Fix un-install of desktop icon which is currently broken BUG: Intermittent failure of dependencies check in installer based on how long gcheck.py takes to run ENHANCEMENT: Add Gramps un-install info to Windows Add/Remove programs ENHANCEMENT: Option to remove existing installation of gramps prior to installing new version svn: r11283
This commit is contained in:
parent
305c20557c
commit
6b684b42c5
@ -1,8 +1,8 @@
|
|||||||
#
|
#
|
||||||
# Gramps - a GTK+ based genealogy program
|
# Gramps - a GTK+ based genealogy program
|
||||||
#
|
#
|
||||||
# Copyright (C) 2008 Steve Hall <digitect dancingpaper com>
|
# Copyright (C) 2006-2008 Steve Hall <digitect dancingpaper com>
|
||||||
# Copyright (C) 2008 Stephen George <steve_geo@optusnet.com.au>
|
# Copyright (C) 2008 Stephen George
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@ -31,13 +31,10 @@
|
|||||||
|
|
||||||
# ToDo {{{1
|
# ToDo {{{1
|
||||||
#
|
#
|
||||||
# o Option to remove existing installation prior to installing new
|
|
||||||
# o More refined dependency checking (versioning)
|
# o More refined dependency checking (versioning)
|
||||||
# o Add .gramps and .gpkg as extensions
|
# o Add .gramps and .gpkg as extensions
|
||||||
# * => Need separate icons for them?
|
# * => Need separate icons for them?
|
||||||
# o Add uninstall to Windows XP manifest list
|
|
||||||
#
|
#
|
||||||
|
|
||||||
# 1}}}
|
# 1}}}
|
||||||
# Installer Attributes
|
# Installer Attributes
|
||||||
# 0. Base Settings {{{1
|
# 0. Base Settings {{{1
|
||||||
@ -48,12 +45,22 @@
|
|||||||
!define GRAMPS_VER_POINT $%VERSIONPT%
|
!define GRAMPS_VER_POINT $%VERSIONPT%
|
||||||
!define GRAMPS_VER_BUILD $%VERSIONBUILD%
|
!define GRAMPS_VER_BUILD $%VERSIONBUILD%
|
||||||
|
|
||||||
|
; HM NIS Edit Wizard helper defines
|
||||||
|
!define PRODUCT_NAME "GRAMPS"
|
||||||
|
!define PRODUCT_VERSION ${GRAMPS_VER_MAJOR}.${GRAMPS_VER_MINOR}.${GRAMPS_VER_POINT}-${GRAMPS_VER_BUILD}
|
||||||
|
!define PRODUCT_PUBLISHER "The GRAMPS project"
|
||||||
|
!define PRODUCT_WEB_SITE "http://gramps-project.org"
|
||||||
|
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
|
||||||
|
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
|
||||||
|
|
||||||
|
!define DESKTOP_LINK "$DESKTOP\${PRODUCT_NAME} ${PRODUCT_VERSION}.lnk"
|
||||||
|
|
||||||
# adds Native Language Support
|
# adds Native Language Support
|
||||||
!define HAVE_NLS
|
!define HAVE_NLS
|
||||||
|
|
||||||
# output file
|
# output file
|
||||||
Name "GRAMPS"
|
Name ${PRODUCT_NAME}
|
||||||
OutFile gramps-${GRAMPS_VER_MAJOR}.${GRAMPS_VER_MINOR}.${GRAMPS_VER_POINT}-${GRAMPS_VER_BUILD}.exe
|
OutFile gramps-${PRODUCT_VERSION}.exe
|
||||||
|
|
||||||
# self ensure we don't have a corrupted file
|
# self ensure we don't have a corrupted file
|
||||||
CRCCheck on
|
CRCCheck on
|
||||||
@ -70,7 +77,7 @@ SetDatablockOptimize on
|
|||||||
|
|
||||||
SetOverwrite try
|
SetOverwrite try
|
||||||
|
|
||||||
# don't allow installation into C:\
|
# don't allow installation into C:\ directory
|
||||||
AllowRootDirInstall false
|
AllowRootDirInstall false
|
||||||
|
|
||||||
# install details color scheme
|
# install details color scheme
|
||||||
@ -85,11 +92,11 @@ XPStyle on
|
|||||||
InstallDir $PROGRAMFILES\gramps
|
InstallDir $PROGRAMFILES\gramps
|
||||||
|
|
||||||
# Remember install folder
|
# Remember install folder
|
||||||
InstallDirRegKey HKCU "Software\${MUI_PRODUCT}" ""
|
InstallDirRegKey HKCU "Software\${PRODUCT_NAME}" ""
|
||||||
|
|
||||||
# Remember the installer language
|
# Remember the installer language
|
||||||
!define MUI_LANGDLL_REGISTRY_ROOT "HKCU"
|
!define MUI_LANGDLL_REGISTRY_ROOT "HKCU"
|
||||||
!define MUI_LANGDLL_REGISTRY_KEY "Software\${MUI_PRODUCT}"
|
!define MUI_LANGDLL_REGISTRY_KEY "Software\${PRODUCT_NAME}"
|
||||||
!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
|
!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
|
||||||
|
|
||||||
# types of installs we can perform
|
# types of installs we can perform
|
||||||
@ -221,6 +228,8 @@ SectionIn 1 2 3 RO
|
|||||||
File ..\FAQ
|
File ..\FAQ
|
||||||
File ..\AUTHORS
|
File ..\AUTHORS
|
||||||
#File /r ..\nsis\gramps.ico
|
#File /r ..\nsis\gramps.ico
|
||||||
|
WriteRegStr HKLM "SOFTWARE\${PRODUCT_NAME}" "" "$INSTDIR"
|
||||||
|
WriteRegStr HKLM "SOFTWARE\${PRODUCT_NAME}" "version" ${PRODUCT_VERSION}
|
||||||
|
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
@ -240,7 +249,7 @@ SectionIn 1 3
|
|||||||
skipStartMenuRemove:
|
skipStartMenuRemove:
|
||||||
|
|
||||||
CreateDirectory "$SMPROGRAMS\$0\"
|
CreateDirectory "$SMPROGRAMS\$0\"
|
||||||
CreateShortCut "$SMPROGRAMS\$0\GRAMPS ${GRAMPS_VER_MAJOR}.${GRAMPS_VER_MINOR}.${GRAMPS_VER_POINT}-${GRAMPS_VER_BUILD}.lnk" "$3" "$\"$INSTDIR\gramps.py$\"" "$INSTDIR\images\ped24.ico" "0" "" "" "GRAMPS"
|
CreateShortCut "$SMPROGRAMS\$0\GRAMPS ${PRODUCT_VERSION}.lnk" "$3" "$\"$INSTDIR\gramps.py$\"" "$INSTDIR\images\ped24.ico" "0" "" "" "GRAMPS"
|
||||||
WriteINIStr "$SMPROGRAMS\$0\GRAMPS Website.url" "InternetShortcut" "URL" "http://www.gramps-project.org/"
|
WriteINIStr "$SMPROGRAMS\$0\GRAMPS Website.url" "InternetShortcut" "URL" "http://www.gramps-project.org/"
|
||||||
CreateShortCut "$SMPROGRAMS\$0\Uninstall GRAMPS.lnk" "$\"$INSTDIR\uninstall.exe$\"" "" "" "0" "" "" "Uninstall GRAMPS"
|
CreateShortCut "$SMPROGRAMS\$0\Uninstall GRAMPS.lnk" "$\"$INSTDIR\uninstall.exe$\"" "" "" "0" "" "" "Uninstall GRAMPS"
|
||||||
|
|
||||||
@ -250,7 +259,7 @@ Section "Add Desktop icon" Desktop
|
|||||||
#SectionIn 1 3
|
#SectionIn 1 3
|
||||||
# determines "Start In" location for shortcuts
|
# determines "Start In" location for shortcuts
|
||||||
SetOutPath $INSTDIR
|
SetOutPath $INSTDIR
|
||||||
CreateShortCut "$DESKTOP\GRAMPS ${GRAMPS_VER_MAJOR}.${GRAMPS_VER_MINOR}.${GRAMPS_VER_POINT}-${GRAMPS_VER_BUILD}.lnk" "$3" "$\"$INSTDIR\gramps.py$\"" "$INSTDIR\images\ped24.ico" "0" "" "" "GRAMPS"
|
CreateShortCut "${DESKTOP_LINK}" "$3" "$\"$INSTDIR\gramps.py$\"" "$INSTDIR\images\ped24.ico" "0" "" "" "GRAMPS"
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
SubSectionEnd
|
SubSectionEnd
|
||||||
@ -468,6 +477,9 @@ Section Uninstall
|
|||||||
RMDir /r $INSTDIR
|
RMDir /r $INSTDIR
|
||||||
Call un.StartMenu
|
Call un.StartMenu
|
||||||
Call un.Desktop
|
Call un.Desktop
|
||||||
|
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
|
||||||
|
|
||||||
|
DeleteRegKey HKLM "SOFTWARE\${PRODUCT_NAME}"
|
||||||
|
|
||||||
unEnd:
|
unEnd:
|
||||||
|
|
||||||
@ -570,26 +582,17 @@ Function .onInit
|
|||||||
MessageBox MB_OK "Python not found."
|
MessageBox MB_OK "Python not found."
|
||||||
StrCpy $4 "flag"
|
StrCpy $4 "flag"
|
||||||
HavePython:
|
HavePython:
|
||||||
#MessageBox MB_OK "DEBUG: Final path for pythonw.exe...$\n$\nFound: $\"$3$\""
|
|
||||||
|
|
||||||
; extract gcheck
|
; extract gcheck
|
||||||
SetOutPath $TEMP
|
SetOutPath $TEMP
|
||||||
#MessageBox MB_OK "DEBUG: $$TEMP location found:$\n$\n $TEMP"
|
|
||||||
File gcheck.py
|
File gcheck.py
|
||||||
; set INI output location ($1)
|
; set INI output location ($1)
|
||||||
StrCpy $1 "$TEMP\gramps-install.ini"
|
StrCpy $1 "$TEMP\gramps-install.ini"
|
||||||
#MessageBox MB_OK "DEBUG: Attempting to run:$\n$\n $\"$3$\" $TEMP\gcheck.py $1"
|
|
||||||
; run gcheck
|
|
||||||
Exec '"$3" $TEMP\gcheck.py $1'
|
|
||||||
#Exec '"$3" "$TEMP\gcheck.py" "$1"'
|
|
||||||
#Exec '$\"$3$\" $\"$TEMP\gcheck.py$\" $\"$1$\"'
|
|
||||||
|
|
||||||
#; Note The Exec above is a fork, meaning the following file test
|
; run gcheck
|
||||||
#; will fail because it happens faster than the Exec can run
|
ExecWait '"$3" $TEMP\gcheck.py $1'
|
||||||
#; to create it!
|
|
||||||
DetailPrint "Pausing for gcheck.py exectution..."
|
|
||||||
#; sleep
|
|
||||||
Sleep 1000
|
|
||||||
|
|
||||||
; verify INI created
|
; verify INI created
|
||||||
IfFileExists $1 YesINI 0
|
IfFileExists $1 YesINI 0
|
||||||
@ -667,6 +670,8 @@ Function .onInit
|
|||||||
|
|
||||||
DependantsOK:
|
DependantsOK:
|
||||||
|
|
||||||
|
Call RemovePrevious
|
||||||
|
|
||||||
# default install directory ($INSTDIR)
|
# default install directory ($INSTDIR)
|
||||||
StrCpy $INSTDIR $PROGRAMFILES\gramps
|
StrCpy $INSTDIR $PROGRAMFILES\gramps
|
||||||
|
|
||||||
@ -676,19 +681,46 @@ Function .onInstSuccess
|
|||||||
|
|
||||||
# write uninstaller
|
# write uninstaller
|
||||||
WriteUninstaller $INSTDIR\uninstall.exe
|
WriteUninstaller $INSTDIR\uninstall.exe
|
||||||
|
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
|
||||||
|
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninstall.exe"
|
||||||
|
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
|
||||||
|
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
|
||||||
|
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
|
||||||
|
#Does not display icon on win2000? WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\images\ped24.ico"
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
Function .onInstFailed
|
Function .onInstFailed
|
||||||
MessageBox MB_OK|MB_ICONEXCLAMATION "Installation failed."
|
MessageBox MB_OK|MB_ICONEXCLAMATION "Installation failed."
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
|
Function RemovePrevious
|
||||||
|
#check if gramps exists in registry
|
||||||
|
ClearErrors
|
||||||
|
Var /GLOBAL PreviousPath
|
||||||
|
ReadRegStr $PreviousPath HKLM "SOFTWARE\${PRODUCT_NAME}" ""
|
||||||
|
# do some tests to find an installed version
|
||||||
|
ifErrors NoPreviousVersion
|
||||||
|
IfFileExists $PreviousPath\uninstall.exe 0 NoPreviousVersion #Check uninstall.exe from previous version exists on HD
|
||||||
|
Var /GLOBAL PreviousVersion
|
||||||
|
ReadRegStr $PreviousVersion HKLM "SOFTWARE\${PRODUCT_NAME}" "Version"
|
||||||
|
# query OK to delete old version
|
||||||
|
MessageBox MB_OKCANCEL|MB_ICONQUESTION|MB_DEFBUTTON2 \
|
||||||
|
"${PRODUCT_NAME} $PreviousVersion is already installed$\n$\nClick 'OK' to uninstall previous version or 'Cancel' to continue anyway" \
|
||||||
|
IDCANCEL NoPreviousVersion
|
||||||
|
# uninstall old version
|
||||||
|
CopyFiles $PreviousPath\uninstall.exe $TEMP
|
||||||
|
ExecWait '"$TEMP\uninstall.exe" _?=$PreviousPath' $0
|
||||||
|
StrCpy $INSTDIR $PreviousPath #set the previous path as the default install path <= worth while or not?
|
||||||
|
;DetailPrint "uninstaller set error level $0"
|
||||||
|
NoPreviousVersion:
|
||||||
|
FunctionEnd
|
||||||
|
|
||||||
Function WarnDirExists
|
Function WarnDirExists
|
||||||
# warn if dir already exists
|
# warn if dir already exists
|
||||||
IfFileExists $INSTDIR\*.* DirExists DirExistsOK
|
IfFileExists $INSTDIR\*.* DirExists DirExistsOK
|
||||||
DirExists:
|
DirExists:
|
||||||
MessageBox MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2 \
|
MessageBox MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2 \
|
||||||
"Install over existing?" \
|
"Install over existing installation?" \
|
||||||
IDYES DirExistsOK
|
IDYES DirExistsOK
|
||||||
Quit
|
Quit
|
||||||
DirExistsOK:
|
DirExistsOK:
|
||||||
@ -711,8 +743,8 @@ FunctionEnd
|
|||||||
|
|
||||||
Function un.Desktop
|
Function un.Desktop
|
||||||
|
|
||||||
IfFileExists "$DESKTOP\GRAMPS.lnk" 0 unNoDesktop
|
IfFileExists "${DESKTOP_LINK}" 0 unNoDesktop
|
||||||
Delete "$DESKTOP\GRAMPS.lnk"
|
Delete "${DESKTOP_LINK}"
|
||||||
unNoDesktop:
|
unNoDesktop:
|
||||||
|
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
@ -728,7 +760,6 @@ FunctionEnd
|
|||||||
LangString DESC_MenuStart ${LANG_ENGLISH} "Add icons to the Start Menu."
|
LangString DESC_MenuStart ${LANG_ENGLISH} "Add icons to the Start Menu."
|
||||||
LangString DESC_LangFiles ${LANG_ENGLISH} "Set up non-English languages."
|
LangString DESC_LangFiles ${LANG_ENGLISH} "Set up non-English languages."
|
||||||
LangString DESC_FileAssoc ${LANG_ENGLISH} "Associate GRAMPS with .grdb, .gramps, .gpkg, and .ged files."
|
LangString DESC_FileAssoc ${LANG_ENGLISH} "Associate GRAMPS with .grdb, .gramps, .gpkg, and .ged files."
|
||||||
LangString DESC_Prog ${LANG_ENGLISH} "GRAMPS..."
|
|
||||||
|
|
||||||
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
|
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
|
||||||
|
|
||||||
@ -738,7 +769,6 @@ FunctionEnd
|
|||||||
!insertmacro MUI_DESCRIPTION_TEXT ${MenuStart} $(DESC_MenuStart)
|
!insertmacro MUI_DESCRIPTION_TEXT ${MenuStart} $(DESC_MenuStart)
|
||||||
!insertmacro MUI_DESCRIPTION_TEXT ${LangFiles} $(DESC_LangFiles)
|
!insertmacro MUI_DESCRIPTION_TEXT ${LangFiles} $(DESC_LangFiles)
|
||||||
!insertmacro MUI_DESCRIPTION_TEXT ${FileAssoc} $(DESC_FileAssoc)
|
!insertmacro MUI_DESCRIPTION_TEXT ${FileAssoc} $(DESC_FileAssoc)
|
||||||
!insertmacro MUI_DESCRIPTION_TEXT ${Prog} $(DESC_Prog)
|
|
||||||
|
|
||||||
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user