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://voria.com/synfig/"
18 OutFile "@PACKAGE_TARNAME@-@PACKAGE_VERSION@.exe"
20 ; The default installation directory
21 InstallDir $PROGRAMFILES\@PACKAGE_TARNAME@
23 ; Registry key to check for directory (so if you install again, it will
24 ; overwrite the old one automatically)
25 InstallDirRegKey HKLM "Software\Voria_@PACKAGE_TARNAME@" "Install_Dir"
27 !define VERSION_MAJ "@VERSION_MAJ@"
28 !define VERSION_MIN "@VERSION_MIN@"
29 !define VERSION_REV "@VERSION_REV@"
31 !define SYNFIG_REG_KEY "Software\@PACKAGE_TARNAME@\@API_VERSION@"
32 !define SYNFIG_UNINSTALL_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PACKAGE_TARNAME@"
33 !define SYNFIG_UNINSTALL_EXE "uninstall-@PACKAGE_TARNAME@.exe"
35 !define MUI_ABORTWARNING
37 ;--------------------------------
45 #UninstPage uninstConfirm
50 !insertmacro MUI_PAGE_WELCOME
51 !insertmacro MUI_PAGE_LICENSE "@srcdir@\COPYING"
52 #!insertmacro MUI_PAGE_LICENSE "@srcdir@\alphalicense.txt"
53 ;Page custom PageReinstall ; PageLeaveReinstall
54 !insertmacro MUI_PAGE_COMPONENTS
55 !insertmacro MUI_PAGE_DIRECTORY
56 !insertmacro MUI_PAGE_INSTFILES
58 !insertmacro MUI_UNPAGE_CONFIRM
59 !insertmacro MUI_UNPAGE_COMPONENTS
60 !insertmacro MUI_UNPAGE_INSTFILES
62 !insertmacro MUI_LANGUAGE "English"
64 ;--------------------------------
66 ; The stuff to install
71 ; Set output path to the installation directory.
72 SetOutPath $INSTDIR\bin
74 File "C:\mingw\bin\mingwm10.dll"
75 File "C:\GTK\bin\libfreetype-6.dll"
76 File "C:\GTK\bin\libxml2.dll"
79 ; File "synfig_modules.conf"
81 CreateDirectory "$INSTDIR\etc"
82 Delete $INSTDIR\etc\synfig_modules.conf
84 ; Write the installation path into the registry
85 ; WriteRegStr HKLM "Software\Voria_@PACKAGE_TARNAME@" "Install_Dir" "$INSTDIR"
87 WriteRegStr HKLM "${SYNFIG_REG_KEY}" "Path" "$INSTDIR"
88 WriteRegStr HKLM "${SYNFIG_REG_KEY}" "Version" "@PRODUCT_VERSION@"
90 ; Write the uninstall keys for Windows
91 WriteRegStr HKLM "${SYNFIG_UNINSTALL_KEY}" "DisplayName" "@PACKAGE_NAME@"
92 WriteRegStr HKLM "${SYNFIG_UNINSTALL_KEY}" "DisplayVersion" "@PACKAGE_VERSION@"
93 WriteRegStr HKLM "${SYNFIG_UNINSTALL_KEY}" "UninstallString" '"$INSTDIR\${SYNFIG_UNINSTALL_EXE}"'
94 WriteRegDWORD HKLM "${SYNFIG_UNINSTALL_KEY}" "NoModify" 1
95 WriteRegDWORD HKLM "${SYNFIG_UNINSTALL_KEY}" "NoRepair" 1
96 WriteUninstaller "${SYNFIG_UNINSTALL_EXE}"
101 ; Optional section (can be disabled by the user)
102 ;Section "Start Menu Shortcuts"
104 ; CreateDirectory "$SMPROGRAMS\Example2"
105 ; CreateShortCut "$SMPROGRAMS\Example2\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
106 ; CreateShortCut "$SMPROGRAMS\Example2\Example2 (MakeNSISW).lnk" "$INSTDIR\makensisw.exe" "" "$INSTDIR\makensisw.exe" 0
110 ; Optional section (can be disabled by the user)
111 Section "Start Menu Shortcuts"
113 CreateDirectory "$SMPROGRAMS\Voria"
114 CreateShortCut "$SMPROGRAMS\Voria\Uninstall Synfig Core.lnk" "$INSTDIR\uninstall-@PACKAGE_TARNAME@.exe" "" "$INSTDIR\uninstall-@PACKAGE_TARNAME@.exe" 0
119 ;--------------------------------
125 ; Remove registry keys
126 DeleteRegKey HKLM "${SYNFIG_REG_KEY}"
127 DeleteRegKey HKLM "${SYNFIG_UNINSTALL_KEY}"
128 ; DeleteRegKey HKLM "Software\Voria_@PACKAGE_TARNAME@"
130 ; Remove files and uninstaller
131 ;Delete $INSTDIR\synfig.exe
132 Delete $INSTDIR\uninstall-@PACKAGE_TARNAME@.exe
133 Delete $INSTDIR\etc\synfig_modules.conf
137 ; Remove shortcuts, if any
139 Delete "$SMPROGRAMS\Voria\Uninstall Synfig Core.lnk"
140 ; Remove directories used
141 ;RMDir "$SMPROGRAMS\Example2"
146 !include @srcdir@\src\synfig\synfig.nsh
147 !include @srcdir@\src\tool\tool.nsh
150 SetOutPath $INSTDIR\examples
151 File "@srcdir@\examples\*.sif"
152 CreateDirectory "$SMPROGRAMS\Voria"
153 CreateShortCut "$SMPROGRAMS\Voria\Examples.lnk" "$INSTDIR\examples" "" "$INSTDIR\examples" 0
156 Section "un.Examples"
157 Delete "$SMPROGRAMS\Voria\Examples.lnk"
158 Delete "$INSTDIR\examples\*.sif"
159 RMDir "$INSTDIR\examples"
164 !include "@srcdir@\src\modules\lyr_std\lyr_std.nsh"
165 !include "@srcdir@\src\modules\mod_filter\mod_filter.nsh"
166 !include "@srcdir@\src\modules\mod_gradient\mod_gradient.nsh"
167 !include "@srcdir@\src\modules\mod_noise\mod_noise.nsh"
168 !include "@srcdir@\src\modules\mod_particle\mod_particle.nsh"
169 !include "@srcdir@\src\modules\mod_geometry\mod_geometry.nsh"
170 !include "@srcdir@\src\modules\lyr_freetype\lyr_freetype.nsh"
172 SubSection "Render Targets"
173 !include "@srcdir@\src\modules\mod_bmp\mod_bmp.nsh"
174 !include "@srcdir@\src\modules\mod_dv\mod_dv.nsh"
175 !include "@srcdir@\src\modules\mod_ffmpeg\mod_ffmpeg.nsh"
176 !include "@srcdir@\src\modules\mod_gif\mod_gif.nsh"
177 !include "@srcdir@\src\modules\mod_imagemagick\mod_imagemagick.nsh"
178 !include "@srcdir@\src\modules\mod_jpeg\mod_jpeg.nsh"
179 !include "@srcdir@\src\modules\mod_png\mod_png.nsh"
180 !include "@srcdir@\src\modules\mod_ppm\mod_ppm.nsh"
181 !include "@srcdir@\src\modules\mod_yuv420p\mod_yuv420p.nsh"
186 SubSection "un.PlugIns"
187 SubSection "un.Layers"
188 !include "@srcdir@\src\modules\lyr_std\unlyr_std.nsh"
189 !include "@srcdir@\src\modules\lyr_freetype\unlyr_freetype.nsh"
190 !include "@srcdir@\src\modules\mod_filter\unmod_filter.nsh"
191 !include "@srcdir@\src\modules\mod_gradient\unmod_gradient.nsh"
192 !include "@srcdir@\src\modules\mod_noise\unmod_noise.nsh"
193 !include "@srcdir@\src\modules\mod_particle\unmod_particle.nsh"
194 !include "@srcdir@\src\modules\mod_geometry\unmod_geometry.nsh"
196 SubSection "un.Render Targets"
197 !include "@srcdir@\src\modules\mod_bmp\unmod_bmp.nsh"
198 !include "@srcdir@\src\modules\mod_dv\unmod_dv.nsh"
199 !include "@srcdir@\src\modules\mod_ffmpeg\unmod_ffmpeg.nsh"
200 !include "@srcdir@\src\modules\mod_gif\unmod_gif.nsh"
201 !include "@srcdir@\src\modules\mod_imagemagick\unmod_imagemagick.nsh"
202 !include "@srcdir@\src\modules\mod_jpeg\unmod_jpeg.nsh"
203 !include "@srcdir@\src\modules\mod_png\unmod_png.nsh"
204 !include "@srcdir@\src\modules\mod_ppm\unmod_ppm.nsh"
205 !include "@srcdir@\src\modules\mod_yuv420p\unmod_yuv420p.nsh"
210 ; Get installer location
211 ReadRegStr $R0 HKLM "${SYNFIG_UNINSTALL_KEY}" "UninstallString"
213 ; ReadRegStr $R0 HKCU "${SYNFIG_UNINSTALL_KEY}" "UninstallString"
217 ; Get current installed version
218 ReadRegStr $R1 HKLM "${SYNFIG_UNINSTALL_KEY}" "DisplayVersion"
220 ; ReadRegStr $R1 HKCU "${SYNFIG_UNINSTALL_KEY}" "DisplayVersion"
222 ; StrCmp $R1 ${PRODUCT_VERSION} done
224 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
226 ; Run the uninstaller
229 ; CopyFiles "$R0" $TEMP
230 ExecWait '$R0 _?=$INSTDIR'
231 IfErrors no_remove_uninstaller
235 no_remove_uninstaller:
238 ; Check that the user completed the uninstallation by examining the registry
239 ReadRegStr $R0 HKLM "${SYNFIG_UNINSTALL_KEY}" "UninstallString"
240 StrCmp $R0 "" done abortInstall
241 ReadRegStr $R0 HKCU "${SYNFIG_UNINSTALL_KEY}" "UninstallString"
242 StrCmp $R0 "" done abortInstall
245 MessageBox MB_OK|MB_ICONEXCLAMATION "Unable to uninstall previous version of @PACKAGE_NAME@"