1 ; Instructions for compilers
2 ; ==========================
3 ; This file generates the Inkscape installer, which is currently the
4 ; preferred deployment method on Windows.
5 ; 1. Install NSIS 2.46 or later on Windows (2.45 has a !searchparse bug
6 ; which breaks it and earlier doesn't support Windows 7 properly, and
7 ; cross-compilation probably won't work due to some !system magic)
8 ; 2. Compile Inkscape (http://wiki.inkscape.org/wiki/index.php/Win32Port)
9 ; 3. Compile this file with NSIS. There should be no need to set version
10 ; numbers in this file as it gets them from the Bazaar branch info and
11 ; ..\..\src\inkscape-version.cpp. However, if the version number comes
12 ; out wrong or this script didn't compile properly then you can define
13 ; INKSCAPE_VERSION by uncommenting the next line and setting the correct
14 ; value:
15 ; !define INKSCAPE_VERSION "0.48"
16 ; If you ever need to do a second, third or Nth release of the build or
17 ; of the installer, then change the RELEASE_REVISION value below:
18 !define RELEASE_REVISION 1
20 ; There should never be any need for packagers to touch anything below
21 ; this line. That's my job - Chris Morgan
23 ; Installer code {{{1
24 ; Compression and admin requirement {{{2
25 SetCompressor /SOLID lzma
26 SetCompressorDictSize 32
27 RequestExecutionLevel admin
29 ; Include required files {{{2
30 !include RequireLatestNSIS.nsh
31 !include ifexist.nsh
32 !include VersionCompleteXXXX.nsh
33 !include LogicLib.nsh
34 !include Sections.nsh
36 !macro !redef VAR VAL
37 !define _!redef_${VAR} `${VAL}`
38 !ifdef ${VAR}
39 !undef ${VAR}
40 !endif
41 !define ${VAR} `${VAL}`
42 !undef _!redef_${VAR}
43 !macroend
44 !define !redef `!insertmacro !redef`
46 ; Advanced Uninstall Log {{{3
47 ; We're abusing this script terribly and it's time to fix the broken uninstaller.
48 ; However, for the moment, this is what we're using.
49 !define INSTDIR_REG_ROOT HKLM
50 !define INSTDIR_REG_KEY "${UNINST_KEY}"
51 !include AdvUninstLog.nsh
52 !insertmacro INTERACTIVE_UNINSTALL
54 ; Initialise NSIS plug-ins {{{3
55 ; The plugins used are md5dll and messagebox
56 !addplugindir .
58 ; FileFunc bits and pieces {{{3
59 !include FileFunc.nsh
60 !insertmacro GetParameters
61 !insertmacro GetOptions
62 !insertmacro un.GetParent
64 ; User interface {{{3
65 !include MUI.nsh
66 ; MUI Configuration {{{4
67 !define MUI_ABORTWARNING
68 !define MUI_ICON ..\..\inkscape.ico
69 !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
70 !define MUI_HEADERIMAGE
71 !define MUI_HEADERIMAGE_BITMAP header.bmp
72 !define MUI_WELCOMEFINISHPAGE_BITMAP welcomefinish.bmp
73 !define MUI_COMPONENTSPAGE_SMALLDESC
75 ; Pages {{{4
76 ; Installer pages {{{5
77 ; Welcome page {{{6
78 !insertmacro MUI_PAGE_WELCOME
79 ; License page {{{6
80 LicenseForceSelection off
81 ;!define MUI_LICENSEPAGE_RADIOBUTTONS
82 !define MUI_LICENSEPAGE_BUTTON "$(^NextBtn)"
83 !define MUI_LICENSEPAGE_TEXT_BOTTOM "$(LICENSE_BOTTOM_TEXT)"
84 !insertmacro MUI_PAGE_LICENSE ..\..\Copying
85 ; Components page {{{6
86 !insertmacro MUI_PAGE_COMPONENTS
87 ; InstType "$(Full)"
88 ; InstType "$(Optimal)"
89 ; InstType "$(Minimal)"
90 ; Directory page {{{6
91 !insertmacro MUI_PAGE_DIRECTORY
92 ; Instfiles page {{{6
93 !insertmacro MUI_PAGE_INSTFILES
94 ; Finish page {{{6
95 !define MUI_FINISHPAGE_RUN "$INSTDIR\inkscape.exe"
96 !insertmacro MUI_PAGE_FINISH
98 ; Uninstaller pages {{{5
99 !insertmacro MUI_UNPAGE_CONFIRM
100 UninstPage custom un.CustomPageUninstall
101 !insertmacro MUI_UNPAGE_INSTFILES
102 ShowUninstDetails hide
103 !insertmacro MUI_UNPAGE_FINISH
105 ; Localization {{{3
106 ; See also the "Languages sections" SectionGroup lower down.
107 !insertmacro MUI_RESERVEFILE_LANGDLL
108 ;TODO: check if `!insertmacro LANGFILE "English" "English"`-style lines are needed (don't think it should be due to MUI_LANGUAGE)
109 !echo `Loading language files...`
110 !verbose push
111 !verbose 3
112 !insertmacro MUI_LANGUAGE "English"
113 !insertmacro LANGFILE_INCLUDE "languages\English.nsh"
114 !macro INKLANGFILE _LANG
115 !insertmacro MUI_LANGUAGE "${_LANG}"
116 !insertmacro LANGFILE_INCLUDE_WITHDEFAULT "languages\${_LANG}.nsh" "languages\English.nsh"
117 !macroend
118 !insertmacro INKLANGFILE Breton
119 !insertmacro INKLANGFILE Catalan
120 !insertmacro INKLANGFILE Czech
121 !insertmacro INKLANGFILE Dutch
122 !insertmacro INKLANGFILE Finnish
123 !insertmacro INKLANGFILE French
124 !insertmacro INKLANGFILE Galician
125 !insertmacro INKLANGFILE German
126 !insertmacro INKLANGFILE Indonesian
127 !insertmacro INKLANGFILE Italian
128 !insertmacro INKLANGFILE Japanese
129 !insertmacro INKLANGFILE Polish
130 !insertmacro INKLANGFILE Romanian
131 !insertmacro INKLANGFILE Russian
132 !insertmacro INKLANGFILE Slovak
133 !insertmacro INKLANGFILE Slovenian
134 !insertmacro INKLANGFILE Spanish
135 !insertmacro INKLANGFILE SimpChinese
136 !insertmacro INKLANGFILE TradChinese
137 !insertmacro INKLANGFILE Ukrainian
138 !verbose pop
140 ReserveFile inkscape.nsi.uninstall
141 ReserveFile "${NSISDIR}\Plugins\UserInfo.dll"
142 !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
144 ; #######################################
145 ; SETTINGS
146 ; #######################################
148 ; Product details (version, name, registry keys etc.) {{{2
149 ; Find the version number in inkscape-version.cpp (e.g. 0.47+devel) {{{3
150 !ifndef INKSCAPE_VERSION
151 ; Official release format (no newlines)
152 !searchparse /noerrors /file ..\..\src\inkscape-version.cpp `namespace Inkscape { char const *version_string = "` INKSCAPE_VERSION ` r` BZR_REVISION `"; }`
153 !ifndef INKSCAPE_VERSION
154 ; Other format; sorry, it has to be done in two steps.
155 !searchparse /noerrors /file ..\..\src\inkscape-version.cpp `char const *version_string = "` INKSCAPE_VERSION `";`
156 !searchparse /noerrors `${INKSCAPE_VERSION}` `` INKSCAPE_VERSION ` r` BZR_REVISION
157 !ifndef INKSCAPE_VERSION
158 !error "INKSCAPE_VERSION not defined and unable to get version number from ..\..\src\inkscape-version.cpp!"
159 !endif
160 !endif
161 !endif
162 !echo `Got version number from ..\..\src\inkscape-version.cpp: ${INKSCAPE_VERSION}`
163 !define FILENAME Inkscape-${INKSCAPE_VERSION}
164 !define BrandingText `Inkscape ${INKSCAPE_VERSION}`
166 ; Check for the Bazaar revision number for lp:inkscape {{{3
167 ${!ifexist} ..\..\.bzr\branch\last-revision
168 !if `${BZR_REVISION}` == ``
169 !undef BZR_REVISION
170 !endif
171 !ifndef BZR_REVISION
172 !searchparse /noerrors /file ..\..\.bzr\branch\last-revision "" BZR_REVISION " "
173 !endif
174 !endif
176 ; Check for devel builds and clear up bzr revision number define {{{3
177 !searchparse /noerrors ${INKSCAPE_VERSION} "" INKSCAPE_VERSION_NUMBER "+devel"
178 !if ${INKSCAPE_VERSION_NUMBER} != ${INKSCAPE_VERSION}
179 !define DEVEL
180 !endif
181 !if `${BZR_REVISION}` == ``
182 !undef BZR_REVISION
183 !endif
184 ; For releases like 0.48pre1, throw away the preN. It's too tricky to deal with
185 ; it properly so I'll leave it alone. It's just a pre-release, so it doesn't
186 ; really matter. So long as the final release works properly.
187 !ifndef DEVEL
188 !undef INKSCAPE_VERSION_NUMBER
189 !searchparse /noerrors ${INKSCAPE_VERSION} "" INKSCAPE_VERSION_NUMBER "pre" PRE_NUMBER
190 !endif
192 ; Handle display version number and complete X.X version numbers into X.X.X.X {{{3
193 !ifdef DEVEL & BZR_REVISION
194 ${!redef} FILENAME `${FILENAME}-r${BZR_REVISION}`
195 ${!redef} BrandingText `${BrandingText} r${BZR_REVISION}`
196 !define VERSION_X.X.X.X_REVISION ${BZR_REVISION}
197 ; Handle the installer revision number {{{4
198 !else ifdef RELEASE_REVISION
199 ${!redef} FILENAME `${FILENAME}-${RELEASE_REVISION}`
200 ; If we wanted the branding text to be like "Inkscape 0.48pre1 r9505" this'd do it.
201 ;!ifdef BZR_REVISION
202 ; ${!redef} BrandingText `${BrandingText} r${BZR_REVISION}`
203 ;!endif
204 !if `${RELEASE_REVISION}` != `1`
205 ${!redef} BrandingText `${BrandingText}, revision ${RELEASE_REVISION}`
206 !endif
207 !define VERSION_X.X.X.X_REVISION ${RELEASE_REVISION}
208 !else
209 !define VERSION_X.X.X.X_REVISION 0
210 !endif
212 ${VersionCompleteXXXN} ${INKSCAPE_VERSION_NUMBER} VERSION_X.X.X.X ${VERSION_X.X.X.X_REVISION}
214 ; Product definitions {{{3
215 !define PRODUCT_NAME "Inkscape" ; TODO: fix up the language files to not use this and kill this line
216 !define INSTDIR_KEY "Software\Microsoft\Windows\CurrentVersion\App Paths\inkscape.exe"
217 !define UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\Inkscape"
218 ;!define DUMMYINSTALL ; Define this to make it build quickly, not including any of the files or code in the sections, for quick testing of features of the installer and development thereof.
219 !define _FILENAME ${FILENAME}.exe
220 !undef FILENAME
221 !define FILENAME ${_FILENAME}
222 !undef _FILENAME
224 ; Product information {{{3
225 Name `Inkscape`
226 Caption `Inkscape - $(CaptionDescription)`
227 BrandingText `${BrandingText}`
228 OutFile `${FILENAME}`
229 InstallDir "$PROGRAMFILES\Inkscape"
230 InstallDirRegKey HKLM "${INSTDIR_KEY}" ""
232 ; Version information {{{3
233 VIProductVersion ${VERSION_X.X.X.X}
234 VIAddVersionKey ProductName Inkscape
235 VIAddVersionKey Comments "Licensed under the GNU GPL"
236 VIAddVersionKey CompanyName inkscape.org
237 VIAddVersionKey LegalCopyright "© 2009 Inkscape"
238 VIAddVersionKey FileDescription Inkscape
239 VIAddVersionKey FileVersion ${VERSION_X.X.X.X}
240 VIAddVersionKey ProductVersion ${VERSION_X.X.X.X}
241 VIAddVersionKey InternalName Inkscape
243 ; Variables {{{2
244 Var askMultiUser
245 Var filename
246 Var MultiUser
247 Var User
248 Var CMDARGS
250 !macro delprefs ; Delete preferences (originally from VLC) {{{2
251 StrCpy $0 0
252 DetailPrint "Deleting personal preferences..."
253 DetailPrint "Finding all users..."
254 ${Do}
255 ; this will loop through all the logged users and "virtual" windows users
256 ; (it looks like users are only present in HKEY_USERS when they are logged in)
257 ClearErrors
258 EnumRegKey $1 HKU "" $0
259 ${IfThen} $1 == "" ${|} ${ExitDo} ${|}
260 IntOp $0 $0 + 1
261 ReadRegStr $2 HKU "$1\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" AppData
262 ${IfThen} $2 == "" ${|} ${Continue} ${|}
263 DetailPrint "Removing $2\Inkscape"
264 Delete $2\Inkscape\preferences.xml
265 Delete $2\Inkscape\extension-errors.log
266 RMDir $2\Inkscape
267 ${Loop}
268 !macroend
270 ; Sections (these do the work) {{{2
272 Section -removeInkscape ; Hidden, mandatory section to clean a previous installation {{{
273 !ifndef DUMMYINSTALL
274 ;remove the old Inkscape shortcuts from the startmenu
275 ;just in case they are still there
276 SetShellVarContext current
277 Delete "$SMPROGRAMS\Inkscape\Uninstall Inkscape.lnk"
278 Delete $SMPROGRAMS\Inkscape\Inkscape.lnk
279 RMDir $SMPROGRAMS\Inkscape
280 Delete $SMPROGRAMS\Inkscape.lnk
281 SetShellVarContext all
282 Delete "$SMPROGRAMS\Inkscape\Uninstall Inkscape.lnk"
283 Delete $SMPROGRAMS\Inkscape\Inkscape.lnk
284 RMDir $SMPROGRAMS\Inkscape
285 Delete $SMPROGRAMS\Inkscape.lnk
286 !endif
287 SectionEnd ; -removeInkscape }}}
289 Section $(Core) SecCore ; Mandatory Inkscape core files section {{{
290 SectionIn 1 2 3 RO
291 !ifndef DUMMYINSTALL
292 DetailPrint "Installing Inkscape core files..."
293 SetOutPath $INSTDIR
294 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
295 SetOverwrite on
296 SetAutoClose false
298 File /a ..\..\inkscape\ink*.exe
299 File /a ..\..\inkscape\AUTHORS
300 File /a ..\..\inkscape\COPYING
301 File /a ..\..\inkscape\COPYING.LIB
302 File /a ..\..\inkscape\NEWS
303 File /a ..\..\inkscape\gspawn-win32-helper.exe
304 File /a ..\..\inkscape\gspawn-win32-helper-console.exe
305 File /nonfatal /a ..\..\inkscape\HACKING.txt
306 File /a ..\..\inkscape\README
307 File /nonfatal /a ..\..\inkscape\README.txt
308 File /a ..\..\inkscape\TRANSLATORS
309 File /nonfatal /a /r ..\..\inkscape\data
310 File /nonfatal /a /r ..\..\inkscape\doc
311 File /nonfatal /a /r ..\..\inkscape\plugins
312 File /nonfatal /a /r /x *.??*.???* /x examples /x tutorials ..\..\inkscape\share
313 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
314 ; this files are added because it slips through the filter
315 SetOutPath $INSTDIR\share\clipart
316 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
317 File /a ..\..\inkscape\share\clipart\inkscape.logo.svg
318 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
319 SetOutPath $INSTDIR\share\icons
320 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
321 File /a ..\..\inkscape\share\icons\inkscape.file.png
322 File /a ..\..\inkscape\share\icons\inkscape.file.svg
323 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
324 SetOutPath $INSTDIR\modules
325 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
326 File /nonfatal /a /r ..\..\inkscape\modules\*.*
327 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
328 SetOutPath $INSTDIR\python
329 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
330 File /nonfatal /a /r ..\..\inkscape\python\*.*
331 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
332 !endif
333 SectionEnd ; SecCore }}}
335 Section $(GTKFiles) SecGTK ; Mandatory GTK files section {{{
336 SectionIn 1 2 3 RO
337 !ifndef DUMMYINSTALL
338 DetailPrint "Installing GTK files..."
339 SetOutPath $INSTDIR
340 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
341 SetOverwrite on
342 File /a /r ..\..\inkscape\*.dll
343 File /a /r /x locale ..\..\inkscape\lib
344 File /a /r ..\..\inkscape\etc
345 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
346 !endif
347 SectionEnd ; SecGTK }}}
349 Section -SetCurrentUserOnly ; Set the installation to "current user" only by default {{{
350 !ifndef DUMMYINSTALL
351 StrCpy $MultiUser 0
352 SetShellVarContext current
353 !endif
354 SectionEnd ; -SetCurrentUserOnly }}}
356 Section $(Alluser) SecAlluser ; Then offer the user the option to make it global (default) {{{
357 SectionIn 1 2 3
358 !ifndef DUMMYINSTALL
359 ; disable this option in Win95/Win98/WinME
360 StrCpy $MultiUser 1
361 DetailPrint "Installing in administrator mode (registry root will be HKLM)"
362 SetShellVarContext all
363 !endif
364 SectionEnd ; SecAllUser }}}
366 SectionGroup "$(Shortcuts)" SecShortcuts ; Create shortcuts for the user {{{
368 Section $(Desktop) SecDesktop ; Desktop shortcut {{{
369 !ifndef DUMMYINSTALL
370 CreateShortCut $DESKTOP\Inkscape.lnk $INSTDIR\inkscape.exe
371 !endif
372 SectionEnd ; SecDesktop }}}
374 Section $(Quicklaunch) SecQuickLaunch ; Quick Launch shortcut {{{
375 !ifndef DUMMYINSTALL
376 ${IfThen} $QUICKLAUNCH != $TEMP ${|} CreateShortCut $QUICKLAUNCH\Inkscape.lnk $INSTDIR\inkscape.exe ${|}
377 !endif
378 SectionEnd ; SecQuickLaunch }}}
380 Section $(SVGWriter) SecSVGWriter ; Register Inkscape as the default application for .svg[z] {{{
381 SectionIn 1 2 3
382 !ifndef DUMMYINSTALL
383 DetailPrint "Associating SVG files with Inkscape"
384 StrCpy $3 svg
385 ${For} $2 0 1
386 ${IfThen} $2 = 1 ${|} StrCpy $3 $3z ${|}
387 ReadRegStr $0 HKCR ".$3" ""
388 ${If} $0 == ""
389 StrCpy $0 "$3file"
390 WriteRegStr HKCR ".$3" "" $0
391 WriteRegStr HKCR $0 "" "Scalable Vector Graphics file"
392 ${EndIf}
393 WriteRegStr HKCR $0\shell\edit\command "" `"$INSTDIR\Inkscape.exe" "%1"`
394 ${Next}
395 !endif
396 SectionEnd ; SecSVGWriter }}}
398 Section $(ContextMenu) SecContextMenu ; Put Inkscape in the .svg[z] context menus (but not as default) {{{
399 SectionIn 1 2 3
400 !ifndef DUMMYINSTALL
401 DetailPrint "Adding Inkscape to SVG file context menu"
402 ReadRegStr $0 HKCR .svg ""
403 ${If} $0 == ""
404 StrCpy $0 svgfile
405 WriteRegStr HKCR .svg "" $0
406 WriteRegStr HKCR $0 "" "Scalable Vector Graphics file"
407 ${EndIf}
408 WriteRegStr HKCR $0\shell\Inkscape\command "" `"$INSTDIR\Inkscape.exe" "%1"`
410 ReadRegStr $0 HKCR .svgz ""
411 ${If} $0 == ""
412 StrCpy $0 svgzfile
413 WriteRegStr HKCR .svgz "" $0
414 WriteRegStr HKCR $0 "" "Scalable Vector Graphics file"
415 ${EndIf}
416 WriteRegStr HKCR $0\shell\Inkscape\command "" `"$INSTDIR\Inkscape.exe" "%1"`
417 !endif
418 SectionEnd ; SecContextMenu }}}
420 SectionGroupEnd ; SecShortcuts }}}
422 Section /o "$(DeletePrefs)" SecPrefs ; Delete user preferences before installation {{{
423 !ifndef DUMMYINSTALL
424 !insertmacro delprefs
425 !endif
426 SectionEnd ; SecPrefs }}}
428 SectionGroup "$(Addfiles)" SecAddfiles ; Additional files {{{
430 Section $(Examples) SecExamples ; Install example SVG files {{{
431 SectionIn 1 2
432 !ifndef DUMMYINSTALL
433 SetOutPath $INSTDIR\share
434 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
435 File /nonfatal /a /r /x *.??*.???* ..\..\inkscape\share\examples
436 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
437 !endif
438 SectionEnd ; SecExamples }}}
440 Section $(Tutorials) SecTutorials ; Install tutorials {{{
441 SectionIn 1 2
442 !ifndef DUMMYINSTALL
443 SetOutPath $INSTDIR\share
444 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
445 File /nonfatal /a /r /x *.??*.???* ..\..\inkscape\share\tutorials
446 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
447 !endif
448 SectionEnd ; SecTutorials }}}
450 SectionGroupEnd ; SecAddfiles }}}
452 SectionGroup "$(Languages)" SecLanguages ; Languages sections {{{
453 !macro Language SecName lng ; A macro to create each section {{{
454 Section /o "$(lng_${lng}) (${lng})" Sec${SecName}
455 ;SectionIn 1 2 3
456 !ifndef DUMMYINSTALL
457 SetOutPath $INSTDIR
458 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
459 File /nonfatal /a ..\..\inkscape\*.${lng}.txt ; FIXME: remove this? No such files.
460 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
461 SetOutPath $INSTDIR\locale
462 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
463 File /nonfatal /a /r ..\..\inkscape\locale\${lng}
464 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
465 SetOutPath $INSTDIR\lib\locale
466 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
467 File /nonfatal /a /r ..\..\inkscape\lib\locale\${lng}
468 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
469 SetOutPath $INSTDIR\share\clipart
470 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
471 File /nonfatal /a /r ..\..\inkscape\share\clipart\*.${lng}.svg
472 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
473 ; the keyboard tables
474 SetOutPath $INSTDIR\share\screens
475 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
476 File /nonfatal /a /r ..\..\inkscape\share\screens\*.${lng}.svg
477 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
478 SetOutPath $INSTDIR\share\templates
479 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
480 File /nonfatal /a /r ..\..\inkscape\share\templates\*.${lng}.svg
481 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
482 SetOutPath $INSTDIR\doc
483 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
484 File /nonfatal /a /r ..\..\inkscape\doc\keys.${lng}.xml
485 File /nonfatal /a /r ..\..\inkscape\doc\keys.${lng}.html
486 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
487 SectionGetFlags ${SecTutorials} $R1
488 IntOp $R1 $R1 & ${SF_SELECTED}
489 ${If} $R1 >= ${SF_SELECTED}
490 SetOutPath $INSTDIR\share\tutorials
491 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
492 File /nonfatal /a ..\..\inkscape\share\tutorials\*.${lng}.*
493 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
494 ${EndIf}
495 !endif
496 SectionEnd
497 !macroend ; Language }}}
499 ; Now create each section with the Language macro {{{
500 !insertmacro Language Amharic am
501 !insertmacro Language Arabic ar
502 !insertmacro Language Azerbaijani az
503 !insertmacro Language Byelorussian be
504 !insertmacro Language Bulgarian bg
505 !insertmacro Language Bengali bn
506 !insertmacro Language Breton br
507 !insertmacro Language Catalan ca
508 !insertmacro Language CatalanValencia ca@valencia
509 !insertmacro Language Czech cs
510 !insertmacro Language Danish da
511 !insertmacro Language German de
512 !insertmacro Language Dzongkha dz
513 !insertmacro Language Greek el
514 !insertmacro Language EnglishAustralian en_AU
515 !insertmacro Language EnglishCanadian en_CA
516 !insertmacro Language EnglishBritain en_GB
517 !insertmacro Language EnglishPiglatin en_US@piglatin
518 !insertmacro Language Esperanto eo
519 !insertmacro Language Spanish es
520 !insertmacro Language SpanishMexico es_MX
521 !insertmacro Language Estonian et
522 !insertmacro Language Basque eu
523 !insertmacro Language French fr
524 !insertmacro Language Finnish fi
525 !insertmacro Language Irish ga
526 !insertmacro Language Galician gl
527 !insertmacro Language Hebrew he
528 !insertmacro Language Croatian hr
529 !insertmacro Language Hungarian hu
530 !insertmacro Language Indonesian id
531 !insertmacro Language Italian it
532 !insertmacro Language Japanese ja
533 !insertmacro Language Khmer km
534 !insertmacro Language Korean ko
535 !insertmacro Language Lithuanian lt
536 !insertmacro Language Mongolian mn
537 !insertmacro Language Macedonian mk
538 !insertmacro Language NorwegianBokmal nb
539 !insertmacro Language Nepali ne
540 !insertmacro Language Dutch nl
541 !insertmacro Language NorwegianNynorsk nn
542 !insertmacro Language Panjabi pa
543 !insertmacro Language Polish pl
544 !insertmacro Language Portuguese pt
545 !insertmacro Language PortugueseBrazil pt_BR
546 !insertmacro Language Romanian ro
547 !insertmacro Language Russian ru
548 !insertmacro Language Kinyarwanda rw
549 !insertmacro Language Slovak sk
550 !insertmacro Language Slovenian sl
551 !insertmacro Language Albanian sq
552 !insertmacro Language Serbian sr
553 !insertmacro Language SerbianLatin sr@latin
554 !insertmacro Language Swedish sv
555 !insertmacro Language Thai th
556 !insertmacro Language Turkish tr
557 !insertmacro Language Ukrainian uk
558 !insertmacro Language Vietnamese vi
559 !insertmacro Language SimpChinese zh_CN
560 !insertmacro Language TradChinese zh_TW
561 ; }}}
562 SectionGroupEnd ; SecLanguages }}}
564 Section -FinalizeInstallation ; Hidden, mandatory section to finalize installation {{{
565 !ifndef DUMMYINSTALL
566 DetailPrint "Finalizing installation"
567 ${IfThen} $MultiUser = 1 ${|} SetShellVarContext all ${|}
568 ${IfThen} $MultiUser != 1 ${|} SetShellVarContext current ${|}
570 WriteRegStr SHCTX "${INSTDIR_KEY}" "" $INSTDIR\inkscape.exe
571 WriteRegStr SHCTX "${INSTDIR_KEY}" MultiUser $MultiUser
572 WriteRegStr SHCTX "${INSTDIR_KEY}" askMultiUser $askMultiUser
573 WriteRegStr SHCTX "${INSTDIR_KEY}" User $User
575 ; start menu entries
576 CreateShortcut $SMPROGRAMS\Inkscape.lnk $INSTDIR\inkscape.exe
578 ; uninstall settings
579 ; WriteUninstaller $INSTDIR\uninst.exe
580 WriteRegExpandStr SHCTX "${UNINST_KEY}" UninstallString ${UNINST_EXE}
581 WriteRegExpandStr SHCTX "${UNINST_KEY}" InstallDir $INSTDIR
582 WriteRegExpandStr SHCTX "${UNINST_KEY}" InstallLocation $INSTDIR
583 WriteRegStr SHCTX "${UNINST_KEY}" DisplayName "Inkscape ${INKSCAPE_VERSION}"
584 WriteRegStr SHCTX "${UNINST_KEY}" DisplayIcon $INSTDIR\Inkscape.exe,0
585 WriteRegStr SHCTX "${UNINST_KEY}" DisplayVersion ${INKSCAPE_VERSION}
586 WriteRegDWORD SHCTX "${UNINST_KEY}" NoModify 1
587 WriteRegDWORD SHCTX "${UNINST_KEY}" NoRepair 1
589 ;create/update log always within .onInstSuccess function
590 !insertmacro UNINSTALL.LOG_UPDATE_INSTALL
592 DetailPrint "Creating MD5 checksums"
593 ClearErrors
594 FileOpen $0 $INSTDIR\Uninstall.dat r
595 FileOpen $9 $INSTDIR\Uninstall.log w
596 ${IfNot} ${Errors}
597 ${Do}
598 ClearErrors
599 FileRead $0 $1
600 ${IfThen} ${Errors} ${|} ${ExitDo} ${|}
601 StrCpy $1 $1 -2
602 md5dll::GetMD5File /NOUNLOAD $1
603 Pop $2
604 ${IfThen} $2 != "" ${|} FileWrite $9 "$2 $1$\r$\n" ${|}
605 ${Loop}
606 ${EndIf}
607 FileClose $0
608 FileClose $9
609 ; Not needed any more
610 Delete $INSTDIR\Uninstall.dat
611 !endif
612 SectionEnd ; -FinalizeInstallation }}}
614 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN ; Section descriptions {{{
615 !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "$(CoreDesc)"
616 !insertmacro MUI_DESCRIPTION_TEXT ${SecGTK} "$(GTKFilesDesc)"
617 !insertmacro MUI_DESCRIPTION_TEXT ${SecShortcuts} "$(ShortcutsDesc)"
618 !insertmacro MUI_DESCRIPTION_TEXT ${SecAlluser} "$(AlluserDesc)"
619 !insertmacro MUI_DESCRIPTION_TEXT ${SecDesktop} "$(DesktopDesc)"
620 !insertmacro MUI_DESCRIPTION_TEXT ${SecQuicklaunch} "$(QuicklaunchDesc)"
621 !insertmacro MUI_DESCRIPTION_TEXT ${SecSVGWriter} "$(SVGWriterDesc)"
622 !insertmacro MUI_DESCRIPTION_TEXT ${SecContextMenu} "$(ContextMenuDesc)"
623 !insertmacro MUI_DESCRIPTION_TEXT ${SecPrefs} "$(DeletePrefsDesc)"
624 !insertmacro MUI_DESCRIPTION_TEXT ${SecAddfiles} "$(AddfilesDesc)"
625 !insertmacro MUI_DESCRIPTION_TEXT ${SecExamples} "$(ExamplesDesc)"
626 !insertmacro MUI_DESCRIPTION_TEXT ${SecTutorials} "$(TutorialsDesc)"
627 !insertmacro MUI_DESCRIPTION_TEXT ${SecLanguages} "$(LanguagesDesc)"
628 !insertmacro MUI_FUNCTION_DESCRIPTION_END ; Section descriptions }}}
631 Function .onInit ; initialise the installer {{{2
632 ; This code will be executed before the sections, but due to the
633 ; language code in the sections it must come after it in the code.
635 ; Language detection {{{
636 !insertmacro MUI_LANGDLL_DISPLAY
638 !macro LanguageAutoSelect SecName LocaleID
639 ${If} $LANGUAGE = ${LocaleID}
640 SectionGetFlags ${Sec${SecName}} $0
641 IntOp $0 $0 | ${SF_SELECTED}
642 SectionSetFlags ${Sec${SecName}} $0
643 ${EndIf}
644 !macroend
646 ; No need for English to be detected as it's the default
647 !insertmacro LanguageAutoSelect Breton 1150
648 !insertmacro LanguageAutoSelect Catalan 1027
649 !insertmacro LanguageAutoSelect Czech 1029
650 !insertmacro LanguageAutoSelect Dutch 1043
651 !insertmacro LanguageAutoSelect Finnish 1035
652 !insertmacro LanguageAutoSelect French 1036
653 !insertmacro LanguageAutoSelect Galician 1110
654 !insertmacro LanguageAutoSelect German 1031
655 !insertmacro LanguageAutoSelect Indonesian 1057
656 !insertmacro LanguageAutoSelect Italian 1040
657 !insertmacro LanguageAutoSelect Japanese 1041
658 !insertmacro LanguageAutoSelect Polish 1045
659 !insertmacro LanguageAutoSelect Romanian 1048
660 !insertmacro LanguageAutoSelect Russian 1049
661 !insertmacro LanguageAutoSelect Slovak 1051
662 !insertmacro LanguageAutoSelect Slovenian 1060
663 !insertmacro LanguageAutoSelect Spanish 1034
664 !insertmacro LanguageAutoSelect SimpChinese 2052
665 !insertmacro LanguageAutoSelect TradChinese 1028
666 !insertmacro LanguageAutoSelect Ukrainian 1058
667 ; End of language detection }}}
669 !insertmacro UNINSTALL.LOG_PREPARE_INSTALL ; prepare advanced uninstallation log script
671 ;Extract InstallOptions INI files
672 StrCpy $AskMultiUser 1
673 StrCpy $MultiUser 0
674 ; this resets AskMultiUser if Win95/98/ME
675 ClearErrors
676 ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
677 ${If} ${Errors}
678 ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion" VersionNumber
679 StrCpy $R0 $R0 1
680 ${IfThen} $R0 = 4 ${|} StrCpy $AskMultiUser 0 ${|}
681 ${EndIf}
683 ; hide all user section if ME/9x
684 ${IfThen} $AskMultiUser != 1 ${|} SectionSetText ${SecAlluser} "" ${|}
686 ; hide if quick launch if not available
687 ${IfThen} $QUICKLAUNCH == $TEMP ${|} SectionSetText ${SecQuicklaunch} "" ${|}
689 ; Check for administrative privileges {{{
690 ClearErrors
691 UserInfo::GetName
692 ${If} ${Errors}
693 ; This one means you don't need to care about admin or
694 ; not admin because Windows 9x doesn't either
695 ${IfCmd} MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "$(NOT_SUPPORTED)$(OK_CANCEL_DESC)" /SD IDOK IDCANCEL ${||} Quit ${|}
696 ${Else}
697 Pop $User
698 UserInfo::GetAccountType
699 Pop $1
700 ${If} $1 != Admin
701 ${AndIf} ${Cmd} ${|} MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "$(NO_ADMIN)$(OK_CANCEL_DESC)" /SD IDOK IDCANCEL ${|}
702 Quit
703 ${EndIf}
704 ${EndIf} ; }}}
706 ; Detect an Inkscape installation by another user {{{
707 ReadRegStr $0 HKLM "${INSTDIR_KEY}" User ; first global...
708 ${IfThen} $0 == "" ${|} ReadRegStr $0 HKCU "${INSTDIR_KEY}" User ${|} ; then current user
709 ${If} $0 != ""
710 ${AndIf} $0 != $User
711 ${AndIf} ${Cmd} ${|} MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "$(DIFFERENT_USER)$(OK_CANCEL_DESC)" /SD IDOK IDCANCEL ${|}
712 Quit
713 ${EndIf} ; }}}
715 ; Request uninstallation of an old Inkscape installation {{{
716 ReadRegStr $R0 HKLM "${UNINST_KEY}" UninstallString
717 ${IfThen} $R0 == "" ${|} ReadRegStr $R0 HKCU "${UNINST_KEY}" UninstallString ${|}
718 ${If} $R0 != ""
719 ${AndIf} ${Cmd} ${|} MessageBox MB_YESNO|MB_ICONEXCLAMATION "$(WANT_UNINSTALL_BEFORE)" /SD IDNO IDYES ${|}
720 ExecWait $R0
721 ${EndIf} ; }}}
723 ; Process command-line arguments (for automation) {{{
724 !echo `Creating code to process command-line arguments...`
725 !verbose push
726 !verbose 3
727 ${GetParameters} $CMDARGS
729 !macro Parameter key Section
730 ${GetOptions} $CMDARGS /${key}= $1
731 ${If} $1 == OFF
732 SectionGetFlags ${Section} $0
733 IntOp $2 ${SF_SELECTED} ~
734 IntOp $0 $0 & $2
735 SectionSetFlags ${Section} $0
736 ${EndIf}
737 ${If} $1 == ON
738 SectionGetFlags ${Section} $0
739 IntOp $0 $0 | ${SF_SELECTED}
740 SectionSetFlags ${Section} $0
741 ${EndIf}
742 !macroend
744 !insertmacro Parameter GTK ${SecGTK}
745 !insertmacro Parameter SHORTCUTS ${secShortcuts}
746 !insertmacro Parameter ALLUSER ${SecAlluser}
747 !insertmacro Parameter DESKTOP ${SecDesktop}
748 !insertmacro Parameter QUICKLAUNCH ${SecQUICKlaunch}
749 !insertmacro Parameter SVGEDITOR ${SecSVGWriter}
750 !insertmacro Parameter CONTEXTMENUE ${SecContextMenu}
751 !insertmacro Parameter PREFERENCES ${SecPrefs}
752 !insertmacro Parameter ADDFILES ${SecAddfiles}
753 !insertmacro Parameter EXAMPLES ${SecExamples}
754 !insertmacro Parameter TUTORIALS ${SecTutorials}
755 !insertmacro Parameter LANGUAGES ${SecLanguages}
756 !insertmacro Parameter am ${SecAmharic}
757 !insertmacro Parameter ar ${SecArabic}
758 !insertmacro Parameter az ${SecAzerbaijani}
759 !insertmacro Parameter be ${SecByelorussian}
760 !insertmacro Parameter bg ${SecBulgarian}
761 !insertmacro Parameter bn ${SecBengali}
762 !insertmacro Parameter br ${SecBreton}
763 !insertmacro Parameter ca ${SecCatalan}
764 !insertmacro Parameter ca@valencia ${SecCatalanValencia}
765 !insertmacro Parameter cs ${SecCzech}
766 !insertmacro Parameter da ${SecDanish}
767 !insertmacro Parameter de ${SecGerman}
768 !insertmacro Parameter dz ${SecDzongkha}
769 !insertmacro Parameter el ${SecGreek}
770 !insertmacro Parameter en_AU ${SecEnglishAustralian}
771 !insertmacro Parameter en_CA ${SecEnglishCanadian}
772 !insertmacro Parameter en_GB ${SecEnglishBritain}
773 !insertmacro Parameter en_US@piglatin ${SecEnglishPiglatin}
774 !insertmacro Parameter eo ${SecEsperanto}
775 !insertmacro Parameter es ${SecSpanish}
776 !insertmacro Parameter es_MX ${SecSpanishMexico}
777 !insertmacro Parameter et ${SecEstonian}
778 !insertmacro Parameter eu ${SecBasque}
779 !insertmacro Parameter fi ${SecFinnish}
780 !insertmacro Parameter fr ${SecFrench}
781 !insertmacro Parameter ga ${SecIrish}
782 !insertmacro Parameter gl ${SecGalician}
783 !insertmacro Parameter he ${SecHebrew}
784 !insertmacro Parameter hr ${SecCroatian}
785 !insertmacro Parameter hu ${SecHungarian}
786 !insertmacro Parameter id ${SecIndonesian}
787 !insertmacro Parameter it ${SecItalian}
788 !insertmacro Parameter ja ${SecJapanese}
789 !insertmacro Parameter km ${SecKhmer}
790 !insertmacro Parameter ko ${SecKorean}
791 !insertmacro Parameter lt ${SecLithuanian}
792 !insertmacro Parameter mk ${SecMacedonian}
793 !insertmacro Parameter mn ${SecMongolian}
794 !insertmacro Parameter nb ${SecNorwegianBokmal}
795 !insertmacro Parameter ne ${SecNepali}
796 !insertmacro Parameter nl ${SecDutch}
797 !insertmacro Parameter nn ${SecNorwegianNynorsk}
798 !insertmacro Parameter pa ${SecPanjabi}
799 !insertmacro Parameter pl ${SecPolish}
800 !insertmacro Parameter pt ${SecPortuguese}
801 !insertmacro Parameter pt_BR ${SecPortugueseBrazil}
802 !insertmacro Parameter ro ${SecRomanian}
803 !insertmacro Parameter ru ${SecRussian}
804 !insertmacro Parameter rw ${SecKinyarwanda}
805 !insertmacro Parameter sk ${SecSlovak}
806 !insertmacro Parameter sl ${SecSlovenian}
807 !insertmacro Parameter sq ${SecAlbanian}
808 !insertmacro Parameter sr ${SecSerbian}
809 !insertmacro Parameter sr@latin ${SecSerbianLatin}
810 !insertmacro Parameter sv ${SecSwedish}
811 !insertmacro Parameter th ${SecThai}
812 !insertmacro Parameter tr ${SecTurkish}
813 !insertmacro Parameter uk ${SecUkrainian}
814 !insertmacro Parameter vi ${SecVietnamese}
815 !insertmacro Parameter zh_CN ${SecSimpChinese}
816 !insertmacro Parameter zh_TW ${SecTradChinese}
818 ClearErrors
819 ${GetOptions} $CMDARGS /? $1
820 ${IfNot} ${Errors}
821 MessageBox MB_OK "Possible parameters for installer:$\r$\n \
822 /?: this help screen$\r$\n \
823 /S: silent$\r$\n \
824 /D=(directory): where to install Inkscape$\r$\n \
825 /GTK=(OFF/ON): GTK+ Runtime environment$\r$\n \
826 /SHORTCUTS=(OFF/ON): shortcuts to start Inkscape$\r$\n \
827 /ALLUSER=(OFF/ON): for all users on the computer$\r$\n \
828 /DESKTOP=(OFF/ON): Desktop icon$\r$\n \
829 /QUICKLAUNCH=(OFF/ON): quick launch icon$\r$\n \
830 /SVGEDITOR=(OFF/ON): default SVG editor$\r$\n \
831 /CONTEXTMENUE=(OFF/ON): context menue integration$\r$\n \
832 /PREFERENCES=(OFF/ON): delete users preference files$\r$\n \
833 /ADDFILES=(OFF/ON): additional files$\r$\n \
834 /EXAMPLES=(OFF/ON): examples$\r$\n \
835 /TUTORIALS=(OFF/ON): tutorials$\r$\n \
836 /LANGUAGES=(OFF/ON): translated menues, examples, etc.$\r$\n \
837 /[locale code]=(OFF/ON): e.g am, es, es_MX as in Inkscape supported"
838 Abort
839 !verbose pop
840 ${EndIf} ; }}}
841 FunctionEnd ; .onInit }}}
842 ; Uninstaller code {{{1
843 Function un.onInit ; initialise uninstaller {{{
844 ;begin uninstall, could be added on top of uninstall section instead
845 ;!insertmacro UNINSTALL.LOG_BEGIN_UNINSTALL
846 ${IfNot} ${FileExists} $INSTDIR\uninstall.log
847 MessageBox MB_OK|MB_ICONEXCLAMATION "$(UninstallLogNotFound)" /SD IDOK
848 Quit
849 ${EndIf}
850 ClearErrors
851 StrCpy $User ""
852 UserInfo::GetName
853 ${IfNot} ${Errors}
854 Pop $0
855 StrCpy $User $0
856 ${EndIf}
857 StrCpy $askMultiUser 1
858 StrCpy $MultiUser 1
860 ; Test if this was a multiuser installation
861 ReadRegStr $0 HKLM "${INSTDIR_KEY}" ""
862 ${If} $0 == $INSTDIR\inkscape.exe
863 ReadRegStr $MultiUser HKLM "${INSTDIR_KEY}" MultiUser
864 ReadRegStr $askMultiUser HKLM "${INSTDIR_KEY}" askMultiUser
865 ReadRegStr $0 HKLM "${INSTDIR_KEY}" User
866 ${Else}
867 ReadRegStr $MultiUser HKCU "${INSTDIR_KEY}" MultiUser
868 ReadRegStr $askMultiUser HKCU "${INSTDIR_KEY}" askMultiUser
869 ReadRegStr $0 HKCU "${INSTDIR_KEY}" User
870 ${EndIf}
871 ;check user if applicable
872 ${If} $0 != ""
873 ${AndIf} $0 != $User
874 ${AndIf} ${Cmd} ${|} MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "$(DIFFERENT_USER)$(OK_CANCEL_DESC)" /SD IDOK IDCANCEL ${|}
875 Quit
876 ${EndIf}
878 !insertmacro MUI_INSTALLOPTIONS_EXTRACT inkscape.nsi.uninstall
880 SetShellVarContext all
881 ${IfThen} $MultiUser = 0 ${|} SetShellVarContext current ${|}
882 FunctionEnd ; un.onInit }}}
884 Function un.CustomPageUninstall ; {{{
885 !insertmacro MUI_HEADER_TEXT "$(UInstOpt)" "$(UInstOpt1)"
886 !insertmacro MUI_INSTALLOPTIONS_WRITE inkscape.nsi.uninstall "Field 1" Text "$APPDATA\Inkscape\"
887 !insertmacro MUI_INSTALLOPTIONS_WRITE inkscape.nsi.uninstall "Field 2" Text "$(PurgePrefs)"
888 !insertmacro MUI_INSTALLOPTIONS_DISPLAY inkscape.nsi.uninstall
889 !insertmacro MUI_INSTALLOPTIONS_READ $MultiUser inkscape.nsi.uninstall "Field 2" State
890 FunctionEnd ; un.CustomPageUninstall }}}
892 Section Uninstall ; do the uninstalling {{{
893 !ifndef DUMMYINSTALL
894 ; remove personal settings
895 Delete $APPDATA\Inkscape\extension-errors.log
896 ${If} $MultiUser = 0
897 DetailPrint "Purging personal settings in $APPDATA\Inkscape"
898 ;RMDir /r $APPDATA\Inkscape
899 !insertmacro delprefs
900 ${EndIf}
902 ; Remove file associations for svg editor
903 StrCpy $3 svg
904 ${For} $2 0 1
905 ${IfThen} $2 = 1 ${|} StrCpy $3 $3z ${|}
906 DetailPrint "Removing file associations for $3 editor"
907 ClearErrors
908 ReadRegStr $0 HKCR .$3 ""
909 ${IfNot} ${Errors}
910 ReadRegStr $1 HKCR $0\shell\edit\command ""
911 ${If} $1 == `"$INSTDIR\Inkscape.exe" "%1"`
912 DeleteRegKey HKCR $0\shell\edit\command
913 ${EndIf}
915 ClearErrors
916 ReadRegStr $1 HKCR $0\shell\open\command ""
917 ${If} $1 == `"$INSTDIR\Inkscape.exe" "%1"`
918 DeleteRegKey HKCR $0\shell\open\command
919 ${EndIf}
921 DeleteRegKey HKCR $0\shell\Inkscape
922 DeleteRegKey /ifempty HKCR $0\shell\edit
923 DeleteRegKey /ifempty HKCR $0\shell\open
924 DeleteRegKey /ifempty HKCR $0\shell
925 DeleteRegKey /ifempty HKCR $0
926 DeleteRegKey /ifempty HKCR .$3
927 ${EndIf}
928 ${Next}
930 SetShellVarContext all
931 DeleteRegKey SHCTX "${INSTDIR_KEY}"
932 DeleteRegKey SHCTX "${UNINST_KEY}"
933 Delete $DESKTOP\Inkscape.lnk
934 Delete $QUICKLAUNCH\Inkscape.lnk
935 Delete $SMPROGRAMS\Inkscape.lnk
936 ;just in case they are still there
937 Delete "$SMPROGRAMS\Inkscape\Uninstall Inkscape.lnk"
938 Delete $SMPROGRAMS\Inkscape\Inkscape.lnk
939 RMDir $SMPROGRAMS\Inkscape
941 SetShellVarContext current
942 DeleteRegKey SHCTX "${INSTDIR_KEY}"
943 DeleteRegKey SHCTX "${UNINST_KEY}"
944 Delete $DESKTOP\Inkscape.lnk
945 Delete $QUICKLAUNCH\Inkscape.lnk
946 Delete $SMPROGRAMS\Inkscape.lnk
947 ;just in case they are still there
948 Delete "$SMPROGRAMS\Inkscape\Uninstall Inkscape.lnk"
949 Delete $SMPROGRAMS\Inkscape\Inkscape.lnk
950 RMDir $SMPROGRAMS\Inkscape
952 InitPluginsDir
953 SetPluginUnload manual
955 ClearErrors
956 FileOpen $0 $INSTDIR\uninstall.log r
957 ${If} ${Errors} ;else uninstallnotfound
958 MessageBox MB_OK|MB_ICONEXCLAMATION "$(UninstallLogNotFound)" /SD IDOK
959 ${Else}
960 ${Do}
961 ClearErrors
962 FileRead $0 $1
963 ${IfThen} ${Errors} ${|} ${ExitDo} ${|}
964 ; cat the line into md5 and filename
965 StrLen $2 $1
966 ${IfThen} $2 <= 35 ${|} ${Continue} ${|}
967 StrCpy $3 $1 32
968 StrCpy $filename $1 $2-36 34 ;remove trailing CR/LF
969 StrCpy $filename $filename -2
970 ; $3 = MD5 when installed, then deletion choice
971 ; $filename = file
972 ; $5 = MD5 now
973 ; $6 = always/never remove files touched by user
975 ${If} ${FileExists} $filename
976 ${If} $6 == always
977 StrCpy $3 2
978 ${Else}
979 md5dll::GetMD5File /NOUNLOAD $filename
980 Pop $5 ;md5 of file
981 ${If} $3 == $5
982 StrCpy $3 1 ; yes
983 ${ElseIf} $6 != never
984 ; the md5 sums does not match so we ask
985 messagebox::show MB_DEFBUTTON3|MB_TOPMOST "" 0,103 \
986 "$(FileChanged)" "$(Yes)" "$(AlwaysYes)" "$(No)" "$(AlwaysNo)"
987 Pop $3
988 ${IfThen} $3 = 2 ${|} StrCpy $6 always ${|}
989 ${IfThen} $3 = 4 ${|} StrCpy $6 never ${|}
990 ${EndIf}
991 ${EndIf}
993 ${If} $3 = 1 ; yes
994 ${OrIf} $3 = 2 ; always
995 ; Remove File
996 ClearErrors
997 Delete $filename
998 ;now recursivly remove the path
999 ${Do}
1000 ClearErrors
1001 ${un.GetParent} $filename $filename
1002 ${IfThen} ${Errors} ${|} ${ExitDo} ${|}
1003 RMDir $filename
1004 ${IfThen} ${Errors} ${|} ${ExitDo} ${|}
1005 ${Loop}
1006 ${EndIf}
1007 ${EndIf}
1008 ${Loop}
1009 ${EndIf}
1010 FileClose $0
1011 Delete $INSTDIR\uninstall.log
1012 Delete $INSTDIR\uninstall.exe
1013 ; remove empty directories
1014 RMDir $INSTDIR\lib\locale
1015 RMDir $INSTDIR\lib
1016 RMDir $INSTDIR\data
1017 RMDir $INSTDIR\doc
1018 RMDir $INSTDIR\modules
1019 RMDir $INSTDIR\plugins
1020 RMDir $INSTDIR
1021 SetAutoClose false
1022 !endif
1023 SectionEnd ; Uninstall }}}
1024 ; }}}
1026 ; This file has been optimised for use in Vim with folding.
1027 ; (If you can't cope, :set nofoldenable) vim:fen:fdm=marker