grim/guifications1

added NSIS installer

2004-01-11, Daniel Atallah
dad10b3979ff
Parents 9cd2fe25c3aa
Children 5f25163c50ad
added NSIS installer
--- a/Makefile.mingw Sun Jan 11 03:20:04 2004 +0000
+++ b/Makefile.mingw Sun Jan 11 03:38:26 2004 +0000
@@ -16,6 +16,7 @@
##
GF_VERSION := $(shell cat ./VERSION)
+GAIM_VERSION := $(shell cat ../../VERSION)
all:
cp gf_config.h.mingw gf_config.h
@@ -25,6 +26,9 @@
$(MAKE) -C $(GF_PIXMAPS) -f Makefile.mingw install
$(MAKE) -C $(GF_SRC) -f Makefile.mingw install
+installer: all
+ makensis.exe /DGUIFICATIONS_VERSION="$(GF_VERSION)" /DGAIM_VERSION="$(GAIM_VERSION)" guifications-installer.nsi
+
clean:
$(MAKE) -C $(GF_SRC) -f Makefile.mingw clean
rm -rf gf_config.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/guifications-installer.nsi Sun Jan 11 03:38:26 2004 +0000
@@ -0,0 +1,348 @@
+; NSIS Script For Guifications Plugin
+; Author Daniel A. Atallah
+; Based on the Gaim installer by Herman Bloggs and the Gaim-Encryption installer by Bill Tompkins
+; Uses NSIS v2.0b4
+
+
+Name "Guifications ${GUIFICATIONS_VERSION}"
+
+; Registry keys:
+!define GUIFICATIONS_REG_KEY "SOFTWARE\gaim-guifications"
+!define GUIFICATIONS_UNINSTALL_KEY "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\gaim-guifications"
+!define GUIFICATIONS_UNINST_EXE "guifications-uninst.exe"
+!define GUIFICATIONS_DLL "guifications.dll"
+!define GUIFICATIONS_UNINSTALL_LNK "Guifications Uninstall.lnk"
+
+
+!include "MUI.nsh"
+
+;Do A CRC Check
+CRCCheck On
+
+;Output File Name
+OutFile "guifications-${GUIFICATIONS_VERSION}.exe"
+
+ShowInstDetails show
+ShowUnInstDetails show
+SetCompressor bzip2
+
+; Translations
+!include "nsis\translations\english.nsh"
+
+
+; Modern UI Configuration
+
+!define MUI_ICON .\nsis\install.ico
+!define MUI_UNICON .\nsis\install.ico
+!define MUI_HEADERIMAGE
+!define MUI_HEADERIMAGE_BITMAP "nsis\header.bmp"
+
+
+; Pages
+!define MUI_WELCOMEPAGE_TITLE $(WELCOME_TITLE)
+!define MUI_WELCOMEPAGE_TEXT $(WELCOME_TEXT)
+!insertmacro MUI_PAGE_WELCOME
+
+!insertmacro MUI_PAGE_LICENSE ".\COPYING"
+
+!define MUI_DIRECTORYPAGE_TEXT_TOP $(DIR_SUBTITLE)
+!define MUI_DIRECTORYPAGE_TEXT_DESTINATION $(DIR_INNERTEXT)
+!insertmacro MUI_PAGE_DIRECTORY
+
+!insertmacro MUI_PAGE_INSTFILES
+
+!define MUI_FINISHPAGE_TITLE $(FINISH_TITLE)
+!define MUI_FINISHPAGE_TEXT $(FINISH_TEXT)
+!insertmacro MUI_PAGE_FINISH
+
+; MUI Config
+
+!define MUI_CUSTOMFUNCTION_INSTFILESPRE checkGaimVersion
+!define MUI_ABORTWARNING
+!define MUI_UNINSTALLER
+!define MUI_PROGRESSBAR smooth
+!define MUI_INSTALLCOLORS /windows
+
+!insertmacro MUI_LANGUAGE "English"
+
+!define MUI_LICENSEPAGE_RADIOBUTTONS
+
+
+;The Default Installation Directory
+InstallDir "$PROGRAMFILES\gaim"
+InstallDirRegKey HKLM SOFTWARE\gaim ""
+
+Section -SecUninstallOldPlugin
+ ; Check install rights..
+ Call CheckUserInstallRights
+ Pop $R0
+
+ StrCmp $R0 "HKLM" rights_hklm
+ StrCmp $R0 "HKCU" rights_hkcu done
+
+ rights_hkcu:
+ ReadRegStr $R1 HKCU "${GUIFICATIONS_REG_KEY}" ""
+ ReadRegStr $R2 HKCU "${GUIFICATIONS_REG_KEY}" "Version"
+ ReadRegStr $R3 HKCU "${GUIFICATIONS_UNINSTALL_KEY}" "UninstallString"
+ Goto try_uninstall
+
+ rights_hklm:
+ ReadRegStr $R1 HKLM "${GUIFICATIONS_REG_KEY}" ""
+ ReadRegStr $R2 HKLM "${GUIFICATIONS_REG_KEY}" "Version"
+ ReadRegStr $R3 HKLM "${GUIFICATIONS_UNINSTALL_KEY}" "UninstallString"
+
+ ; If previous version exists .. remove
+ try_uninstall:
+ StrCmp $R1 "" done
+ StrCmp $R2 "" uninstall_problem
+ IfFileExists $R3 0 uninstall_problem
+ ; Have uninstall string.. go ahead and uninstall.
+ SetOverwrite on
+ ; Need to copy uninstaller outside of the install dir
+ ClearErrors
+ CopyFiles /SILENT $R3 "$TEMP\${GUIFICATIONS_UNINST_EXE}"
+ SetOverwrite off
+ IfErrors uninstall_problem
+ ; Ready to uninstall..
+ ClearErrors
+ ExecWait '"$TEMP\${GUIFICATIONS_UNINST_EXE}" /S _?=$R1'
+ IfErrors exec_error
+ Delete "$TEMP\${GUIFICATIONS_UNINST_EXE}"
+ Goto done
+
+ exec_error:
+ Delete "$TEMP\${GUIFICATIONS_UNINST_EXE}"
+ Goto uninstall_problem
+
+ uninstall_problem:
+ ; Just delete the plugin and uninstaller, and remove Registry key
+ MessageBox MB_YESNO $(GUIFICATIONS_PROMPT_WIPEOUT) IDYES do_wipeout IDNO cancel_install
+ cancel_install:
+ Quit
+
+ do_wipeout:
+ StrCmp $R0 "HKLM" del_lm_reg del_cu_reg
+ del_cu_reg:
+ DeleteRegKey HKCU ${GUIFICATIONS_REG_KEY}
+ Goto uninstall_prob_cont
+ del_lm_reg:
+ DeleteRegKey HKLM ${GUIFICATIONS_REG_KEY}
+
+ uninstall_prob_cont:
+ ; plugin DLL
+ Delete "$R1\plugins\${GUIFICATIONS_DLL}"
+ ; pixmaps
+ RMDir /r "$R1\pixmaps\gaim\guifications"
+ Delete "$R3"
+
+ done:
+
+SectionEnd
+
+
+Section "Install"
+ Call checkGaimVersion
+
+ Call CheckUserInstallRights
+ Pop $R0
+
+ StrCmp $R0 "NONE" instrights_none
+ StrCmp $R0 "HKLM" instrights_hklm instrights_hkcu
+
+ instrights_hklm:
+ ; Write the version registry keys:
+ WriteRegStr HKLM ${GUIFICATIONS_REG_KEY} "" "$INSTDIR"
+ WriteRegStr HKLM ${GUIFICATIONS_REG_KEY} "Version" "${GUIFICATIONS_VERSION}"
+
+ ; Write the uninstall keys for Windows
+ WriteRegStr HKLM ${GUIFICATIONS_UNINSTALL_KEY} "DisplayName" "$(GUIFICATIONS_UNINSTALL_DESC)"
+ WriteRegStr HKLM ${GUIFICATIONS_UNINSTALL_KEY} "UninstallString" "$INSTDIR\${GUIFICATIONS_UNINST_EXE}"
+ SetShellVarContext "all"
+ Goto install_files
+
+ instrights_hkcu:
+ ; Write the version registry keys:
+ WriteRegStr HKCU ${GUIFICATIONS_REG_KEY} "" "$INSTDIR"
+ WriteRegStr HKCU ${GUIFICATIONS_REG_KEY} "Version" "${GUIFICATIONS_VERSION}"
+
+ ; Write the uninstall keys for Windows
+ WriteRegStr HKCU ${GUIFICATIONS_UNINSTALL_KEY} "DisplayName" "$(GUIFICATIONS_UNINSTALL_DESC)"
+ WriteRegStr HKCU ${GUIFICATIONS_UNINSTALL_KEY} "UninstallString" "$INSTDIR\${GUIFICATIONS_UNINST_EXE}"
+ Goto install_files
+
+ instrights_none:
+ ; No registry keys for us...
+
+ install_files:
+ SetOutPath "$INSTDIR\plugins"
+ SetCompress Auto
+ SetOverwrite on
+ File "src\${GUIFICATIONS_DLL}"
+
+ SetOutPath "$INSTDIR\pixmaps\gaim\guifications\conf"
+ File "pixmaps\icon_size_huge.png"
+ File "pixmaps\icon_size_large.png"
+ File "pixmaps\icon_size_normal.png"
+ File "pixmaps\icon_size_small.png"
+ File "pixmaps\icon_size_tiny.png"
+ File "pixmaps\item_position_center.png"
+ File "pixmaps\item_position_east.png"
+ File "pixmaps\item_position_north.png"
+ File "pixmaps\item_position_north_east.png"
+ File "pixmaps\item_position_north_west.png"
+ File "pixmaps\item_position_south.png"
+ File "pixmaps\item_position_south_east.png"
+ File "pixmaps\item_position_south_west.png"
+ File "pixmaps\item_position_west.png"
+ File "pixmaps\text_clipping_elipse_end.png"
+ File "pixmaps\text_clipping_elipse_middle.png"
+ File "pixmaps\text_clipping_elipse_start.png"
+ File "pixmaps\text_clipping_truncate.png"
+ File "pixmaps\window_position_north_east.png"
+ File "pixmaps\window_position_north_west.png"
+ File "pixmaps\window_position_south_east.png"
+ File "pixmaps\window_position_south_west.png"
+ File "pixmaps\window_zoom_in.png"
+ File "pixmaps\window_zoom_normal.png"
+ File "pixmaps\window_zoom_out.png"
+
+ SetOutPath "$INSTDIR\pixmaps\gaim\guifications\backgrounds"
+ File "pixmaps\background_default.png"
+
+
+ StrCmp $R0 "NONE" done
+ CreateShortCut "$SMPROGRAMS\Gaim\${GUIFICATIONS_UNINSTALL_LNK}" "$INSTDIR\${GUIFICATIONS_UNINST_EXE}"
+ WriteUninstaller "$INSTDIR\${GUIFICATIONS_UNINST_EXE}"
+ SetOverWrite off
+
+ done:
+SectionEnd
+
+Section Uninstall
+ Call un.CheckUserInstallRights
+ Pop $R0
+ StrCmp $R0 "NONE" no_rights
+ StrCmp $R0 "HKCU" try_hkcu try_hklm
+
+ try_hkcu:
+ ReadRegStr $R0 HKCU "${GUIFICATIONS_REG_KEY}" ""
+ StrCmp $R0 $INSTDIR 0 cant_uninstall
+ ; HKCU install path matches our INSTDIR.. so uninstall
+ DeleteRegKey HKCU "${GUIFICATIONS_REG_KEY}"
+ DeleteRegKey HKCU "${GUIFICATIONS_UNINSTALL_KEY}"
+ Goto cont_uninstall
+
+ try_hklm:
+ ReadRegStr $R0 HKLM "${GUIFICATIONS_REG_KEY}" ""
+ StrCmp $R0 $INSTDIR 0 try_hkcu
+ ; HKLM install path matches our INSTDIR.. so uninstall
+ DeleteRegKey HKLM "${GUIFICATIONS_REG_KEY}"
+ DeleteRegKey HKLM "${GUIFICATIONS_UNINSTALL_KEY}"
+ ; Sets start menu and desktop scope to all users..
+ SetShellVarContext "all"
+
+ cont_uninstall:
+ ; plugin
+ Delete "$INSTDIR\plugins\${GUIFICATIONS_DLL}"
+ ; pixmaps
+ RMDir /r "$INSTDIR\pixmaps\gaim\guifications"
+ ; uninstaller
+ Delete "$INSTDIR\${GUIFICATIONS_UNINST_EXE}"
+ ; uninstaller shortcut
+ Delete "$SMPROGRAMS\Gaim\${GUIFICATIONS_UNINSTALL_LNK}"
+
+ ; try to delete the Gaim directories, in case it has already uninstalled
+ RMDir "$INSTDIR\plugins"
+ RMDir "$INSTDIR"
+ RMDir "$SMPROGRAMS\Gaim"
+
+ Goto done
+
+ cant_uninstall:
+ MessageBox MB_OK $(un.GUIFICATIONS_UNINSTALL_ERROR_1) IDOK
+ Quit
+
+ no_rights:
+ MessageBox MB_OK $(un.GUIFICATIONS_UNINSTALL_ERROR_2) IDOK
+ Quit
+
+ done:
+SectionEnd
+
+Function .onVerifyInstDir
+ IfFileExists $INSTDIR\gaim.exe Good1
+ Abort
+ Good1:
+FunctionEnd
+
+Function checkGaimVersion
+ ReadRegStr $R1 HKLM "SOFTWARE\gaim" "version"
+ StrCmp $R1 ${GAIM_VERSION} Good2
+ MessageBox MB_OK|MB_ICONSTOP "$(BAD_GAIM_VERSION_1) $R1 $(BAD_GAIM_VERSION_2)"
+ Quit
+ Good2:
+FunctionEnd
+
+
+Function CheckUserInstallRights
+ ClearErrors
+ UserInfo::GetName
+ IfErrors Win9x
+ Pop $0
+ UserInfo::GetAccountType
+ Pop $1
+
+ StrCmp $1 "Admin" 0 +3
+ StrCpy $1 "HKLM"
+ Goto done
+ StrCmp $1 "Power" 0 +3
+ StrCpy $1 "HKLM"
+ Goto done
+ StrCmp $1 "User" 0 +3
+ StrCpy $1 "HKCU"
+ Goto done
+ StrCmp $1 "Guest" 0 +3
+ StrCpy $1 "NONE"
+ Goto done
+ ; Unknown error
+ StrCpy $1 "NONE"
+ Goto done
+
+ Win9x:
+ StrCpy $1 "HKLM"
+
+ done:
+ Push $1
+FunctionEnd
+
+Function un.CheckUserInstallRights
+ ClearErrors
+ UserInfo::GetName
+ IfErrors Win9x
+ Pop $0
+ UserInfo::GetAccountType
+ Pop $1
+ StrCmp $1 "Admin" 0 +3
+ StrCpy $1 "HKLM"
+ Goto done
+ StrCmp $1 "Power" 0 +3
+ StrCpy $1 "HKLM"
+ Goto done
+ StrCmp $1 "User" 0 +3
+ StrCpy $1 "HKCU"
+ Goto done
+ StrCmp $1 "Guest" 0 +3
+ StrCpy $1 "NONE"
+ Goto done
+ ; Unknown error
+ StrCpy $1 "NONE"
+ Goto done
+
+ Win9x:
+ StrCpy $1 "HKLM"
+
+ done:
+ Push $1
+FunctionEnd
+
+
Binary file nsis/header.bmp has changed
Binary file nsis/install.ico has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nsis/translations/english.nsh Sun Jan 11 03:38:26 2004 +0000
@@ -0,0 +1,38 @@
+;;
+;; english.nsh
+;;
+;; Default language strings for the Windows guifications NSIS installer.
+;; Windows Code page: 1252
+;;
+
+; Startup Gaim check
+LangString GAIM_NEEDED ${LANG_ENGLISH} "Guifications requires that Gaim be installed. You must install Gaim before installing Guifications."
+
+LangString GUIFICATIONS_TITLE ${LANG_ENGLISH} "Guifications plugin for Gaim"
+
+LangString BAD_GAIM_VERSION_1 ${LANG_ENGLISH} "Incompatible version.$\r$\n$\r$\nThis version of the Guifications plugin was built for Gaim version ${GAIM_VERSION}. It appears that you have Gaim version"
+
+LangString BAD_GAIM_VERSION_2 ${LANG_ENGLISH} "installed.$\r$\n$\r$\nSee http://guifications.sourceforge.net for more information."
+
+
+; Overrides for default text in windows:
+
+LangString WELCOME_TITLE ${LANG_ENGLISH} "Guifications v${GUIFICATIONS_VERSION} Installer"
+LangString WELCOME_TEXT ${LANG_ENGLISH} "Note: This version of the plugin is designed for Gaim ${GAIM_VERSION}, and will not install or function with other versions of Gaim.\r\n\r\nWhen you upgrade your version of Gaim, you must uninstall or upgrade this plugin as well.\r\n\r\n"
+
+LangString DIR_SUBTITLE ${LANG_ENGLISH} "Please locate the directory where Gaim is installed"
+LangString DIR_INNERTEXT ${LANG_ENGLISH} "Install in this Gaim folder:"
+
+LangString FINISH_TITLE ${LANG_ENGLISH} "Guifications v${GUIFICATIONS_VERSION} Install Complete"
+LangString FINISH_TEXT ${LANG_ENGLISH} "You will need to restart Gaim for the plugin to be loaded, then go the Gaim preferences and enable the Guifications Plugin."
+
+; during install uninstaller
+LangString GUIFICATIONS_PROMPT_WIPEOUT ${LANG_ENGLISH} "The guifications.dll plugin is about to be deleted from your Gaim/plugins directory. Continue?"
+
+; for windows uninstall
+LangString GUIFICATIONS_UNINSTALL_DESC ${LANG_ENGLISH} "Guifications Plugin (remove only)"
+LangString un.GUIFICATIONS_UNINSTALL_ERROR_1 ${LANG_ENGLISH} "The uninstaller could not find registry entries for Guifications.$\rIt is likely that another user installed the plugin."
+LangString un.GUIFICATIONS_UNINSTALL_ERROR_2 ${LANG_ENGLISH} "You do not have the permissions necessary to uninstall the plugin."
+
+
+