1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 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 79 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 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240
|
; example2.nsi
;
; This script is based on example1.nsi, but it remember the directory,
; has uninstall support and (optionally) installs start menu shortcuts.
;
; It will install makensisw.exe into a directory that the user selects,
!include "MUI.nsh"
;--------------------------------
; The name of the installer
Name "@PACKAGE_NAME@ @PACKAGE_VERSION@"
!define PRODUCT_WEB_SITE "http://synfig.org/"
; The file to write
OutFile "@PACKAGE_TARNAME@-@PACKAGE_VERSION@.exe"
; The default installation directory
InstallDir $PROGRAMFILES\@PACKAGE_TARNAME@
!define VERSION_MAJ "@VERSION_MAJ@"
!define VERSION_MIN "@VERSION_MIN@"
!define VERSION_REV "@VERSION_REV@"
!define SYNFIG_REG_KEY "Software\@PACKAGE_TARNAME@\@API_VERSION@"
!define SYNFIG_UNINSTALL_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PACKAGE_TARNAME@"
!define SYNFIG_UNINSTALL_EXE "uninstall-@PACKAGE_TARNAME@.exe"
!define MUI_ABORTWARNING
;--------------------------------
; Pages
#Page components
#Page directory
#Page instfiles
#UninstPage uninstConfirm
#UninstPage instfiles
;CustomGuiInit
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "@srcdir@\COPYING"
#!insertmacro MUI_PAGE_LICENSE "@srcdir@\alphalicense.txt"
;Page custom PageReinstall ; PageLeaveReinstall
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_COMPONENTS
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
; The stuff to install
Section ""
SectionIn RO
; Set output path to the installation directory.
SetOutPath $INSTDIR\bin
; Put file there
CreateDirectory "$INSTDIR\etc"
Delete $INSTDIR\etc\synfig_modules.cfg
; Write the installation path into the registry
WriteRegStr HKLM "${SYNFIG_REG_KEY}" "Path" "$INSTDIR"
WriteRegStr HKLM "${SYNFIG_REG_KEY}" "Version" "@PACKAGE_VERSION@"
; Write the uninstall keys for Windows
WriteRegStr HKLM "${SYNFIG_UNINSTALL_KEY}" "DisplayName" "@PACKAGE_NAME@"
WriteRegStr HKLM "${SYNFIG_UNINSTALL_KEY}" "DisplayVersion" "@PACKAGE_VERSION@"
WriteRegStr HKLM "${SYNFIG_UNINSTALL_KEY}" "UninstallString" '"$INSTDIR\${SYNFIG_UNINSTALL_EXE}"'
WriteRegDWORD HKLM "${SYNFIG_UNINSTALL_KEY}" "NoModify" 1
WriteRegDWORD HKLM "${SYNFIG_UNINSTALL_KEY}" "NoRepair" 1
WriteUninstaller "${SYNFIG_UNINSTALL_EXE}"
SectionEnd
; Optional section (can be disabled by the user)
Section "Start Menu Shortcuts"
SetShellVarContext All
CreateDirectory "$SMPROGRAMS\Synfig"
CreateShortCut "$SMPROGRAMS\Synfig\Uninstall Synfig Core.lnk" "$INSTDIR\uninstall-@PACKAGE_TARNAME@.exe" "" "$INSTDIR\uninstall-@PACKAGE_TARNAME@.exe" 0
SectionEnd
;--------------------------------
; Uninstaller
Section "Uninstall"
; Remove registry keys
DeleteRegKey HKLM "${SYNFIG_REG_KEY}"
DeleteRegKey HKLM "${SYNFIG_UNINSTALL_KEY}"
; Remove files and uninstaller
Delete $INSTDIR\uninstall-@PACKAGE_TARNAME@.exe
Delete $INSTDIR\etc\synfig_modules.cfg
RMDir "$INSTDIR\bin"
RMDir "$INSTDIR\etc"
RMDir "$INSTDIR"
SectionEnd
Section "un.Start Menu Shortcuts"
; Remove shortcuts, if any
SetShellVarContext All
Delete "$SMPROGRAMS\Synfig\Uninstall Synfig Core.lnk"
RMDir "$SMPROGRAMS\Synfig"
SectionEnd
!include @srcdir@\src\synfig\synfig.nsh
!include @srcdir@\src\tool\tool.nsh
Section "Examples"
SetOutPath $INSTDIR\examples
File "@srcdir@\examples\*.sifz"
SetShellVarContext All
CreateDirectory "$SMPROGRAMS\Synfig"
CreateShortCut "$SMPROGRAMS\Synfig\Examples.lnk" "$INSTDIR\examples" "" "$INSTDIR\examples" 0
SectionEnd
Section "un.Examples"
Delete "$INSTDIR\examples\*.sifz"
RMDir "$INSTDIR\examples"
SetShellVarContext All
Delete "$SMPROGRAMS\Synfig\Examples.lnk"
RMDir "$SMPROGRAMS\Synfig"
SectionEnd
SectionGroup "PlugIns"
SectionGroup "Layers"
!include "@srcdir@\src\modules\lyr_std\lyr_std.nsh"
!include "@srcdir@\src\modules\mod_filter\mod_filter.nsh"
!include "@srcdir@\src\modules\mod_gradient\mod_gradient.nsh"
!include "@srcdir@\src\modules\mod_noise\mod_noise.nsh"
!include "@srcdir@\src\modules\mod_particle\mod_particle.nsh"
!include "@srcdir@\src\modules\mod_geometry\mod_geometry.nsh"
!include "@srcdir@\src\modules\mod_svg\mod_svg.nsh"
!include "@srcdir@\src\modules\lyr_freetype\lyr_freetype.nsh"
SectionGroupEnd
SectionGroup "Render Targets"
!include "@srcdir@\src\modules\mod_bmp\mod_bmp.nsh"
!include "@srcdir@\src\modules\mod_dv\mod_dv.nsh"
!include "@srcdir@\src\modules\mod_ffmpeg\mod_ffmpeg.nsh"
!include "@srcdir@\src\modules\mod_gif\mod_gif.nsh"
!include "@srcdir@\src\modules\mod_imagemagick\mod_imagemagick.nsh"
!include "@srcdir@\src\modules\mod_jpeg\mod_jpeg.nsh"
!include "@srcdir@\src\modules\mod_openexr\mod_openexr.nsh"
!include "@srcdir@\src\modules\mod_png\mod_png.nsh"
!include "@srcdir@\src\modules\mod_ppm\mod_ppm.nsh"
!include "@srcdir@\src\modules\mod_yuv420p\mod_yuv420p.nsh"
SectionGroupEnd
SectionGroupEnd
SectionGroup "un.PlugIns"
SectionGroup "un.Layers"
!include "@srcdir@\src\modules\lyr_std\unlyr_std.nsh"
!include "@srcdir@\src\modules\lyr_freetype\unlyr_freetype.nsh"
!include "@srcdir@\src\modules\mod_filter\unmod_filter.nsh"
!include "@srcdir@\src\modules\mod_gradient\unmod_gradient.nsh"
!include "@srcdir@\src\modules\mod_noise\unmod_noise.nsh"
!include "@srcdir@\src\modules\mod_particle\unmod_particle.nsh"
!include "@srcdir@\src\modules\mod_geometry\unmod_geometry.nsh"
!include "@srcdir@\src\modules\mod_svg\unmod_svg.nsh"
SectionGroupEnd
SectionGroup "un.Render Targets"
!include "@srcdir@\src\modules\mod_bmp\unmod_bmp.nsh"
!include "@srcdir@\src\modules\mod_dv\unmod_dv.nsh"
!include "@srcdir@\src\modules\mod_ffmpeg\unmod_ffmpeg.nsh"
!include "@srcdir@\src\modules\mod_gif\unmod_gif.nsh"
!include "@srcdir@\src\modules\mod_imagemagick\unmod_imagemagick.nsh"
!include "@srcdir@\src\modules\mod_jpeg\unmod_jpeg.nsh"
!include "@srcdir@\src\modules\mod_openexr\unmod_openexr.nsh"
!include "@srcdir@\src\modules\mod_png\unmod_png.nsh"
!include "@srcdir@\src\modules\mod_ppm\unmod_ppm.nsh"
!include "@srcdir@\src\modules\mod_yuv420p\unmod_yuv420p.nsh"
SectionGroupEnd
SectionGroupEnd
Function .onInit
; Get installer location
ReadRegStr $R0 HKLM "${SYNFIG_UNINSTALL_KEY}" "UninstallString"
; IfErrors 0 +2
; ReadRegStr $R0 HKCU "${SYNFIG_UNINSTALL_KEY}" "UninstallString"
StrCmp $R0 "" done
; Get current installed version
ReadRegStr $R1 HKLM "${SYNFIG_UNINSTALL_KEY}" "DisplayVersion"
; IfErrors 0 +2
; ReadRegStr $R1 HKCU "${SYNFIG_UNINSTALL_KEY}" "DisplayVersion"
; StrCmp $R1 ${PRODUCT_VERSION} done
MessageBox MB_YESNOCANCEL|MB_ICONEXCLAMATION "A previous version of @PACKAGE_NAME@ appears to be installed. Would you like to uninstall it first?" IDNO done IDCANCEL abortInstall
; Run the uninstaller
ClearErrors
; CopyFiles "$R0" $TEMP
ExecWait '$R0 _?=$INSTDIR'
IfErrors no_remove_uninstaller
Delete $R0
RMDir $INSTDIR
no_remove_uninstaller:
; Delete "$TEMP\$R0"
; Check that the user completed the uninstallation by examining the registry
ReadRegStr $R0 HKLM "${SYNFIG_UNINSTALL_KEY}" "UninstallString"
StrCmp $R0 "" done abortInstall
ReadRegStr $R0 HKCU "${SYNFIG_UNINSTALL_KEY}" "UninstallString"
StrCmp $R0 "" done abortInstall
abortInstall:
MessageBox MB_OK|MB_ICONEXCLAMATION "Unable to uninstall previous version of @PACKAGE_NAME@"
Abort
done:
BringToFront
FunctionEnd
|