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://www.synfig.com/"
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\*.sif"
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\*.sif"
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_png\mod_png.nsh"
166 !include "@srcdir@\src\modules\mod_ppm\mod_ppm.nsh"
167 !include "@srcdir@\src\modules\mod_yuv420p\mod_yuv420p.nsh"
171 SectionGroup "un.PlugIns"
172 SectionGroup "un.Layers"
173 !include "@srcdir@\src\modules\lyr_std\unlyr_std.nsh"
174 !include "@srcdir@\src\modules\lyr_freetype\unlyr_freetype.nsh"
175 !include "@srcdir@\src\modules\mod_filter\unmod_filter.nsh"
176 !include "@srcdir@\src\modules\mod_gradient\unmod_gradient.nsh"
177 !include "@srcdir@\src\modules\mod_noise\unmod_noise.nsh"
178 !include "@srcdir@\src\modules\mod_particle\unmod_particle.nsh"
179 !include "@srcdir@\src\modules\mod_geometry\unmod_geometry.nsh"
181 SectionGroup "un.Render Targets"
182 !include "@srcdir@\src\modules\mod_bmp\unmod_bmp.nsh"
183 !include "@srcdir@\src\modules\mod_dv\unmod_dv.nsh"
184 !include "@srcdir@\src\modules\mod_ffmpeg\unmod_ffmpeg.nsh"
185 !include "@srcdir@\src\modules\mod_gif\unmod_gif.nsh"
186 !include "@srcdir@\src\modules\mod_imagemagick\unmod_imagemagick.nsh"
187 !include "@srcdir@\src\modules\mod_jpeg\unmod_jpeg.nsh"
188 !include "@srcdir@\src\modules\mod_png\unmod_png.nsh"
189 !include "@srcdir@\src\modules\mod_ppm\unmod_ppm.nsh"
190 !include "@srcdir@\src\modules\mod_yuv420p\unmod_yuv420p.nsh"
195 ; Get installer location
196 ReadRegStr $R0 HKLM "${SYNFIG_UNINSTALL_KEY}" "UninstallString"
198 ; ReadRegStr $R0 HKCU "${SYNFIG_UNINSTALL_KEY}" "UninstallString"
202 ; Get current installed version
203 ReadRegStr $R1 HKLM "${SYNFIG_UNINSTALL_KEY}" "DisplayVersion"
205 ; ReadRegStr $R1 HKCU "${SYNFIG_UNINSTALL_KEY}" "DisplayVersion"
207 ; StrCmp $R1 ${PRODUCT_VERSION} done
209 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
211 ; Run the uninstaller
214 ; CopyFiles "$R0" $TEMP
215 ExecWait '$R0 _?=$INSTDIR'
216 IfErrors no_remove_uninstaller
220 no_remove_uninstaller:
223 ; Check that the user completed the uninstallation by examining the registry
224 ReadRegStr $R0 HKLM "${SYNFIG_UNINSTALL_KEY}" "UninstallString"
225 StrCmp $R0 "" done abortInstall
226 ReadRegStr $R0 HKCU "${SYNFIG_UNINSTALL_KEY}" "UninstallString"
227 StrCmp $R0 "" done abortInstall
230 MessageBox MB_OK|MB_ICONEXCLAMATION "Unable to uninstall previous version of @PACKAGE_NAME@"