3 ; This script is based on example1.nsi, but it remember the directory,
4 ; has uninstall support and (optionally) installs start menu shortcuts.
6 ; It will install makensisw.exe into a directory that the user selects,
10 ;--------------------------------
12 ; The name of the installer
13 Name "@PACKAGE_NAME@ @PACKAGE_VERSION@"
15 !define PRODUCT_WEB_SITE "http://synfig.org/"
18 OutFile "@PACKAGE_TARNAME@-@PACKAGE_VERSION@.exe"
20 ; The default installation directory
21 InstallDir $PROGRAMFILES\@PACKAGE_TARNAME@
23 !define VERSION_MAJ "@VERSION_MAJ@"
24 !define VERSION_MIN "@VERSION_MIN@"
25 !define VERSION_REV "@VERSION_REV@"
27 !define SYNFIG_REG_KEY "Software\@PACKAGE_TARNAME@\@API_VERSION@"
28 !define SYNFIG_UNINSTALL_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PACKAGE_TARNAME@"
29 !define SYNFIG_UNINSTALL_EXE "uninstall-@PACKAGE_TARNAME@.exe"
31 !define MUI_ABORTWARNING
33 ;--------------------------------
41 #UninstPage uninstConfirm
46 !insertmacro MUI_PAGE_WELCOME
47 !insertmacro MUI_PAGE_LICENSE "@srcdir@\COPYING"
48 #!insertmacro MUI_PAGE_LICENSE "@srcdir@\alphalicense.txt"
49 ;Page custom PageReinstall ; PageLeaveReinstall
50 !insertmacro MUI_PAGE_COMPONENTS
51 !insertmacro MUI_PAGE_DIRECTORY
52 !insertmacro MUI_PAGE_INSTFILES
54 !insertmacro MUI_UNPAGE_CONFIRM
55 !insertmacro MUI_UNPAGE_COMPONENTS
56 !insertmacro MUI_UNPAGE_INSTFILES
58 !insertmacro MUI_LANGUAGE "English"
60 ;--------------------------------
62 ; The stuff to install
67 ; Set output path to the installation directory.
68 SetOutPath $INSTDIR\bin
72 CreateDirectory "$INSTDIR\etc"
73 Delete $INSTDIR\etc\synfig_modules.cfg
75 ; Write the installation path into the registry
76 WriteRegStr HKLM "${SYNFIG_REG_KEY}" "Path" "$INSTDIR"
77 WriteRegStr HKLM "${SYNFIG_REG_KEY}" "Version" "@PACKAGE_VERSION@"
79 ; Write the uninstall keys for Windows
80 WriteRegStr HKLM "${SYNFIG_UNINSTALL_KEY}" "DisplayName" "@PACKAGE_NAME@"
81 WriteRegStr HKLM "${SYNFIG_UNINSTALL_KEY}" "DisplayVersion" "@PACKAGE_VERSION@"
82 WriteRegStr HKLM "${SYNFIG_UNINSTALL_KEY}" "UninstallString" '"$INSTDIR\${SYNFIG_UNINSTALL_EXE}"'
83 WriteRegDWORD HKLM "${SYNFIG_UNINSTALL_KEY}" "NoModify" 1
84 WriteRegDWORD HKLM "${SYNFIG_UNINSTALL_KEY}" "NoRepair" 1
85 WriteUninstaller "${SYNFIG_UNINSTALL_EXE}"
89 ; Optional section (can be disabled by the user)
90 Section "Start Menu Shortcuts"
92 SetShellVarContext All
93 CreateDirectory "$SMPROGRAMS\Voria"
94 CreateShortCut "$SMPROGRAMS\Voria\Uninstall Synfig Core.lnk" "$INSTDIR\uninstall-@PACKAGE_TARNAME@.exe" "" "$INSTDIR\uninstall-@PACKAGE_TARNAME@.exe" 0
99 ;--------------------------------
105 ; Remove registry keys
106 DeleteRegKey HKLM "${SYNFIG_REG_KEY}"
107 DeleteRegKey HKLM "${SYNFIG_UNINSTALL_KEY}"
109 ; Remove files and uninstaller
110 Delete $INSTDIR\uninstall-@PACKAGE_TARNAME@.exe
111 Delete $INSTDIR\etc\synfig_modules.cfg
118 Section "un.Start Menu Shortcuts"
120 ; Remove shortcuts, if any
121 SetShellVarContext All
122 Delete "$SMPROGRAMS\Voria\Uninstall Synfig Core.lnk"
123 RMDir "$SMPROGRAMS\Voria"
127 !include @srcdir@\src\synfig\synfig.nsh
128 !include @srcdir@\src\tool\tool.nsh
131 SetOutPath $INSTDIR\examples
132 File "@srcdir@\examples\*.sifz"
134 SetShellVarContext All
135 CreateDirectory "$SMPROGRAMS\Voria"
136 CreateShortCut "$SMPROGRAMS\Voria\Examples.lnk" "$INSTDIR\examples" "" "$INSTDIR\examples" 0
139 Section "un.Examples"
140 Delete "$INSTDIR\examples\*.sifz"
141 RMDir "$INSTDIR\examples"
143 SetShellVarContext All
144 Delete "$SMPROGRAMS\Voria\Examples.lnk"
145 RMDir "$SMPROGRAMS\Voria"
148 SectionGroup "PlugIns"
149 SectionGroup "Layers"
150 !include "@srcdir@\src\modules\lyr_std\lyr_std.nsh"
151 !include "@srcdir@\src\modules\mod_filter\mod_filter.nsh"
152 !include "@srcdir@\src\modules\mod_gradient\mod_gradient.nsh"
153 !include "@srcdir@\src\modules\mod_noise\mod_noise.nsh"
154 !include "@srcdir@\src\modules\mod_particle\mod_particle.nsh"
155 !include "@srcdir@\src\modules\mod_geometry\mod_geometry.nsh"
156 !include "@srcdir@\src\modules\lyr_freetype\lyr_freetype.nsh"
158 SectionGroup "Render Targets"
159 !include "@srcdir@\src\modules\mod_bmp\mod_bmp.nsh"
160 !include "@srcdir@\src\modules\mod_dv\mod_dv.nsh"
161 !include "@srcdir@\src\modules\mod_ffmpeg\mod_ffmpeg.nsh"
162 !include "@srcdir@\src\modules\mod_gif\mod_gif.nsh"
163 !include "@srcdir@\src\modules\mod_imagemagick\mod_imagemagick.nsh"
164 !include "@srcdir@\src\modules\mod_jpeg\mod_jpeg.nsh"
165 !include "@srcdir@\src\modules\mod_openexr\mod_openexr.nsh"
166 !include "@srcdir@\src\modules\mod_png\mod_png.nsh"
167 !include "@srcdir@\src\modules\mod_ppm\mod_ppm.nsh"
168 !include "@srcdir@\src\modules\mod_yuv420p\mod_yuv420p.nsh"
172 SectionGroup "un.PlugIns"
173 SectionGroup "un.Layers"
174 !include "@srcdir@\src\modules\lyr_std\unlyr_std.nsh"
175 !include "@srcdir@\src\modules\lyr_freetype\unlyr_freetype.nsh"
176 !include "@srcdir@\src\modules\mod_filter\unmod_filter.nsh"
177 !include "@srcdir@\src\modules\mod_gradient\unmod_gradient.nsh"
178 !include "@srcdir@\src\modules\mod_noise\unmod_noise.nsh"
179 !include "@srcdir@\src\modules\mod_particle\unmod_particle.nsh"
180 !include "@srcdir@\src\modules\mod_geometry\unmod_geometry.nsh"
182 SectionGroup "un.Render Targets"
183 !include "@srcdir@\src\modules\mod_bmp\unmod_bmp.nsh"
184 !include "@srcdir@\src\modules\mod_dv\unmod_dv.nsh"
185 !include "@srcdir@\src\modules\mod_ffmpeg\unmod_ffmpeg.nsh"
186 !include "@srcdir@\src\modules\mod_gif\unmod_gif.nsh"
187 !include "@srcdir@\src\modules\mod_imagemagick\unmod_imagemagick.nsh"
188 !include "@srcdir@\src\modules\mod_jpeg\unmod_jpeg.nsh"
189 !include "@srcdir@\src\modules\mod_openexr\unmod_openexr.nsh"
190 !include "@srcdir@\src\modules\mod_png\unmod_png.nsh"
191 !include "@srcdir@\src\modules\mod_ppm\unmod_ppm.nsh"
192 !include "@srcdir@\src\modules\mod_yuv420p\unmod_yuv420p.nsh"
197 ; Get installer location
198 ReadRegStr $R0 HKLM "${SYNFIG_UNINSTALL_KEY}" "UninstallString"
200 ; ReadRegStr $R0 HKCU "${SYNFIG_UNINSTALL_KEY}" "UninstallString"
204 ; Get current installed version
205 ReadRegStr $R1 HKLM "${SYNFIG_UNINSTALL_KEY}" "DisplayVersion"
207 ; ReadRegStr $R1 HKCU "${SYNFIG_UNINSTALL_KEY}" "DisplayVersion"
209 ; StrCmp $R1 ${PRODUCT_VERSION} done
211 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
213 ; Run the uninstaller
216 ; CopyFiles "$R0" $TEMP
217 ExecWait '$R0 _?=$INSTDIR'
218 IfErrors no_remove_uninstaller
222 no_remove_uninstaller:
225 ; Check that the user completed the uninstallation by examining the registry
226 ReadRegStr $R0 HKLM "${SYNFIG_UNINSTALL_KEY}" "UninstallString"
227 StrCmp $R0 "" done abortInstall
228 ReadRegStr $R0 HKCU "${SYNFIG_UNINSTALL_KEY}" "UninstallString"
229 StrCmp $R0 "" done abortInstall
232 MessageBox MB_OK|MB_ICONEXCLAMATION "Unable to uninstall previous version of @PACKAGE_NAME@"