42ab4e7b5accb206bd857e24ba479fa732742198
1 ; #######################################
2 ; Inkscape NSIS installer project file
3 ; Used as of 0.40
4 ; #######################################
6 ; #######################################
7 ; DEFINES
8 ; #######################################
9 !define PRODUCT_NAME "Inkscape"
10 !define PRODUCT_VERSION "0.43+devel"
11 !define PRODUCT_PUBLISHER "Inkscape Organization"
12 !define PRODUCT_WEB_SITE "http://www.inkscape.org"
13 !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\inkscape.exe"
14 !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
18 ; #######################################
19 ; MUI SETTINGS
20 ; #######################################
21 ; MUI 1.67 compatible ------
22 SetCompressor /SOLID lzma
23 !include "MUI.nsh"
24 !include "sections.nsh"
25 !define MUI_ABORTWARNING
26 !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
27 !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
28 !define MUI_HEADERIMAGE
29 !define MUI_HEADERIMAGE_BITMAP "header.bmp"
30 !define MUI_COMPONENTSPAGE_SMALLDESC
33 ; Welcome page
34 !insertmacro MUI_PAGE_WELCOME
35 ; License page
36 ; !define MUI_LICENSEPAGE_RADIOBUTTONS
37 LicenseForceSelection off
38 !define MUI_LICENSEPAGE_BUTTON $(lng_LICENSE_BUTTON)
39 !define MUI_LICENSEPAGE_TEXT_BOTTOM $(lng_LICENSE_BOTTOM_TEXT)
40 !insertmacro MUI_PAGE_LICENSE "..\..\Copying"
41 !insertmacro MUI_PAGE_COMPONENTS
42 ; InstType $(lng_Full)
43 ; InstType $(lng_Optimal)
44 ; InstType $(lng_Minimal)
45 ; Directory page
46 !insertmacro MUI_PAGE_DIRECTORY
47 ; Instfiles page
48 !insertmacro MUI_PAGE_INSTFILES
49 ; Finish page
50 !define MUI_FINISHPAGE_RUN "$INSTDIR\inkscape.exe"
51 !insertmacro MUI_PAGE_FINISH
53 ; Uninstaller pages
54 !insertmacro MUI_UNPAGE_CONFIRM
55 UninstPage custom un.CustomPageUninstall
56 !insertmacro MUI_UNPAGE_INSTFILES
57 ShowUninstDetails hide
58 !insertmacro MUI_UNPAGE_FINISH
60 ; #######################################
61 ; STRING LOCALIZATION
62 ; #######################################
63 ; Thanks to Adib Taraben and Luca Bruno for getting this started
64 ; Add your translation here! :-)
65 ; I had wanted to list the languages alphabetically, but apparently
66 ; the first is the default. So putting English first is just being
67 ; practical. It is not chauvinism or hubris, I swear! ;-)
68 ; default language first
70 ; Language files
71 !include "english.nsh"
72 ;!include "catalan.nsh"
73 !include "czech.nsh"
74 ;!include "french.nsh"
75 !include "german.nsh"
76 !include "italian.nsh"
77 ;!include "polish.nsh"
79 ReserveFile "inkscape.nsi.uninstall"
82 ; #######################################
83 ; SETTINGS
84 ; #######################################
86 Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
87 Caption $(lng_Caption)
88 OutFile "Inkscape-${PRODUCT_VERSION}-1.win32.exe"
89 InstallDir "$PROGRAMFILES\Inkscape"
90 InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
91 ShowInstDetails hide
92 ShowUnInstDetails hide
94 var askMultiUser
95 Var MultiUser
97 ; #######################################
98 ; I N S T A L L E R S E C T I O N S
99 ; #######################################
101 ; Turn off old selected section
102 ; GetWindowsVersion
103 ;
104 ; Based on Yazno's function, http://yazno.tripod.com/powerpimpit/
105 ; Updated by Joost Verburg
106 ; Updated for Windows 98 SE by Matthew Win Tibbals 5-21-03
107 ;
108 ; Returns on top of stack
109 ;
110 ; Windows Version (95, 98, ME, NT x.x, 2000, XP, 2003)
111 ; or
112 ; '' (Unknown Windows Version)
113 ;
114 ; Usage:
115 ; Call GetWindowsVersion
116 ; Pop $R0
117 ; ; at this point $R0 is "NT 4.0" or whatnot
118 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
119 Function GetWindowsVersion
121 Push $R0
122 Push $R1
124 ClearErrors
126 ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
128 IfErrors 0 lbl_winnt
130 ; we are not NT
131 ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion" VersionNumber
133 StrCpy $R1 $R0 1
134 StrCmp $R1 '4' 0 lbl_error
136 StrCpy $R1 $R0 3
138 StrCmp $R1 '4.0' lbl_win32_95
139 StrCmp $R1 '4.9' lbl_win32_ME lbl_win32_98
141 lbl_win32_95:
142 StrCpy $R0 '95'
143 StrCpy $AskMultiUser "0"
144 Goto lbl_done
146 lbl_win32_98:
147 StrCpy $R0 '98'
148 StrCpy $AskMultiUser "0"
149 Goto lbl_done
150 lbl_win32_ME:
151 StrCpy $R0 'ME'
152 StrCpy $AskMultiUser "0"
153 Goto lbl_done
155 lbl_winnt:
157 StrCpy $R1 $R0 1
159 StrCmp $R1 '3' lbl_winnt_x
160 StrCmp $R1 '4' lbl_winnt_x
162 StrCpy $R1 $R0 3
164 StrCmp $R1 '5.0' lbl_winnt_2000
165 StrCmp $R1 '5.1' lbl_winnt_XP
166 StrCmp $R1 '5.2' lbl_winnt_2003 lbl_error
168 lbl_winnt_x:
169 StrCpy $R0 "NT $R0" 6
170 Goto lbl_done
172 lbl_winnt_2000:
173 Strcpy $R0 '2000'
174 Goto lbl_done
176 lbl_winnt_XP:
177 Strcpy $R0 'XP'
178 Goto lbl_done
180 lbl_winnt_2003:
181 Strcpy $R0 '2003'
182 Goto lbl_done
184 lbl_error:
185 Strcpy $R0 ''
186 lbl_done:
188 Pop $R1
189 Exch $R0
191 FunctionEnd
193 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
195 ; StrStr
196 ; input, top of stack = string to search for
197 ; top of stack-1 = string to search in
198 ; output, top of stack (replaces with the portion of the string remaining)
199 ; modifies no other variables.
200 ;
201 ; Usage:
202 ; Push "this is a long ass string"
203 ; Push "ass"
204 ; Call StrStr
205 ; Pop $R0
206 ; ($R0 at this point is "ass string")
208 Function StrStr
209 Exch $R1 ; st=haystack,old$R1, $R1=needle
210 Exch ; st=old$R1,haystack
211 Exch $R2 ; st=old$R1,old$R2, $R2=haystack
212 Push $R3
213 Push $R4
214 Push $R5
215 StrLen $R3 $R1
216 StrCpy $R4 0
217 ; $R1=needle
218 ; $R2=haystack
219 ; $R3=len(needle)
220 ; $R4=cnt
221 ; $R5=tmp
222 loop:
223 StrCpy $R5 $R2 $R3 $R4
224 StrCmp $R5 $R1 done
225 StrCmp $R5 "" done
226 IntOp $R4 $R4 + 1
227 Goto loop
228 done:
229 StrCpy $R1 $R2 "" $R4
230 Pop $R5
231 Pop $R4
232 Pop $R3
233 Pop $R2
234 Exch $R1
235 FunctionEnd
237 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
239 ; GetParameters
240 ; input, none
241 ; output, top of stack (replaces, with e.g. whatever)
242 ; modifies no other variables.
244 Function GetParameters
246 Push $R0
247 Push $R1
248 Push $R2
249 Push $R3
251 StrCpy $R2 1
252 StrLen $R3 $CMDLINE
254 ;Check for quote or space
255 StrCpy $R0 $CMDLINE $R2
256 StrCmp $R0 '"' 0 +3
257 StrCpy $R1 '"'
258 Goto loop
259 StrCpy $R1 " "
261 loop:
262 IntOp $R2 $R2 + 1
263 StrCpy $R0 $CMDLINE 1 $R2
264 StrCmp $R0 $R1 get
265 StrCmp $R2 $R3 get
266 Goto loop
268 get:
269 IntOp $R2 $R2 + 1
270 StrCpy $R0 $CMDLINE 1 $R2
271 StrCmp $R0 " " get
272 StrCpy $R0 $CMDLINE "" $R2
274 Pop $R3
275 Pop $R2
276 Pop $R1
277 Exch $R0
279 FunctionEnd
281 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
282 ; GetParameterValue
283 ; Chris Morgan<cmorgan@alum.wpi.edu> 5/10/2004
284 ; -Updated 4/7/2005 to add support for retrieving a command line switch
285 ; and additional documentation
286 ;
287 ; Searches the command line input, retrieved using GetParameters, for the
288 ; value of an option given the option name. If no option is found the
289 ; default value is placed on the top of the stack upon function return.
290 ;
291 ; This function can also be used to detect the existence of just a
292 ; command line switch like /OUTPUT Pass the default and "OUTPUT"
293 ; on the stack like normal. An empty return string "" will indicate
294 ; that the switch was found, the default value indicates that
295 ; neither a parameter or switch was found.
296 ;
297 ; Inputs - Top of stack is default if parameter isn't found,
298 ; second in stack is parameter to search for, ex. "OUTPUT"
299 ; Outputs - Top of the stack contains the value of this parameter
300 ; So if the command line contained /OUTPUT=somedirectory, "somedirectory"
301 ; will be on the top of the stack when this function returns
302 ;
303 ; Register usage
304 ;$R0 - default return value if the parameter isn't found
305 ;$R1 - input parameter, for example OUTPUT from the above example
306 ;$R2 - the length of the search, this is the search parameter+2
307 ; as we have '/OUTPUT='
308 ;$R3 - the command line string
309 ;$R4 - result from StrStr calls
310 ;$R5 - search for ' ' or '"'
312 Function GetParameterValue
313 Exch $R0 ; get the top of the stack(default parameter) into R0
314 Exch ; exchange the top of the stack(default) with
315 ; the second in the stack(parameter to search for)
316 Exch $R1 ; get the top of the stack(search parameter) into $R1
318 ;Preserve on the stack the registers used in this function
319 Push $R2
320 Push $R3
321 Push $R4
322 Push $R5
324 Strlen $R2 $R1+2 ; store the length of the search string into R2
326 Call GetParameters ; get the command line parameters
327 Pop $R3 ; store the command line string in R3
329 # search for quoted search string
330 StrCpy $R5 '"' ; later on we want to search for a open quote
331 Push $R3 ; push the 'search in' string onto the stack
332 Push '"/$R1=' ; push the 'search for'
333 Call StrStr ; search for the quoted parameter value
334 Pop $R4
335 StrCpy $R4 $R4 "" 1 ; skip over open quote character, "" means no maxlen
336 StrCmp $R4 "" "" next ; if we didn't find an empty string go to next
338 # search for non-quoted search string
339 StrCpy $R5 ' ' ; later on we want to search for a space since we
340 ; didn't start with an open quote '"' we shouldn't
341 ; look for a close quote '"'
342 Push $R3 ; push the command line back on the stack for searching
343 Push '/$R1=' ; search for the non-quoted search string
344 Call StrStr
345 Pop $R4
347 ; $R4 now contains the parameter string starting at the search string,
348 ; if it was found
349 next:
350 StrCmp $R4 "" check_for_switch ; if we didn't find anything then look for
351 ; usage as a command line switch
352 # copy the value after /$R1= by using StrCpy with an offset of $R2,
353 # the length of '/OUTPUT='
354 StrCpy $R0 $R4 "" $R2 ; copy commandline text beyond parameter into $R0
355 # search for the next parameter so we can trim this extra text off
356 Push $R0
357 Push $R5 ; search for either the first space ' ', or the first
358 ; quote '"'
359 ; if we found '"/output' then we want to find the
360 ; ending ", as in '"/output=somevalue"'
361 ; if we found '/output' then we want to find the first
362 ; space after '/output=somevalue'
363 Call StrStr ; search for the next parameter
364 Pop $R4
365 StrCmp $R4 "" done ; if 'somevalue' is missing, we are done
366 StrLen $R4 $R4 ; get the length of 'somevalue' so we can copy this
367 ; text into our output buffer
368 StrCpy $R0 $R0 -$R4 ; using the length of the string beyond the value,
369 ; copy only the value into $R0
370 goto done ; if we are in the parameter retrieval path skip over
371 ; the check for a command line switch
373 ; See if the parameter was specified as a command line switch, like '/output'
374 check_for_switch:
375 Push $R3 ; push the command line back on the stack for searching
376 Push '/$R1' ; search for the non-quoted search string
377 Call StrStr
378 Pop $R4
379 StrCmp $R4 "" done ; if we didn't find anything then use the default
380 StrCpy $R0 "" ; otherwise copy in an empty string since we found the
381 ; parameter, just didn't find a value
383 done:
384 Pop $R5
385 Pop $R4
386 Pop $R3
387 Pop $R2
388 Pop $R1
389 Exch $R0 ; put the value in $R0 at the top of the stack
390 FunctionEnd
392 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
394 !macro Language polng lng
395 SectionIn 1 2 3
396 SetOutPath $INSTDIR
397 File /nonfatal /a "..\..\inkscape\*.${lng}.txt"
398 SetOutPath $INSTDIR\locale
399 File /nonfatal /a /r "..\..\inkscape\locale\${polng}"
400 SetOutPath $INSTDIR\lib\locale
401 File /nonfatal /a /r "..\..\inkscape\lib\locale\${polng}"
402 ; the keyboard tables
403 SetOutPath $INSTDIR\share\screens
404 File /nonfatal /a /r "..\..\inkscape\share\screens\keys.${polng}.svg"
405 SetOutPath $INSTDIR\share\templates
406 File /nonfatal /a /r "..\..\inkscape\share\templates\default.${polng}.svg"
407 SetOutPath $INSTDIR\doc
408 File /nonfatal /a /r "..\..\inkscape\doc\keys.${polng}.xml"
409 File /nonfatal /a /r "..\..\inkscape\doc\keys.${polng}.html"
410 SectionGetFlags ${SecTutorials} $R1
411 IntOp $R1 $R1 & ${SF_SELECTED}
412 IntCmp $R1 ${SF_SELECTED} 0 skip_tutorials
413 SetOutPath $INSTDIR\share\tutorials
414 File /nonfatal /a "..\..\inkscape\share\tutorials\*.${lng}.*"
415 skip_tutorials:
416 !macroend
418 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
423 ;--------------------------------
424 ; Installer Sections
426 Section -removeInkscape
427 ; check for an old installation and clean that dlls and stuff
428 ClearErrors
429 IfFileExists $INSTDIR\etc 0 doDeleteLib
430 DetailPrint "$INSTDIR\etc exists, will be removed"
431 RmDir /r $INSTDIR\etc
432 IfErrors 0 +4
433 DetailPrint "fatal: failed to delete $INSTDIR\etc"
434 DetailPrint "aborting installation"
435 Abort
436 doDeleteLib:
438 ClearErrors
439 IfFileExists $INSTDIR\lib 0 doDeleteLocale
440 DetailPrint "$INSTDIR\lib exists, will be removed"
441 RmDir /r $INSTDIR\lib
442 IfErrors 0 +4
443 DetailPrint "fatal: failed to delete $INSTDIR\lib"
444 DetailPrint "aborting installation"
445 Abort
446 doDeleteLocale:
448 ClearErrors
449 IfFileExists $INSTDIR\locale 0 doDeleteDll
450 DetailPrint "$INSTDIR\locale exists, will be removed"
451 RmDir /r $INSTDIR\locale
452 IfErrors 0 +4
453 DetailPrint "fatal: failed to delete $INSTDIR\locale"
454 DetailPrint "aborting installation"
455 Abort
456 doDeleteDll:
458 ClearErrors
459 FindFirst $0 $1 $INSTDIR\*.dll
460 FindNextLoop:
461 StrCmp $1 "" FindNextDone
462 DetailPrint "$INSTDIR\$1 exists, will be removed"
463 Delete $INSTDIR\$1
464 IfErrors 0 +4
465 DetailPrint "fatal: failed to delete $INSTDIR\$1"
466 DetailPrint "aborting installation"
467 Abort
468 FindNext $0 $1
469 Goto FindNextLoop
470 FindNextDone:
471 SectionEnd
473 Section $(lng_Core) SecCore
475 DetailPrint "Installing Inkscape Core Files ..."
477 SectionIn 1 2 3 RO
478 SetOutPath $INSTDIR
479 SetOverwrite on
480 SetAutoClose false
482 File /a "..\..\inkscape\ink*.exe"
483 File /a "..\..\inkscape\AUTHORS"
484 File /a "..\..\inkscape\COPYING"
485 File /a "..\..\inkscape\COPYING.LIB"
486 File /a "..\..\inkscape\NEWS"
487 File /a "..\..\inkscape\HACKING.txt"
488 File /a "..\..\inkscape\README"
489 File /a "..\..\inkscape\TRANSLATORS"
490 File /nonfatal /a /r "..\..\inkscape\data"
491 File /nonfatal /a /r "..\..\inkscape\doc"
492 File /nonfatal /a /r "..\..\inkscape\plugins"
493 File /nonfatal /a /r /x *.??*.???* /x "examples" /x "tutorials" "..\..\inkscape\share"
494 ; this file is added because it slips through the filter
495 SetOutPath $INSTDIR\share\clipart
496 File /a "..\..\inkscape\share\clipart\inkscape.logo.svg"
497 SetOutPath $INSTDIR\modules
498 File /nonfatal /a /r "..\..\inkscape\modules\*.*"
499 SetOutPath $INSTDIR\python
500 File /nonfatal /a /r "..\..\inkscape\python\*.*"
503 SectionEnd
505 Section $(lng_GTKFiles) SecGTK
507 DetailPrint "Installing GTK Files ..."
509 SectionIn 1 2 3 RO
510 SetOutPath $INSTDIR
511 SetOverwrite on
512 File /a /r "..\..\inkscape\*.dll"
513 File /a /r /x "locale" "..\..\inkscape\lib"
514 File /a /r "..\..\inkscape\etc"
515 SectionEnd
517 Section $(lng_Alluser) SecAlluser
518 ; disable this option in Win95/Win98/WinME
519 SectionIn 1 2 3
520 StrCpy $MultiUser "1"
521 SectionEnd
523 SectionGroup $(lng_Shortcuts) SecShortcuts
525 Section $(lng_Desktop) SecDesktop
526 SectionIn 1 2 3
527 CreateShortCut "$DESKTOP\Inkscape.lnk" "$INSTDIR\inkscape.exe"
528 SectionEnd
530 Section $(lng_Quicklaunch) SecQuicklaunch
531 SectionIn 1 2 3
532 StrCmp $QUICKLAUNCH $TEMP +2
533 CreateShortCut "$QUICKLAUNCH\Inkscape.lnk" "$INSTDIR\inkscape.exe"
534 SectionEnd
536 Section $(lng_SVGWriter) SecSVGWriter
537 SectionIn 1 2 3
538 ; create file associations, test before if needed
539 DetailPrint "creating file associations"
540 ReadRegStr $0 HKCR ".svg" ""
541 StrCmp $0 "" 0 +3
542 WriteRegStr HKCR ".svg" "" "svgfile"
543 WriteRegStr HKCR "svgfile" "" "Scalable Vector Graphics file"
544 ReadRegStr $0 HKCR ".svgz" ""
545 StrCmp $0 "" 0 +3
546 WriteRegStr HKCR ".svgz" "" "svgfile"
547 WriteRegStr HKCR "svgfile" "" "Scalable Vector Graphics file"
549 DetailPrint "creating default editor"
550 ClearErrors
551 ReadRegStr $0 HKCR ".svg" ""
552 WriteRegStr HKCR "$0\shell\edit\command" "" '"$INSTDIR\Inkscape.exe" "%1"'
553 ReadRegStr $0 HKCR ".svgz" ""
554 WriteRegStr HKCR "$0\shell\edit\command" "" '"$INSTDIR\Inkscape.exe" "%1"'
555 IfErrors 0 +2
556 DetailPrint "Uups! Problems creating default editor"
557 SectionEnd
559 Section $(lng_ContextMenu) SecContextMenu
560 SectionIn 1 2 3
561 ; create file associations, test before if needed
562 DetailPrint "creating file associations"
563 ReadRegStr $0 HKCR ".svg" ""
564 StrCmp $0 "" 0 +3
565 WriteRegStr HKCR ".svg" "" "svgfile"
566 WriteRegStr HKCR "svgfile" "" "Scalable Vector Graphics file"
567 ReadRegStr $0 HKCR ".svgz" ""
568 StrCmp $0 "" 0 +3
569 WriteRegStr HKCR ".svgz" "" "svgfile"
570 WriteRegStr HKCR "svgfile" "" "Scalable Vector Graphics file"
572 DetailPrint "creating context menue"
573 ClearErrors
574 ReadRegStr $0 HKCR ".svg" ""
575 WriteRegStr HKCR "$0\shell\${PRODUCT_NAME}\command" "" '"$INSTDIR\Inkscape.exe" "%1"'
576 ReadRegStr $0 HKCR ".svgz" ""
577 WriteRegStr HKCR "$0\shell\${PRODUCT_NAME}\command" "" '"$INSTDIR\Inkscape.exe" "%1"'
578 IfErrors 0 +2
579 DetailPrint "Uups! Problems creating context menue integration"
581 SectionEnd
583 SectionGroupEnd
585 SectionGroup $(lng_Addfiles) SecAddfiles
587 Section $(lng_Examples) SecExamples
588 SectionIn 1 2
589 SetOutPath $INSTDIR\share
590 File /nonfatal /a /r /x "*.??*.???*" "..\..\inkscape\share\examples"
591 SectionEnd
593 Section $(lng_Tutorials) SecTutorials
594 SectionIn 1 2
595 SetOutPath $INSTDIR\share
596 File /nonfatal /a /r /x "*.??*.???*" "..\..\inkscape\share\tutorials"
597 SectionEnd
599 SectionGroupEnd
601 SectionGroup /e $(lng_Languages) SecLanguages
603 Section $(lng_am) SecAmharic
604 !insertmacro Language am am
605 SectionEnd
607 Section $(lng_az) SecAzerbaijani
608 !insertmacro Language az az
609 SectionEnd
611 Section $(lng_be) SecByelorussian
612 !insertmacro Language be be
613 SectionEnd
615 Section $(lng_ca) SecCatalan
616 !insertmacro Language ca ca
617 SectionEnd
619 Section $(lng_cs) SecCzech
620 !insertmacro Language cs cs
621 SectionEnd
623 Section $(lng_da) SecDanish
624 !insertmacro Language da da
625 SectionEnd
627 Section $(lng_de) SecGerman
628 !insertmacro Language 'de' 'de'
629 SectionEnd
631 Section $(lng_el) SecGreek
632 !insertmacro Language el el
633 SectionEnd
635 Section $(lng_en) SecEnglish
636 SectionIn 1 2 3 RO
637 SectionEnd
639 Section $(lng_es) SecSpanish
640 !insertmacro Language 'es' 'es'
641 SectionEnd
643 Section $(lng_es_MX) SecSpanishMexico
644 !insertmacro Language 'es_MX' 'es_MX'
645 SectionEnd
647 Section $(lng_et) SecEstonian
648 !insertmacro Language et et
649 SectionEnd
651 Section $(lng_fr) SecFrench
652 !insertmacro Language 'fr' 'fr'
653 SectionEnd
655 Section $(lng_ga) SecIrish
656 !insertmacro Language ga ga
657 SectionEnd
659 Section $(lng_gl) SecGallegan
660 !insertmacro Language gl gl
661 SectionIn 1 2 3
662 SectionEnd
664 Section $(lng_hu) SecHungarian
665 !insertmacro Language hu hu
666 SectionIn 1 2 3
667 SectionEnd
669 Section $(lng_it) SecItalian
670 !insertmacro Language it it
671 SectionIn 1 2 3
672 SectionEnd
674 Section $(lng_ja) SecJapanese
675 !insertmacro Language 'ja' 'jp'
676 SectionEnd
678 Section $(lng_mk) SecMacedonian
679 !insertmacro Language mk mk
680 SectionEnd
682 Section $(lng_nb) SecNorwegianBokmal
683 !insertmacro Language nb nb
684 SectionEnd
686 Section $(lng_nl) SecDutch
687 !insertmacro Language nl nl
688 SectionEnd
690 Section $(lng_nn) SecNorwegianNynorsk
691 !insertmacro Language nn nn
692 SectionEnd
694 Section $(lng_pa) SecPanjabi
695 !insertmacro Language pa pa
696 SectionEnd
698 Section $(lng_pl) SecPolish
699 !insertmacro Language pl pl
700 SectionEnd
702 Section $(lng_pt) SecPortuguese
703 !insertmacro Language pt pt
704 SectionEnd
706 Section $(lng_pt_BR) SecPortugueseBrazil
707 !insertmacro Language pt_BR pt_BR
708 SectionEnd
710 Section $(lng_ru) SecRussian
711 !insertmacro Language ru ru
712 SectionEnd
714 Section $(lng_sk) SecSlovak
715 !insertmacro Language sk sk
716 SectionEnd
718 Section $(lng_sl) SecSlovenian
719 !insertmacro Language sl sl
720 SectionEnd
722 Section $(lng_sr) SecSerbian
723 !insertmacro Language sr sr
724 SectionEnd
726 Section $(lng_sr@Latn) SecSerbianLatin
727 !insertmacro Language 'sr@Latn' 'sr@Latn'
728 SectionEnd
730 Section $(lng_sv) SecSwedish
731 !insertmacro Language sv sv
732 SectionEnd
734 Section $(lng_tr) SecTurkish
735 !insertmacro Language tr tr
736 SectionEnd
738 Section $(lng_uk) SecUkrainian
739 !insertmacro Language uk uk
740 SectionEnd
742 Section $(lng_zh_CN) SecChineseSimplified
743 !insertmacro Language zh_CN zh_CN
744 SectionEnd
746 Section -FinalizeInstallation
747 StrCmp $MultiUser "1" "" SingleUser
748 DetailPrint "admin mode, registry root will be HKLM"
749 SetShellVarContext all
750 Goto endSingleUser
751 SingleUser:
752 DetailPrint "single user mode, registry root will be HKCU"
753 SetShellVarContext current
754 endSingleUser:
756 ; check for writing registry
757 ClearErrors
758 WriteRegStr SHCTX "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\inkscape.exe"
759 ;IfErrors 0 +4
760 ; DetailPrint "fatal: failed to write to ${PRODUCT_DIR_REGKEY}"
761 ; DetailPrint "aborting installation"
762 ; Abort
763 WriteRegStr SHCTX "${PRODUCT_DIR_REGKEY}" "MultiUser" "$MultiUser"
764 WriteRegStr SHCTX "${PRODUCT_DIR_REGKEY}" "askMultiUser" "$askMultiUser"
766 ; start menu entries
767 CreateDirectory "$SMPROGRAMS\Inkscape"
768 CreateShortCut "$SMPROGRAMS\Inkscape\Inkscape.lnk" "$INSTDIR\inkscape.exe"
769 CreateShortCut "$SMPROGRAMS\Inkscape\Uninstall Inkscape.lnk" "$INSTDIR\uninst.exe"
771 ; uninstall settings
772 WriteUninstaller "$INSTDIR\uninst.exe"
773 WriteRegExpandStr SHCTX "${PRODUCT_UNINST_KEY}" "UninstallString" '"$INSTDIR\uninst.exe"'
774 WriteRegExpandStr SHCTX "${PRODUCT_UNINST_KEY}" "InstallLocation" "$INSTDIR"
775 WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "DisplayName" "${PRODUCT_NAME} ${PRODUCT_VERSION}"
776 WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\Inkscape.exe,0"
777 WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
778 WriteRegDWORD SHCTX "${PRODUCT_UNINST_KEY}" "NoModify" "1"
779 WriteRegDWORD SHCTX "${PRODUCT_UNINST_KEY}" "NoRepair" "1"
780 SectionEnd
782 SectionGroupEnd
784 ; Last the Descriptions
785 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
786 !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} $(lng_CoreDesc)
787 !insertmacro MUI_DESCRIPTION_TEXT ${SecGTK} $(lng_GTKFilesDesc)
788 !insertmacro MUI_DESCRIPTION_TEXT ${SecShortcuts} $(lng_ShortcutsDesc)
789 !insertmacro MUI_DESCRIPTION_TEXT ${SecAlluser} $(lng_AlluserDesc)
790 !insertmacro MUI_DESCRIPTION_TEXT ${SecDesktop} $(lng_DesktopDesc)
791 !insertmacro MUI_DESCRIPTION_TEXT ${SecQuicklaunch} $(lng_QuicklaunchDesc)
792 !insertmacro MUI_DESCRIPTION_TEXT ${SecSVGWriter} $(lng_SVGWriterDesc)
793 !insertmacro MUI_DESCRIPTION_TEXT ${SecContextMenu} $(lng_ContextMenuDesc)
794 !insertmacro MUI_DESCRIPTION_TEXT ${SecAddfiles} $(lng_AddfilesDesc)
795 !insertmacro MUI_DESCRIPTION_TEXT ${SecExamples} $(lng_ExamplesDesc)
796 !insertmacro MUI_DESCRIPTION_TEXT ${SecTutorials} $(lng_TutorialsDesc)
797 !insertmacro MUI_DESCRIPTION_TEXT ${SecLanguages} $(lng_LanguagesDesc)
798 !insertmacro MUI_FUNCTION_DESCRIPTION_END
800 !macro Parameter key Section
801 Push ${key}
802 Push ""
803 Call GetParameterValue
804 Pop $1
805 StrCmp $1 "OFF" 0 +5
806 SectionGetFlags ${Section} $0
807 IntOp $2 ${SF_SELECTED} ~
808 IntOp $0 $0 & $2
809 SectionSetFlags ${Section} $0
810 StrCmp $1 "ON" 0 +4
811 SectionGetFlags ${Section} $0
812 IntOp $0 $0 | ${SF_SELECTED}
813 SectionSetFlags ${Section} $0
814 !macroend
816 Function .onInit
817 ;Extract InstallOptions INI files
818 StrCpy $AskMultiUser "1"
819 StrCpy $MultiUser "0"
820 ; this resets AskMultiUser if Win95/98/ME
821 Call GetWindowsVersion
822 Pop $R0
823 DetailPrint "detected operating system $R0"
824 ;MessageBox MB_OK "operating system: $R0; AskMultiuser: $AskMultiUser"
826 ; hide all user section if win98
827 StrCmp $AskMultiUser "1" +2
828 SectionSetText ${SecAlluser} ""
830 ; hide if quick launch if not available
831 StrCmp $QUICKLAUNCH $TEMP 0 +2
832 SectionSetText ${SecQuicklaunch} ""
834 ; proccess command line parameter
835 !insertmacro Parameter "GTK" ${SecGTK}
836 !insertmacro Parameter "SHORTCUTS" ${secShortcuts}
837 !insertmacro Parameter "ALLUSER" ${SecAlluser}
838 !insertmacro Parameter "DESKTOP" ${SecDesktop}
839 !insertmacro Parameter "QUICKLAUNCH" ${SecQUICKlaunch}
840 !insertmacro Parameter "SVGEDITOR" ${SecSVGWriter}
841 !insertmacro Parameter "CONTEXTMENUE" ${SecContextMenu}
842 !insertmacro Parameter "ADDFILES" ${SecAddfiles}
843 !insertmacro Parameter "EXAMPLES" ${SecExamples}
844 !insertmacro Parameter "TUTORIALS" ${SecTutorials}
845 !insertmacro Parameter "LANGUAGES" ${SecLanguages}
846 !insertmacro Parameter "am" ${SecAmharic}
847 !insertmacro Parameter "az" ${SecAzerbaijani}
848 !insertmacro Parameter "be" ${SecByelorussian}
849 !insertmacro Parameter "ca" ${SecCatalan}
850 !insertmacro Parameter "cs" ${SecCzech}
851 !insertmacro Parameter "da" ${SecDanish}
852 !insertmacro Parameter "de" ${SecGerman}
853 !insertmacro Parameter "el" ${SecGreek}
854 !insertmacro Parameter "es" ${SecSpanish}
855 !insertmacro Parameter "es_MX" ${SecSpanishMexico}
856 !insertmacro Parameter "et" ${SecEstonian}
857 !insertmacro Parameter "fr" ${SecFrench}
858 !insertmacro Parameter "ga" ${SecIrish}
859 !insertmacro Parameter "gl" ${SecGallegan}
860 !insertmacro Parameter "hu" ${SecHungarian}
861 !insertmacro Parameter "it" ${SecItalian}
862 !insertmacro Parameter "ja" ${SecJapanese}
863 !insertmacro Parameter "mk" ${SecMacedonian}
864 !insertmacro Parameter "nb" ${SecNorwegianBokmal}
865 !insertmacro Parameter "nl" ${SecDutch}
866 !insertmacro Parameter "nn" ${SecNorwegianNynorsk}
867 !insertmacro Parameter "pa" ${SecPanjabi}
868 !insertmacro Parameter "pl" ${SecPolish}
869 !insertmacro Parameter "pt" ${SecPortuguese}
870 !insertmacro Parameter "pt_BR" ${SecPortugueseBrazil}
871 !insertmacro Parameter "ru" ${SecRussian}
872 !insertmacro Parameter "sk" ${SecSlovak}
873 !insertmacro Parameter "sl" ${SecSlovenian}
874 !insertmacro Parameter "sr" ${SecSerbian}
875 !insertmacro Parameter "sr@Latn" ${SecSerbianLatin}
876 !insertmacro Parameter "sv" ${SecSwedish}
877 !insertmacro Parameter "tr" ${SecTurkish}
878 !insertmacro Parameter "uk" ${SecUkrainian}
879 !insertmacro Parameter "zh_CN" ${SecChineseSimplified}
881 Push "?"
882 Push "TEST"
883 Call GetParameterValue
884 Pop $1
885 StrCmp $1 "TEST" +3
886 MessageBox MB_OK "possible parameters for installer:$\r$\n \
887 /?: this help screen$\r$\n \
888 /S: silent$\r$\n \
889 /D=(directory): where to install inkscape$\r$\n \
890 /GTK=(OFF/ON): GTK+ Runtime environment$\r$\n \
891 /SHORTCUTS=(OFF/ON): shortcuts to start inkscape$\r$\n \
892 /ALLUSER=(OFF/ON): for all users on the computer$\r$\n \
893 /DESKTOP=(OFF/ON): Desktop icon$\r$\n \
894 /QUICKLAUNCH=(OFF/ON): quick launch icon$\r$\n \
895 /SVGEDITOR=(OFF/ON): default SVG editor$\r$\n \
896 /CONTEXTMENUE=(OFF/ON): context menue integration$\r$\n \
897 /ADDFILES=(OFF/ON): additional files$\r$\n \
898 /EXAMPLES=(OFF/ON): examples$\r$\n \
899 /TUTORIALS=(OFF/ON): tutorials$\r$\n \
900 /LANGUAGES=(OFF/ON): translated menues, examples, etc.$\r$\n \
901 /[locale code]=(OFF/ON): e.g am, es, es_MX as in Inkscape supported"
902 Abort
903 FunctionEnd
905 Function .onSelChange
906 FunctionEnd
908 ; --------------------------------------------------
910 Function un.CustomPageUninstall
911 !insertmacro MUI_HEADER_TEXT "$(lng_UInstOpt)" "$(lng_UInstOpt1)"
912 !insertmacro MUI_INSTALLOPTIONS_WRITE "inkscape.nsi.uninstall" "Field 1" "Text" "$APPDATA\Inkscape\preferences.xml"
913 !insertmacro MUI_INSTALLOPTIONS_WRITE "inkscape.nsi.uninstall" "Field 2" "Text" "$(lng_PurgePrefs)"
915 !insertmacro MUI_INSTALLOPTIONS_DISPLAY "inkscape.nsi.uninstall"
916 !insertmacro MUI_INSTALLOPTIONS_READ $MultiUser "inkscape.nsi.uninstall" "Field 2" "State"
917 DetailPrint "keepfiles = $MultiUser"
918 ;MessageBox MB_OK "adminmode = $MultiUser MultiUserOS = $askMultiUser"
920 FunctionEnd
923 Function un.onInit
925 StrCpy $askMultiUser "1"
926 StrCpy $MultiUser "1"
928 ; Test if this was a multiuser installation
929 ReadRegStr $0 HKLM "${PRODUCT_DIR_REGKEY}" ""
930 StrCmp $0 "$INSTDIR\inkscape.exe" 0 +4
931 ReadRegStr $MultiUser HKLM "${PRODUCT_DIR_REGKEY}" "MultiUser"
932 ReadRegStr $askMultiUser HKLM "${PRODUCT_DIR_REGKEY}" "askMultiUser"
933 Goto +3
934 ReadRegStr $MultiUser HKCU "${PRODUCT_DIR_REGKEY}" "MultiUser"
935 ReadRegStr $askMultiUser HKCU "${PRODUCT_DIR_REGKEY}" "askMultiUser"
938 !insertmacro MUI_INSTALLOPTIONS_EXTRACT "inkscape.nsi.uninstall"
940 ;check whether Multi user installation ?
941 SetShellVarContext all
942 StrCmp $MultiUser "0" 0 +2
943 SetShellVarContext current
944 ;MessageBox MB_OK "adminmode = $MultiUser MultiUserOS = $askMultiUser"
946 FunctionEnd
948 Section Uninstall
950 ; remove personal settings
951 Delete "$APPDATA\Inkscape\extension-errors.log"
952 StrCmp $MultiUser "0" 0 endPurge ; multiuser assigned in dialog
953 DetailPrint "purge personal settings in $APPDATA\Inkscape"
954 RMDir /r "$APPDATA\Inkscape"
955 endPurge:
957 ; Remove file associations for svg editor
958 DetailPrint "removing file associations for svg editor"
959 ClearErrors
960 ReadRegStr $0 HKCR ".svg" ""
961 DetailPrint ".svg associated as $0"
962 IfErrors endUninstSVGEdit
963 ReadRegStr $1 HKCR "$0\shell\edit\command" ""
964 IfErrors 0 +2
965 DetailPrint "svg editor is $1"
966 StrCmp $1 '"$INSTDIR\Inkscape.exe" "%1"' 0 +3
967 DetailPrint "removing default .svg editor"
968 DeleteRegKey HKCR "$0\shell\edit\command"
969 DeleteRegKey /ifempty HKCR "$0\shell\edit"
970 DeleteRegKey /ifempty HKCR "$0\shell"
971 DeleteRegKey /ifempty HKCR "$0"
972 endUninstSVGEdit:
974 ClearErrors
975 ReadRegStr $2 HKCR ".svgz" ""
976 DetailPrint ".svgz associated as $2"
977 IfErrors endUninstSVGZEdit
978 ReadRegStr $3 HKCR "$2\shell\edit\command" ""
979 IfErrors 0 +2
980 DetailPrint "svgz editor is $1"
981 StrCmp $3 '"$INSTDIR\Inkscape.exe" "%1"' 0 +3
982 DetailPrint "removing default .svgz editor"
983 DeleteRegKey HKCR "$2\shell\edit\command"
984 DeleteRegKey /ifempty HKCR "$2\shell\edit"
985 DeleteRegKey /ifempty HKCR "$2\shell"
986 DeleteRegKey /ifempty HKCR "$2"
987 endUninstSVGZEdit:
989 ; Remove file associations for svg editor
990 DetailPrint "removing file associations for svg editor"
991 ClearErrors
992 ReadRegStr $0 HKCR ".svg" ""
993 IfErrors endUninstSVGView
994 ReadRegStr $1 HKCR "$0\shell\open\command" ""
995 IfErrors 0 +2
996 DetailPrint "svg viewer is $1"
997 StrCmp $1 '"$INSTDIR\Inkscape.exe" "%1"' 0 +3
998 DetailPrint "removing default .svg viewer"
999 DeleteRegKey HKCR "$0\shell\open\command"
1000 DeleteRegKey /ifempty HKCR "$0\shell\open"
1001 DeleteRegKey /ifempty HKCR "$0\shell"
1002 DeleteRegKey /ifempty HKCR "$0"
1003 endUninstSVGView:
1005 ClearErrors
1006 ReadRegStr $2 HKCR ".svgz" ""
1007 IfErrors endUninstSVGZView
1008 ReadRegStr $3 HKCR "$2\shell\open\command" ""
1009 IfErrors 0 +2
1010 DetailPrint "svgz viewer is $1"
1011 StrCmp $3 '"$INSTDIR\Inkscape.exe" "%1"' 0 +3
1012 DetailPrint "removing default .svgz viewer"
1013 DeleteRegKey HKCR "$2\shell\open\command"
1014 DeleteRegKey /ifempty HKCR "$2\shell\open"
1015 DeleteRegKey /ifempty HKCR "$2\shell"
1016 DeleteRegKey /ifempty HKCR "$2"
1017 endUninstSVGZView:
1019 ; Remove file associations for context menue
1020 DetailPrint "removing file associations for svg editor"
1021 ClearErrors
1022 ReadRegStr $0 HKCR ".svg" ""
1023 IfErrors endUninstSVGContext
1024 DetailPrint "removing default .svg context menue"
1025 DeleteRegKey HKCR "$0\shell\${PRODUCT_NAME}"
1026 DeleteRegKey /ifempty HKCR "$0\shell"
1027 DeleteRegKey /ifempty HKCR "$0"
1028 endUninstSVGContext:
1030 ClearErrors
1031 ReadRegStr $2 HKCR ".svgz" ""
1032 IfErrors endUninstSVGZContext
1033 DetailPrint "removing default .svgzcontext menue"
1034 DeleteRegKey HKCR "$2\shell\${PRODUCT_NAME}"
1035 DeleteRegKey /ifempty HKCR "$2\shell"
1036 DeleteRegKey /ifempty HKCR "$2"
1037 endUninstSVGZContext:
1039 ReadRegStr $1 HKCR "$0" ""
1040 StrCmp $1 "" 0 +3
1041 DetailPrint "removing filetype .svg $0"
1042 DeleteRegKey HKCR ".svg"
1044 ReadRegStr $3 HKCR "$2" ""
1045 StrCmp $3 "" 0 +3
1046 DetailPrint "removing filetype .svgz $2"
1047 DeleteRegKey HKCR ".svgz"
1050 DetailPrint "removing product regkey"
1051 DeleteRegKey SHCTX "${PRODUCT_DIR_REGKEY}"
1052 DetailPrint "removing uninstall info"
1053 DeleteRegKey SHCTX "${PRODUCT_UNINST_KEY}"
1055 DetailPrint "removing shortcuts"
1056 Delete "$DESKTOP\Inkscape.lnk"
1057 Delete "$QUICKLAUNCH\Inkscape.lnk"
1058 Delete "$SMPROGRAMS\Inkscape\Uninstall Inkscape.lnk"
1059 Delete "$SMPROGRAMS\Inkscape\Inkscape.lnk"
1060 RMDir "$SMPROGRAMS\Inkscape"
1062 DetailPrint "removing uninstall info"
1063 RMDir /r "$INSTDIR"
1065 SetAutoClose false
1067 SectionEnd