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
15
; !define INKSCAPE_VERSION "0.48.4"
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
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
32
!include VersionCompleteXXXX.nsh
37
!define _!redef_${VAR} `${VAL}`
41
!define ${VAR} `${VAL}`
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
58
; FileFunc bits and pieces {{{3
60
!insertmacro GetParameters
61
!insertmacro GetOptions
62
!insertmacro un.GetParent
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
76
; Installer pages {{{5
78
!insertmacro MUI_PAGE_WELCOME
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
88
; InstType "$(Optimal)"
89
; InstType "$(Minimal)"
91
!insertmacro MUI_PAGE_DIRECTORY
93
!insertmacro MUI_PAGE_INSTFILES
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
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...`
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"
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
140
ReserveFile inkscape.nsi.uninstall
141
ReserveFile "${NSISDIR}\Plugins\UserInfo.dll"
142
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
144
; #######################################
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!"
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}` == ``
172
!searchparse /noerrors /file ..\..\.bzr\branch\last-revision "" BZR_REVISION " "
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}
181
!if `${BZR_REVISION}` == ``
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.
188
!undef INKSCAPE_VERSION_NUMBER
189
!searchparse /noerrors ${INKSCAPE_VERSION} "" INKSCAPE_VERSION_NUMBER "pre" PRE_NUMBER
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.
202
; ${!redef} BrandingText `${BrandingText} r${BZR_REVISION}`
204
!if `${RELEASE_REVISION}` != `1`
205
${!redef} BrandingText `${BrandingText}, revision ${RELEASE_REVISION}`
207
!define VERSION_X.X.X.X_REVISION ${RELEASE_REVISION}
209
!define VERSION_X.X.X.X_REVISION 0
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
221
!define FILENAME ${_FILENAME}
224
; Product information {{{3
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
250
!macro delprefs ; Delete preferences (originally from VLC) {{{2
252
DetailPrint "Deleting personal preferences..."
253
DetailPrint "Finding all users..."
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)
258
EnumRegKey $1 HKU "" $0
259
${IfThen} $1 == "" ${|} ${ExitDo} ${|}
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
270
; Sections (these do the work) {{{2
272
Section -removeInkscape ; Hidden, mandatory section to clean a previous installation {{{
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
287
SectionEnd ; -removeInkscape }}}
289
Section $(Core) SecCore ; Mandatory Inkscape core files section {{{
292
DetailPrint "Installing Inkscape core files..."
294
!insertmacro UNINSTALL.LOG_OPEN_INSTALL
298
File /a ..\..\inkscape\ink*.exe
299
File /a ..\..\inkscape\inkscape.com
300
File /a ..\..\inkscape\AUTHORS
301
File /a ..\..\inkscape\COPYING
302
File /a ..\..\inkscape\COPYING.LIB
303
File /a ..\..\inkscape\NEWS
304
File /a ..\..\inkscape\gspawn-win32-helper.exe
305
File /a ..\..\inkscape\gspawn-win32-helper-console.exe
306
File /nonfatal /a ..\..\inkscape\HACKING.txt
307
File /a ..\..\inkscape\README
308
File /nonfatal /a ..\..\inkscape\README.txt
309
File /a ..\..\inkscape\TRANSLATORS
310
File /nonfatal /a /r ..\..\inkscape\data
311
File /nonfatal /a /r ..\..\inkscape\doc
312
File /nonfatal /a /r ..\..\inkscape\plugins
313
File /nonfatal /a /r /x *.??*.???* /x examples /x tutorials ..\..\inkscape\share
314
!insertmacro UNINSTALL.LOG_CLOSE_INSTALL
315
; this files are added because it slips through the filter
316
SetOutPath $INSTDIR\share\clipart
317
!insertmacro UNINSTALL.LOG_OPEN_INSTALL
318
File /a ..\..\inkscape\share\clipart\inkscape.logo.svg
319
!insertmacro UNINSTALL.LOG_CLOSE_INSTALL
320
SetOutPath $INSTDIR\share\icons
321
!insertmacro UNINSTALL.LOG_OPEN_INSTALL
322
File /a ..\..\inkscape\share\icons\inkscape.file.png
323
File /a ..\..\inkscape\share\icons\inkscape.file.svg
324
!insertmacro UNINSTALL.LOG_CLOSE_INSTALL
325
SetOutPath $INSTDIR\modules
326
!insertmacro UNINSTALL.LOG_OPEN_INSTALL
327
File /nonfatal /a /r ..\..\inkscape\modules\*.*
328
!insertmacro UNINSTALL.LOG_CLOSE_INSTALL
329
SetOutPath $INSTDIR\python
330
!insertmacro UNINSTALL.LOG_OPEN_INSTALL
331
File /nonfatal /a /r ..\..\inkscape\python\*.*
332
!insertmacro UNINSTALL.LOG_CLOSE_INSTALL
334
SectionEnd ; SecCore }}}
336
Section $(GTKFiles) SecGTK ; Mandatory GTK files section {{{
339
DetailPrint "Installing GTK files..."
341
!insertmacro UNINSTALL.LOG_OPEN_INSTALL
343
File /a /r ..\..\inkscape\*.dll
344
File /a /r /x locale ..\..\inkscape\lib
345
File /a /r ..\..\inkscape\etc
346
!insertmacro UNINSTALL.LOG_CLOSE_INSTALL
348
SectionEnd ; SecGTK }}}
350
Section -SetCurrentUserOnly ; Set the installation to "current user" only by default {{{
353
SetShellVarContext current
355
SectionEnd ; -SetCurrentUserOnly }}}
357
Section $(Alluser) SecAlluser ; Then offer the user the option to make it global (default) {{{
360
; disable this option in Win95/Win98/WinME
362
DetailPrint "Installing in administrator mode (registry root will be HKLM)"
363
SetShellVarContext all
365
SectionEnd ; SecAllUser }}}
367
SectionGroup "$(Shortcuts)" SecShortcuts ; Create shortcuts for the user {{{
369
Section $(Desktop) SecDesktop ; Desktop shortcut {{{
371
CreateShortCut $DESKTOP\Inkscape.lnk $INSTDIR\inkscape.exe
373
SectionEnd ; SecDesktop }}}
375
Section $(Quicklaunch) SecQuickLaunch ; Quick Launch shortcut {{{
377
${IfThen} $QUICKLAUNCH != $TEMP ${|} CreateShortCut $QUICKLAUNCH\Inkscape.lnk $INSTDIR\inkscape.exe ${|}
379
SectionEnd ; SecQuickLaunch }}}
381
Section $(SVGWriter) SecSVGWriter ; Register Inkscape as the default application for .svg[z] {{{
384
DetailPrint "Associating SVG files with Inkscape"
387
${IfThen} $2 = 1 ${|} StrCpy $3 $3z ${|}
388
ReadRegStr $0 HKCR ".$3" ""
391
WriteRegStr HKCR ".$3" "" $0
392
WriteRegStr HKCR $0 "" "Scalable Vector Graphics file"
394
WriteRegStr HKCR $0\shell\edit\command "" `"$INSTDIR\Inkscape.exe" "%1"`
397
SectionEnd ; SecSVGWriter }}}
399
Section $(ContextMenu) SecContextMenu ; Put Inkscape in the .svg[z] context menus (but not as default) {{{
402
DetailPrint "Adding Inkscape to SVG file context menu"
403
ReadRegStr $0 HKCR .svg ""
406
WriteRegStr HKCR .svg "" $0
407
WriteRegStr HKCR $0 "" "Scalable Vector Graphics file"
409
WriteRegStr HKCR $0\shell\Inkscape\command "" `"$INSTDIR\Inkscape.exe" "%1"`
411
ReadRegStr $0 HKCR .svgz ""
414
WriteRegStr HKCR .svgz "" $0
415
WriteRegStr HKCR $0 "" "Scalable Vector Graphics file"
417
WriteRegStr HKCR $0\shell\Inkscape\command "" `"$INSTDIR\Inkscape.exe" "%1"`
419
SectionEnd ; SecContextMenu }}}
421
SectionGroupEnd ; SecShortcuts }}}
423
Section /o "$(DeletePrefs)" SecPrefs ; Delete user preferences before installation {{{
425
!insertmacro delprefs
427
SectionEnd ; SecPrefs }}}
429
SectionGroup "$(Addfiles)" SecAddfiles ; Additional files {{{
431
Section $(Examples) SecExamples ; Install example SVG files {{{
434
SetOutPath $INSTDIR\share
435
!insertmacro UNINSTALL.LOG_OPEN_INSTALL
436
File /nonfatal /a /r /x *.??*.???* ..\..\inkscape\share\examples
437
!insertmacro UNINSTALL.LOG_CLOSE_INSTALL
439
SectionEnd ; SecExamples }}}
441
Section $(Tutorials) SecTutorials ; Install tutorials {{{
444
SetOutPath $INSTDIR\share
445
!insertmacro UNINSTALL.LOG_OPEN_INSTALL
446
File /nonfatal /a /r /x *.??*.???* ..\..\inkscape\share\tutorials
447
!insertmacro UNINSTALL.LOG_CLOSE_INSTALL
449
SectionEnd ; SecTutorials }}}
451
SectionGroupEnd ; SecAddfiles }}}
453
SectionGroup "$(Languages)" SecLanguages ; Languages sections {{{
454
!macro Language SecName lng ; A macro to create each section {{{
455
Section /o "$(lng_${lng}) (${lng})" Sec${SecName}
459
!insertmacro UNINSTALL.LOG_OPEN_INSTALL
460
File /nonfatal /a ..\..\inkscape\*.${lng}.txt ; FIXME: remove this? No such files.
461
!insertmacro UNINSTALL.LOG_CLOSE_INSTALL
462
SetOutPath $INSTDIR\locale
463
!insertmacro UNINSTALL.LOG_OPEN_INSTALL
464
File /nonfatal /a /r ..\..\inkscape\locale\${lng}
465
!insertmacro UNINSTALL.LOG_CLOSE_INSTALL
466
SetOutPath $INSTDIR\lib\locale
467
!insertmacro UNINSTALL.LOG_OPEN_INSTALL
468
File /nonfatal /a /r ..\..\inkscape\lib\locale\${lng}
469
!insertmacro UNINSTALL.LOG_CLOSE_INSTALL
470
SetOutPath $INSTDIR\share\clipart
471
!insertmacro UNINSTALL.LOG_OPEN_INSTALL
472
File /nonfatal /a /r ..\..\inkscape\share\clipart\*.${lng}.svg
473
!insertmacro UNINSTALL.LOG_CLOSE_INSTALL
474
; the keyboard tables
475
SetOutPath $INSTDIR\share\screens
476
!insertmacro UNINSTALL.LOG_OPEN_INSTALL
477
File /nonfatal /a /r ..\..\inkscape\share\screens\*.${lng}.svg
478
!insertmacro UNINSTALL.LOG_CLOSE_INSTALL
479
SetOutPath $INSTDIR\share\templates
480
!insertmacro UNINSTALL.LOG_OPEN_INSTALL
481
File /nonfatal /a /r ..\..\inkscape\share\templates\*.${lng}.svg
482
!insertmacro UNINSTALL.LOG_CLOSE_INSTALL
483
SetOutPath $INSTDIR\doc
484
!insertmacro UNINSTALL.LOG_OPEN_INSTALL
485
File /nonfatal /a /r ..\..\inkscape\doc\keys.${lng}.xml
486
File /nonfatal /a /r ..\..\inkscape\doc\keys.${lng}.html
487
!insertmacro UNINSTALL.LOG_CLOSE_INSTALL
488
SectionGetFlags ${SecTutorials} $R1
489
IntOp $R1 $R1 & ${SF_SELECTED}
490
${If} $R1 >= ${SF_SELECTED}
491
SetOutPath $INSTDIR\share\tutorials
492
!insertmacro UNINSTALL.LOG_OPEN_INSTALL
493
File /nonfatal /a ..\..\inkscape\share\tutorials\*.${lng}.*
494
!insertmacro UNINSTALL.LOG_CLOSE_INSTALL
498
!macroend ; Language }}}
500
; Now create each section with the Language macro {{{
501
!insertmacro Language Amharic am
502
!insertmacro Language Arabic ar
503
!insertmacro Language Azerbaijani az
504
!insertmacro Language Byelorussian be
505
!insertmacro Language Bulgarian bg
506
!insertmacro Language Bengali bn
507
!insertmacro Language Breton br
508
!insertmacro Language Catalan ca
509
!insertmacro Language CatalanValencia ca@valencia
510
!insertmacro Language Czech cs
511
!insertmacro Language Danish da
512
!insertmacro Language German de
513
!insertmacro Language Dzongkha dz
514
!insertmacro Language Greek el
515
!insertmacro Language EnglishAustralian en_AU
516
!insertmacro Language EnglishCanadian en_CA
517
!insertmacro Language EnglishBritain en_GB
518
!insertmacro Language EnglishPiglatin en_US@piglatin
519
!insertmacro Language Esperanto eo
520
!insertmacro Language Spanish es
521
!insertmacro Language SpanishMexico es_MX
522
!insertmacro Language Estonian et
523
!insertmacro Language Basque eu
524
!insertmacro Language Farsi fa
525
!insertmacro Language French fr
526
!insertmacro Language Finnish fi
527
!insertmacro Language Irish ga
528
!insertmacro Language Galician gl
529
!insertmacro Language Hebrew he
530
!insertmacro Language Croatian hr
531
!insertmacro Language Hungarian hu
532
!insertmacro Language Indonesian id
533
!insertmacro Language Italian it
534
!insertmacro Language Japanese ja
535
!insertmacro Language Khmer km
536
!insertmacro Language Korean ko
537
!insertmacro Language Lithuanian lt
538
!insertmacro Language Mongolian mn
539
!insertmacro Language Macedonian mk
540
!insertmacro Language NorwegianBokmal nb
541
!insertmacro Language Nepali ne
542
!insertmacro Language Dutch nl
543
!insertmacro Language NorwegianNynorsk nn
544
!insertmacro Language Panjabi pa
545
!insertmacro Language Polish pl
546
!insertmacro Language Portuguese pt
547
!insertmacro Language PortugueseBrazil pt_BR
548
!insertmacro Language Romanian ro
549
!insertmacro Language Russian ru
550
!insertmacro Language Kinyarwanda rw
551
!insertmacro Language Slovak sk
552
!insertmacro Language Slovenian sl
553
!insertmacro Language Albanian sq
554
!insertmacro Language Serbian sr
555
!insertmacro Language SerbianLatin sr@latin
556
!insertmacro Language Swedish sv
557
!insertmacro Language Telugu te_IN
558
!insertmacro Language Thai th
559
!insertmacro Language Turkish tr
560
!insertmacro Language Ukrainian uk
561
!insertmacro Language Vietnamese vi
562
!insertmacro Language SimpChinese zh_CN
563
!insertmacro Language TradChinese zh_TW
565
SectionGroupEnd ; SecLanguages }}}
567
Section -FinalizeInstallation ; Hidden, mandatory section to finalize installation {{{
569
DetailPrint "Finalizing installation"
570
${IfThen} $MultiUser = 1 ${|} SetShellVarContext all ${|}
571
${IfThen} $MultiUser != 1 ${|} SetShellVarContext current ${|}
573
WriteRegStr SHCTX "${INSTDIR_KEY}" "" $INSTDIR\inkscape.exe
574
WriteRegStr SHCTX "${INSTDIR_KEY}" MultiUser $MultiUser
575
WriteRegStr SHCTX "${INSTDIR_KEY}" askMultiUser $askMultiUser
576
WriteRegStr SHCTX "${INSTDIR_KEY}" User $User
579
CreateShortcut $SMPROGRAMS\Inkscape.lnk $INSTDIR\inkscape.exe
582
; WriteUninstaller $INSTDIR\uninst.exe
583
WriteRegExpandStr SHCTX "${UNINST_KEY}" UninstallString ${UNINST_EXE}
584
WriteRegExpandStr SHCTX "${UNINST_KEY}" InstallDir $INSTDIR
585
WriteRegExpandStr SHCTX "${UNINST_KEY}" InstallLocation $INSTDIR
586
WriteRegStr SHCTX "${UNINST_KEY}" DisplayName "Inkscape ${INKSCAPE_VERSION}"
587
WriteRegStr SHCTX "${UNINST_KEY}" DisplayIcon $INSTDIR\Inkscape.exe,0
588
WriteRegStr SHCTX "${UNINST_KEY}" DisplayVersion ${INKSCAPE_VERSION}
589
WriteRegDWORD SHCTX "${UNINST_KEY}" NoModify 1
590
WriteRegDWORD SHCTX "${UNINST_KEY}" NoRepair 1
592
;create/update log always within .onInstSuccess function
593
!insertmacro UNINSTALL.LOG_UPDATE_INSTALL
595
DetailPrint "Creating MD5 checksums"
597
FileOpen $0 $INSTDIR\Uninstall.dat r
598
FileOpen $9 $INSTDIR\Uninstall.log w
603
${IfThen} ${Errors} ${|} ${ExitDo} ${|}
605
md5dll::GetMD5File /NOUNLOAD $1
607
${IfThen} $2 != "" ${|} FileWrite $9 "$2 $1$\r$\n" ${|}
612
; Not needed any more
613
Delete $INSTDIR\Uninstall.dat
615
SectionEnd ; -FinalizeInstallation }}}
617
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN ; Section descriptions {{{
618
!insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "$(CoreDesc)"
619
!insertmacro MUI_DESCRIPTION_TEXT ${SecGTK} "$(GTKFilesDesc)"
620
!insertmacro MUI_DESCRIPTION_TEXT ${SecShortcuts} "$(ShortcutsDesc)"
621
!insertmacro MUI_DESCRIPTION_TEXT ${SecAlluser} "$(AlluserDesc)"
622
!insertmacro MUI_DESCRIPTION_TEXT ${SecDesktop} "$(DesktopDesc)"
623
!insertmacro MUI_DESCRIPTION_TEXT ${SecQuicklaunch} "$(QuicklaunchDesc)"
624
!insertmacro MUI_DESCRIPTION_TEXT ${SecSVGWriter} "$(SVGWriterDesc)"
625
!insertmacro MUI_DESCRIPTION_TEXT ${SecContextMenu} "$(ContextMenuDesc)"
626
!insertmacro MUI_DESCRIPTION_TEXT ${SecPrefs} "$(DeletePrefsDesc)"
627
!insertmacro MUI_DESCRIPTION_TEXT ${SecAddfiles} "$(AddfilesDesc)"
628
!insertmacro MUI_DESCRIPTION_TEXT ${SecExamples} "$(ExamplesDesc)"
629
!insertmacro MUI_DESCRIPTION_TEXT ${SecTutorials} "$(TutorialsDesc)"
630
!insertmacro MUI_DESCRIPTION_TEXT ${SecLanguages} "$(LanguagesDesc)"
631
!insertmacro MUI_FUNCTION_DESCRIPTION_END ; Section descriptions }}}
634
Function .onInit ; initialise the installer {{{2
635
; This code will be executed before the sections, but due to the
636
; language code in the sections it must come after it in the code.
638
; Language detection {{{
639
!insertmacro MUI_LANGDLL_DISPLAY
641
!macro LanguageAutoSelect SecName LocaleID
642
${If} $LANGUAGE = ${LocaleID}
643
SectionGetFlags ${Sec${SecName}} $0
644
IntOp $0 $0 | ${SF_SELECTED}
645
SectionSetFlags ${Sec${SecName}} $0
649
; No need for English to be detected as it's the default
650
!insertmacro LanguageAutoSelect Breton 1150
651
!insertmacro LanguageAutoSelect Catalan 1027
652
!insertmacro LanguageAutoSelect Czech 1029
653
!insertmacro LanguageAutoSelect Dutch 1043
654
!insertmacro LanguageAutoSelect Finnish 1035
655
!insertmacro LanguageAutoSelect French 1036
656
!insertmacro LanguageAutoSelect Galician 1110
657
!insertmacro LanguageAutoSelect German 1031
658
!insertmacro LanguageAutoSelect Indonesian 1057
659
!insertmacro LanguageAutoSelect Italian 1040
660
!insertmacro LanguageAutoSelect Japanese 1041
661
!insertmacro LanguageAutoSelect Polish 1045
662
!insertmacro LanguageAutoSelect Romanian 1048
663
!insertmacro LanguageAutoSelect Russian 1049
664
!insertmacro LanguageAutoSelect Slovak 1051
665
!insertmacro LanguageAutoSelect Slovenian 1060
666
!insertmacro LanguageAutoSelect Spanish 1034
667
!insertmacro LanguageAutoSelect SimpChinese 2052
668
!insertmacro LanguageAutoSelect TradChinese 1028
669
!insertmacro LanguageAutoSelect Ukrainian 1058
670
; End of language detection }}}
672
!insertmacro UNINSTALL.LOG_PREPARE_INSTALL ; prepare advanced uninstallation log script
674
;Extract InstallOptions INI files
675
StrCpy $AskMultiUser 1
677
; this resets AskMultiUser if Win95/98/ME
679
ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
681
ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion" VersionNumber
683
${IfThen} $R0 = 4 ${|} StrCpy $AskMultiUser 0 ${|}
686
; hide all user section if ME/9x
687
${IfThen} $AskMultiUser != 1 ${|} SectionSetText ${SecAlluser} "" ${|}
689
; hide if quick launch if not available
690
${IfThen} $QUICKLAUNCH == $TEMP ${|} SectionSetText ${SecQuicklaunch} "" ${|}
692
; Check for administrative privileges {{{
696
; This one means you don't need to care about admin or
697
; not admin because Windows 9x doesn't either
698
${IfCmd} MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "$(NOT_SUPPORTED)$(OK_CANCEL_DESC)" /SD IDOK IDCANCEL ${||} Quit ${|}
701
UserInfo::GetAccountType
704
${AndIf} ${Cmd} ${|} MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "$(NO_ADMIN)$(OK_CANCEL_DESC)" /SD IDOK IDCANCEL ${|}
709
; Detect an Inkscape installation by another user {{{
710
ReadRegStr $0 HKLM "${INSTDIR_KEY}" User ; first global...
711
${IfThen} $0 == "" ${|} ReadRegStr $0 HKCU "${INSTDIR_KEY}" User ${|} ; then current user
714
${AndIf} ${Cmd} ${|} MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "$(DIFFERENT_USER)$(OK_CANCEL_DESC)" /SD IDOK IDCANCEL ${|}
718
; Request uninstallation of an old Inkscape installation {{{
719
ReadRegStr $R0 HKLM "${UNINST_KEY}" UninstallString
720
${IfThen} $R0 == "" ${|} ReadRegStr $R0 HKCU "${UNINST_KEY}" UninstallString ${|}
722
${AndIf} ${Cmd} ${|} MessageBox MB_YESNO|MB_ICONEXCLAMATION "$(WANT_UNINSTALL_BEFORE)" /SD IDNO IDYES ${|}
726
; Process command-line arguments (for automation) {{{
727
!echo `Creating code to process command-line arguments...`
730
${GetParameters} $CMDARGS
732
!macro Parameter key Section
733
${GetOptions} $CMDARGS /${key}= $1
735
SectionGetFlags ${Section} $0
736
IntOp $2 ${SF_SELECTED} ~
738
SectionSetFlags ${Section} $0
741
SectionGetFlags ${Section} $0
742
IntOp $0 $0 | ${SF_SELECTED}
743
SectionSetFlags ${Section} $0
747
!insertmacro Parameter GTK ${SecGTK}
748
!insertmacro Parameter SHORTCUTS ${secShortcuts}
749
!insertmacro Parameter ALLUSER ${SecAlluser}
750
!insertmacro Parameter DESKTOP ${SecDesktop}
751
!insertmacro Parameter QUICKLAUNCH ${SecQUICKlaunch}
752
!insertmacro Parameter SVGEDITOR ${SecSVGWriter}
753
!insertmacro Parameter CONTEXTMENUE ${SecContextMenu}
754
!insertmacro Parameter PREFERENCES ${SecPrefs}
755
!insertmacro Parameter ADDFILES ${SecAddfiles}
756
!insertmacro Parameter EXAMPLES ${SecExamples}
757
!insertmacro Parameter TUTORIALS ${SecTutorials}
758
!insertmacro Parameter LANGUAGES ${SecLanguages}
759
!insertmacro Parameter am ${SecAmharic}
760
!insertmacro Parameter ar ${SecArabic}
761
!insertmacro Parameter az ${SecAzerbaijani}
762
!insertmacro Parameter be ${SecByelorussian}
763
!insertmacro Parameter bg ${SecBulgarian}
764
!insertmacro Parameter bn ${SecBengali}
765
!insertmacro Parameter br ${SecBreton}
766
!insertmacro Parameter ca ${SecCatalan}
767
!insertmacro Parameter ca@valencia ${SecCatalanValencia}
768
!insertmacro Parameter cs ${SecCzech}
769
!insertmacro Parameter da ${SecDanish}
770
!insertmacro Parameter de ${SecGerman}
771
!insertmacro Parameter dz ${SecDzongkha}
772
!insertmacro Parameter el ${SecGreek}
773
!insertmacro Parameter en_AU ${SecEnglishAustralian}
774
!insertmacro Parameter en_CA ${SecEnglishCanadian}
775
!insertmacro Parameter en_GB ${SecEnglishBritain}
776
!insertmacro Parameter en_US@piglatin ${SecEnglishPiglatin}
777
!insertmacro Parameter eo ${SecEsperanto}
778
!insertmacro Parameter es ${SecSpanish}
779
!insertmacro Parameter es_MX ${SecSpanishMexico}
780
!insertmacro Parameter et ${SecEstonian}
781
!insertmacro Parameter eu ${SecBasque}
782
!insertmacro Parameter fa ${SecFarsi}
783
!insertmacro Parameter fi ${SecFinnish}
784
!insertmacro Parameter fr ${SecFrench}
785
!insertmacro Parameter ga ${SecIrish}
786
!insertmacro Parameter gl ${SecGalician}
787
!insertmacro Parameter he ${SecHebrew}
788
!insertmacro Parameter hr ${SecCroatian}
789
!insertmacro Parameter hu ${SecHungarian}
790
!insertmacro Parameter id ${SecIndonesian}
791
!insertmacro Parameter it ${SecItalian}
792
!insertmacro Parameter ja ${SecJapanese}
793
!insertmacro Parameter km ${SecKhmer}
794
!insertmacro Parameter ko ${SecKorean}
795
!insertmacro Parameter lt ${SecLithuanian}
796
!insertmacro Parameter mk ${SecMacedonian}
797
!insertmacro Parameter mn ${SecMongolian}
798
!insertmacro Parameter nb ${SecNorwegianBokmal}
799
!insertmacro Parameter ne ${SecNepali}
800
!insertmacro Parameter nl ${SecDutch}
801
!insertmacro Parameter nn ${SecNorwegianNynorsk}
802
!insertmacro Parameter pa ${SecPanjabi}
803
!insertmacro Parameter pl ${SecPolish}
804
!insertmacro Parameter pt ${SecPortuguese}
805
!insertmacro Parameter pt_BR ${SecPortugueseBrazil}
806
!insertmacro Parameter ro ${SecRomanian}
807
!insertmacro Parameter ru ${SecRussian}
808
!insertmacro Parameter rw ${SecKinyarwanda}
809
!insertmacro Parameter sk ${SecSlovak}
810
!insertmacro Parameter sl ${SecSlovenian}
811
!insertmacro Parameter sq ${SecAlbanian}
812
!insertmacro Parameter sr ${SecSerbian}
813
!insertmacro Parameter sr@latin ${SecSerbianLatin}
814
!insertmacro Parameter sv ${SecSwedish}
815
!insertmacro Parameter te_IN ${SecTelugu}
816
!insertmacro Parameter th ${SecThai}
817
!insertmacro Parameter tr ${SecTurkish}
818
!insertmacro Parameter uk ${SecUkrainian}
819
!insertmacro Parameter vi ${SecVietnamese}
820
!insertmacro Parameter zh_CN ${SecSimpChinese}
821
!insertmacro Parameter zh_TW ${SecTradChinese}
824
${GetOptions} $CMDARGS /? $1
826
MessageBox MB_OK "Possible parameters for installer:$\r$\n \
827
/?: this help screen$\r$\n \
829
/D=(directory): where to install Inkscape$\r$\n \
830
/GTK=(OFF/ON): GTK+ Runtime environment$\r$\n \
831
/SHORTCUTS=(OFF/ON): shortcuts to start Inkscape$\r$\n \
832
/ALLUSER=(OFF/ON): for all users on the computer$\r$\n \
833
/DESKTOP=(OFF/ON): Desktop icon$\r$\n \
834
/QUICKLAUNCH=(OFF/ON): quick launch icon$\r$\n \
835
/SVGEDITOR=(OFF/ON): default SVG editor$\r$\n \
836
/CONTEXTMENUE=(OFF/ON): context menue integration$\r$\n \
837
/PREFERENCES=(OFF/ON): delete users preference files$\r$\n \
838
/ADDFILES=(OFF/ON): additional files$\r$\n \
839
/EXAMPLES=(OFF/ON): examples$\r$\n \
840
/TUTORIALS=(OFF/ON): tutorials$\r$\n \
841
/LANGUAGES=(OFF/ON): translated menues, examples, etc.$\r$\n \
842
/[locale code]=(OFF/ON): e.g am, es, es_MX as in Inkscape supported"
846
FunctionEnd ; .onInit }}}
847
; Uninstaller code {{{1
848
Function un.onInit ; initialise uninstaller {{{
849
;begin uninstall, could be added on top of uninstall section instead
850
;!insertmacro UNINSTALL.LOG_BEGIN_UNINSTALL
851
${IfNot} ${FileExists} $INSTDIR\uninstall.log
852
MessageBox MB_OK|MB_ICONEXCLAMATION "$(UninstallLogNotFound)" /SD IDOK
862
StrCpy $askMultiUser 1
865
; Test if this was a multiuser installation
866
ReadRegStr $0 HKLM "${INSTDIR_KEY}" ""
867
${If} $0 == $INSTDIR\inkscape.exe
868
ReadRegStr $MultiUser HKLM "${INSTDIR_KEY}" MultiUser
869
ReadRegStr $askMultiUser HKLM "${INSTDIR_KEY}" askMultiUser
870
ReadRegStr $0 HKLM "${INSTDIR_KEY}" User
872
ReadRegStr $MultiUser HKCU "${INSTDIR_KEY}" MultiUser
873
ReadRegStr $askMultiUser HKCU "${INSTDIR_KEY}" askMultiUser
874
ReadRegStr $0 HKCU "${INSTDIR_KEY}" User
876
;check user if applicable
879
${AndIf} ${Cmd} ${|} MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "$(DIFFERENT_USER)$(OK_CANCEL_DESC)" /SD IDOK IDCANCEL ${|}
883
!insertmacro MUI_INSTALLOPTIONS_EXTRACT inkscape.nsi.uninstall
885
SetShellVarContext all
886
${IfThen} $MultiUser = 0 ${|} SetShellVarContext current ${|}
887
FunctionEnd ; un.onInit }}}
889
Function un.CustomPageUninstall ; {{{
890
!insertmacro MUI_HEADER_TEXT "$(UInstOpt)" "$(UInstOpt1)"
891
!insertmacro MUI_INSTALLOPTIONS_WRITE inkscape.nsi.uninstall "Field 1" Text "$APPDATA\Inkscape\"
892
!insertmacro MUI_INSTALLOPTIONS_WRITE inkscape.nsi.uninstall "Field 2" Text "$(PurgePrefs)"
893
!insertmacro MUI_INSTALLOPTIONS_DISPLAY inkscape.nsi.uninstall
894
!insertmacro MUI_INSTALLOPTIONS_READ $MultiUser inkscape.nsi.uninstall "Field 2" State
895
FunctionEnd ; un.CustomPageUninstall }}}
897
Section Uninstall ; do the uninstalling {{{
899
; remove personal settings
900
Delete $APPDATA\Inkscape\extension-errors.log
902
DetailPrint "Purging personal settings in $APPDATA\Inkscape"
903
;RMDir /r $APPDATA\Inkscape
904
!insertmacro delprefs
907
; Remove file associations for svg editor
910
${IfThen} $2 = 1 ${|} StrCpy $3 $3z ${|}
911
DetailPrint "Removing file associations for $3 editor"
913
ReadRegStr $0 HKCR .$3 ""
915
ReadRegStr $1 HKCR $0\shell\edit\command ""
916
${If} $1 == `"$INSTDIR\Inkscape.exe" "%1"`
917
DeleteRegKey HKCR $0\shell\edit\command
921
ReadRegStr $1 HKCR $0\shell\open\command ""
922
${If} $1 == `"$INSTDIR\Inkscape.exe" "%1"`
923
DeleteRegKey HKCR $0\shell\open\command
926
DeleteRegKey HKCR $0\shell\Inkscape
927
DeleteRegKey /ifempty HKCR $0\shell\edit
928
DeleteRegKey /ifempty HKCR $0\shell\open
929
DeleteRegKey /ifempty HKCR $0\shell
930
DeleteRegKey /ifempty HKCR $0
931
DeleteRegKey /ifempty HKCR .$3
935
SetShellVarContext all
936
DeleteRegKey SHCTX "${INSTDIR_KEY}"
937
DeleteRegKey SHCTX "${UNINST_KEY}"
938
Delete $DESKTOP\Inkscape.lnk
939
Delete $QUICKLAUNCH\Inkscape.lnk
940
Delete $SMPROGRAMS\Inkscape.lnk
941
;just in case they are still there
942
Delete "$SMPROGRAMS\Inkscape\Uninstall Inkscape.lnk"
943
Delete $SMPROGRAMS\Inkscape\Inkscape.lnk
944
RMDir $SMPROGRAMS\Inkscape
946
SetShellVarContext current
947
DeleteRegKey SHCTX "${INSTDIR_KEY}"
948
DeleteRegKey SHCTX "${UNINST_KEY}"
949
Delete $DESKTOP\Inkscape.lnk
950
Delete $QUICKLAUNCH\Inkscape.lnk
951
Delete $SMPROGRAMS\Inkscape.lnk
952
;just in case they are still there
953
Delete "$SMPROGRAMS\Inkscape\Uninstall Inkscape.lnk"
954
Delete $SMPROGRAMS\Inkscape\Inkscape.lnk
955
RMDir $SMPROGRAMS\Inkscape
958
SetPluginUnload manual
961
FileOpen $0 $INSTDIR\uninstall.log r
962
${If} ${Errors} ;else uninstallnotfound
963
MessageBox MB_OK|MB_ICONEXCLAMATION "$(UninstallLogNotFound)" /SD IDOK
968
${IfThen} ${Errors} ${|} ${ExitDo} ${|}
969
; cat the line into md5 and filename
971
${IfThen} $2 <= 35 ${|} ${Continue} ${|}
973
StrCpy $filename $1 $2-36 34 ;remove trailing CR/LF
974
StrCpy $filename $filename -2
975
; $3 = MD5 when installed, then deletion choice
978
; $6 = always/never remove files touched by user
980
${If} ${FileExists} $filename
984
md5dll::GetMD5File /NOUNLOAD $filename
988
${ElseIf} $6 != never
989
; the md5 sums does not match so we ask
990
messagebox::show MB_DEFBUTTON3|MB_TOPMOST "" 0,103 \
991
"$(FileChanged)" "$(Yes)" "$(AlwaysYes)" "$(No)" "$(AlwaysNo)"
993
${IfThen} $3 = 2 ${|} StrCpy $6 always ${|}
994
${IfThen} $3 = 4 ${|} StrCpy $6 never ${|}
999
${OrIf} $3 = 2 ; always
1003
;now recursivly remove the path
1006
${un.GetParent} $filename $filename
1007
${IfThen} ${Errors} ${|} ${ExitDo} ${|}
1009
${IfThen} ${Errors} ${|} ${ExitDo} ${|}
1016
Delete $INSTDIR\uninstall.log
1017
Delete $INSTDIR\uninstall.exe
1018
; remove empty directories
1019
RMDir $INSTDIR\lib\locale
1023
RMDir $INSTDIR\modules
1024
RMDir $INSTDIR\plugins
1028
SectionEnd ; Uninstall }}}
1031
; This file has been optimised for use in Vim with folding.
1032
; (If you can't cope, :set nofoldenable) vim:fen:fdm=marker