gucharmap.nsi.in 6.25 KB
Newer Older
1
; $Id: gucharmap.nsi.in,v 1.2 2003/03/15 22:15:30 nlevitt Exp $
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
;
; Copyright (c) 2003  Steve Mcgrath
;
; 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 the
; Free Software Foundation; either version 2 of the License, or (at your
; option) any later version.
;
; This program is distributed in the hope that it will be useful, but
; WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
; General Public License for more details.
;
; You should have received a copy of the GNU General Public License along
; with this program; if not, write to the Free Software Foundation, Inc.,
Rafael's avatar
Rafael committed
17
; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
;
;
; gucharmap NSIS installation script
; http://nsis.sourceforge.net/
; 
; Written by Stephen McGrath
;

!define MUI_PRODUCT "@PACKAGE@"   
!define MUI_VERSION "@VERSION@"

!include "${NSISDIR}\Contrib\Modern UI\System.nsh"

;--------------------------------
;Configuration

  !define MUI_LICENSEPAGE
  !define MUI_DIRECTORYPAGE
  !define MUI_STARTMENUPAGE
  !define MUI_FINISHPAGE
  !define MUI_FINISHPAGE_RUN "$INSTDIR\gucharmap.exe"
  !define MUI_STARTMENU_DEFAULTFOLDER "${MUI_PRODUCT} ${MUI_VERSION}"

  
  !define MUI_ABORTWARNING
  
  !define MUI_UNINSTALLER
  !define MUI_UNCONFIRMPAGE

  ;Language
  ;FIXME: how to handle l10n?
  !insertmacro MUI_LANGUAGE "English"
  
  ;User Variables
  ;FIXME: these should probably be AC_SUBSTed
  !define TEMP1 $0
  !define GTK_HOME "\gtk"
  !define GU_SRC_HOME "\src\${MUI_PRODUCT}-${MUI_VERSION}"

  ;General
  OutFile "${MUI_PRODUCT}-${MUI_VERSION}-setup.exe"
  BrandingText "${MUI_PRODUCT} v${MUI_VERSION} Installer"

  ;License page
  LicenseData "${GU_SRC_HOME}\COPYING"

  ;Descriptions
  LangString DESC_SecCopyUI ${LANG_ENGLISH} "Copy ${MUI_PRODUCT} files to application folder."

  ;Folder-selection page
  ;DirText "Select the directory where you want to install GUCharMap"
  InstallDir "$PROGRAMFILES\${MUI_PRODUCT}-${MUI_VERSION}"

;--------------------------------
;Modern UI System

!insertmacro MUI_SYSTEM

;--------------------------------
;Installer Sections

79
Section "Installer Section" SecCopyUI
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178

  SetOutPath "$INSTDIR"
  File "${GU_SRC_HOME}\src\gucharmap.exe"
  File "${GTK_HOME}\lib\iconv.dll"
  File "${GTK_HOME}\lib\libatk-1.0-0.dll"
  File "${GTK_HOME}\lib\libgdk-win32-2.0-0.dll"
  File "${GTK_HOME}\lib\libgdk_pixbuf-2.0-0.dll"
  File "${GTK_HOME}\lib\libglib-2.0-0.dll"
  File "${GTK_HOME}\lib\libgmodule-2.0-0.dll"
  File "${GTK_HOME}\lib\libgobject-2.0-0.dll"
  File "${GTK_HOME}\lib\libgtk-win32-2.0-0.dll"
  File "${GTK_HOME}\lib\libintl-1.dll"
  File "${GTK_HOME}\lib\libpango-1.0-0.dll"
  File "${GTK_HOME}\lib\libpangowin32-1.0-0.dll"
  File "${GTK_HOME}\lib\libpng.dll"
  File "${GTK_HOME}\lib\zlib.dll"
  File "${GU_SRC_HOME}\COPYING"
  ;File "${GU_SRC_HOME}\README"

  SetOutPath "$INSTDIR\lib\gtk-2.0\2.2.0\loaders"
  File "${GTK_HOME}\lib\gtk-2.0\2.2.0\loaders\libpixbufloader-png.dll"

  SetOutPath "$INSTDIR\lib\pango\1.0.0\modules"
  File "${GTK_HOME}\lib\pango\1.0.0\modules\pango-basic-win32.dll"

  SetOutPath "$INSTDIR\share\pixmaps"
  File "${GU_SRC_HOME}\pixmaps\gucharmap.png"

  SetOutPath "$INSTDIR\etc\gtk-2.0"
  File "${GTK_HOME}\etc\gtk-2.0\gdk-pixbuf.loaders"
  File "${GTK_HOME}\etc\gtk-2.0\gtk.immodules"
  File /oname=gtkrc "${GU_SRC_HOME}\gtkrc.win32"

  SetOutPath "$INSTDIR\etc\pango"
  File "${GTK_HOME}\etc\pango\pango.aliases"
  File "${GTK_HOME}\etc\pango\pango.modules"	

  ;Start menu entries
  !insertmacro MUI_STARTMENU_WRITE_BEGIN
    
    !undef MUI_STARTMENU_VARIABLE
    !define MUI_STARTMENU_VARIABLE "${MUI_PRODUCT} ${MUI_VERSION}" ;Define start menu link

    CreateDirectory "$SMPROGRAMS\${MUI_STARTMENU_VARIABLE}"
    CreateShortCut "$SMPROGRAMS\${MUI_STARTMENU_VARIABLE}\${MUI_PRODUCT}.lnk" "$INSTDIR\gucharmap.exe"
    CreateShortCut "$SMPROGRAMS\${MUI_STARTMENU_VARIABLE}\Uninstall.lnk" "$INSTDIR\Uninstall.exe"

    ;Write shortcut location to the registry (for Uninstaller)
    WriteRegStr HKCU "Software\${MUI_PRODUCT}" "Start Menu Folder" "${MUI_STARTMENU_VARIABLE}"

    ;Write uninstaller location to registry (for Add/Remove Programs list)
    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}\${MUI_PRODUCT}-${MUI_VERSION}" "UninstallString" "$INSTDIR\Uninstall.exe"
    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}\${MUI_PRODUCT}-${MUI_VERSION}" "DisplayName" "${MUI_PRODUCT} ${MUI_VERSION}"
    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}\${MUI_PRODUCT}-${MUI_VERSION}" "InstalledPath" "$INSTDIR"

  !insertmacro MUI_STARTMENU_WRITE_END

  ;Create uninstaller
  WriteUninstaller "$INSTDIR\Uninstall.exe"

SectionEnd


;--------------------------------
;Descriptions

!insertmacro MUI_FUNCTIONS_DESCRIPTION_BEGIN
  !insertmacro MUI_DESCRIPTION_TEXT ${SecCopyUI} $(DESC_SecCopyUI)
!insertmacro MUI_FUNCTIONS_DESCRIPTION_END
 
;--------------------------------
;Uninstaller Section

Section "Uninstall"

  RMDir "$INSTDIR"

  ;Remove shortcut
  ReadRegStr ${TEMP1} HKCU "Software\${MUI_PRODUCT}" "Start Menu Folder"
  
  StrCmp ${TEMP1} "" noshortcuts
 
  Delete "$SMPROGRAMS\${TEMP1}\${MUI_PRODUCT}.lnk"
  Delete "$SMPROGRAMS\${TEMP1}\Uninstall.lnk"
  RMDir "$SMPROGRAMS\${TEMP1}" ;Only if empty, so it won't delete other shortcuts
    
  noshortcuts:

  DeleteRegValue HKCU "Software\${MUI_PRODUCT}" "Start Menu Folder"
  DeleteRegKey /ifempty HKCU "Software\${MUI_PRODUCT}"
  DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}\${MUI_PRODUCT}-${MUI_VERSION}" "UninstallString"
  DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}\${MUI_PRODUCT}-${MUI_VERSION}" "InstalledPath"
  DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}\${MUI_PRODUCT}-${MUI_VERSION}" "DisplayName"
  DeleteRegKey /ifempty HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}"

  ;Display the Finish header
  !insertmacro MUI_UNFINISHHEADER

SectionEnd