24ed56855abf79e045c6ae3656ae47d12e1f44ac
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.45+0.46pre0"
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}"
15 ;!define UNINST_EXE "uninstall.exe"
19 ; #######################################
20 ; MUI SETTINGS
21 ; #######################################
22 ; MUI 1.67 compatible ------
23 SetCompressor /SOLID lzma
24 !include "MUI.nsh"
25 !include "sections.nsh"
26 !define MUI_ABORTWARNING
27 !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
28 !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
29 !define MUI_HEADERIMAGE
30 !define MUI_HEADERIMAGE_BITMAP "header.bmp"
31 !define MUI_COMPONENTSPAGE_SMALLDESC
33 ;..................................................................................................
34 ;Following two definitions required. Uninstall log will use these definitions.
35 ;You may use these definitions also, when you want to set up the InstallDirRagKey,
36 ;store the language selection, store Start Menu folder etc.
37 ;Enter the windows uninstall reg sub key to add uninstall information to Add/Remove Programs also.
39 !define INSTDIR_REG_ROOT "HKLM"
40 !define INSTDIR_REG_KEY ${PRODUCT_UNINST_KEY}
42 ;include the Uninstall log header
43 !include AdvUninstLog.nsh
45 ;Specify the preferred uninstaller operation mode, either unattended or interactive.
46 ;You have to type either !insertmacro UNATTENDED_UNINSTALL, or !insertmacro INTERACTIVE_UNINSTALL.
47 ;Be aware only one of the following two macros has to be inserted, neither both, neither none.
49 ;!insertmacro UNATTENDED_UNINSTALL
50 !insertmacro INTERACTIVE_UNINSTALL
52 !addplugindir .
53 !include "FileFunc.nsh"
54 !insertmacro un.GetParent
57 ; Welcome page
58 !insertmacro MUI_PAGE_WELCOME
59 ; License page
60 ; !define MUI_LICENSEPAGE_RADIOBUTTONS
61 LicenseForceSelection off
62 !define MUI_LICENSEPAGE_BUTTON $(lng_LICENSE_BUTTON)
63 !define MUI_LICENSEPAGE_TEXT_BOTTOM $(lng_LICENSE_BOTTOM_TEXT)
64 !insertmacro MUI_PAGE_LICENSE "..\..\Copying"
65 !insertmacro MUI_PAGE_COMPONENTS
66 ; InstType $(lng_Full)
67 ; InstType $(lng_Optimal)
68 ; InstType $(lng_Minimal)
69 ; Directory page
70 !insertmacro MUI_PAGE_DIRECTORY
71 ; Instfiles page
72 !insertmacro MUI_PAGE_INSTFILES
73 ; Finish page
74 !define MUI_FINISHPAGE_RUN "$INSTDIR\inkscape.exe"
75 !insertmacro MUI_PAGE_FINISH
77 ; Uninstaller pages
78 !insertmacro MUI_UNPAGE_CONFIRM
79 UninstPage custom un.CustomPageUninstall
80 !insertmacro MUI_UNPAGE_INSTFILES
81 ShowUninstDetails hide
82 !insertmacro MUI_UNPAGE_FINISH
84 ; #######################################
85 ; STRING LOCALIZATION
86 ; #######################################
87 ; Thanks to Adib Taraben and Luca Bruno for getting this started
88 ; Add your translation here! :-)
89 ; I had wanted to list the languages alphabetically, but apparently
90 ; the first is the default. So putting English first is just being
91 ; practical. It is not chauvinism or hubris, I swear! ;-)
92 ; default language first
94 ; Language files
95 !include "english.nsh"
96 !include "catalan.nsh"
97 !include "czech.nsh"
98 !include "finnish.nsh"
99 !include "french.nsh"
100 !include "galician.nsh"
101 !include "german.nsh"
102 !include "italian.nsh"
103 !include "japanese.nsh"
104 !include "polish.nsh"
105 !include "russian.nsh"
106 !include "slovak.nsh"
107 !include "slovenian.nsh"
108 !include "spanish.nsh"
110 ReserveFile "inkscape.nsi.uninstall"
111 ReserveFile "${NSISDIR}\Plugins\UserInfo.dll"
112 !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS ;InstallOptions
115 ; #######################################
116 ; SETTINGS
117 ; #######################################
119 Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
120 Caption $(lng_Caption)
121 OutFile "Inkscape-${PRODUCT_VERSION}-1.win32.exe"
122 InstallDir "$PROGRAMFILES\Inkscape"
123 InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
124 ShowInstDetails hide
125 ShowUnInstDetails hide
127 var askMultiUser
128 Var MultiUser
129 var User
131 ; #######################################
132 ; I N S T A L L E R S E C T I O N S
133 ; #######################################
135 ; Turn off old selected section
136 ; GetWindowsVersion
137 ;
138 ; Based on Yazno's function, http://yazno.tripod.com/powerpimpit/
139 ; Updated by Joost Verburg
140 ; Updated for Windows 98 SE by Matthew Win Tibbals 5-21-03
141 ;
142 ; Returns on top of stack
143 ;
144 ; Windows Version (95, 98, ME, NT x.x, 2000, XP, 2003)
145 ; or
146 ; '' (Unknown Windows Version)
147 ;
148 ; Usage:
149 ; Call GetWindowsVersion
150 ; Pop $R0
151 ; ; at this point $R0 is "NT 4.0" or whatnot
152 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
153 Function GetWindowsVersion
155 Push $R0
156 Push $R1
158 ClearErrors
160 ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
162 IfErrors 0 lbl_winnt
164 ; we are not NT
165 ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion" VersionNumber
167 StrCpy $R1 $R0 1
168 StrCmp $R1 '4' 0 lbl_error
170 StrCpy $R1 $R0 3
172 StrCmp $R1 '4.0' lbl_win32_95
173 StrCmp $R1 '4.9' lbl_win32_ME lbl_win32_98
175 lbl_win32_95:
176 StrCpy $R0 '95'
177 StrCpy $AskMultiUser "0"
178 Goto lbl_done
180 lbl_win32_98:
181 StrCpy $R0 '98'
182 StrCpy $AskMultiUser "0"
183 Goto lbl_done
184 lbl_win32_ME:
185 StrCpy $R0 'ME'
186 StrCpy $AskMultiUser "0"
187 Goto lbl_done
189 lbl_winnt:
191 StrCpy $R1 $R0 1
193 StrCmp $R1 '3' lbl_winnt_x
194 StrCmp $R1 '4' lbl_winnt_x
196 StrCpy $R1 $R0 3
198 StrCmp $R1 '5.0' lbl_winnt_2000
199 StrCmp $R1 '5.1' lbl_winnt_XP
200 StrCmp $R1 '5.2' lbl_winnt_2003 lbl_error
202 lbl_winnt_x:
203 StrCpy $R0 "NT $R0" 6
204 Goto lbl_done
206 lbl_winnt_2000:
207 Strcpy $R0 '2000'
208 Goto lbl_done
210 lbl_winnt_XP:
211 Strcpy $R0 'XP'
212 Goto lbl_done
214 lbl_winnt_2003:
215 Strcpy $R0 '2003'
216 Goto lbl_done
218 lbl_error:
219 Strcpy $R0 ''
220 lbl_done:
222 Pop $R1
223 Exch $R0
225 FunctionEnd
227 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
229 ; StrStr
230 ; input, top of stack = string to search for
231 ; top of stack-1 = string to search in
232 ; output, top of stack (replaces with the portion of the string remaining)
233 ; modifies no other variables.
234 ;
235 ; Usage:
236 ; Push "this is a long ass string"
237 ; Push "ass"
238 ; Call StrStr
239 ; Pop $R0
240 ; ($R0 at this point is "ass string")
242 Function StrStr
243 Exch $R1 ; st=haystack,old$R1, $R1=needle
244 Exch ; st=old$R1,haystack
245 Exch $R2 ; st=old$R1,old$R2, $R2=haystack
246 Push $R3
247 Push $R4
248 Push $R5
249 StrLen $R3 $R1
250 StrCpy $R4 0
251 ; $R1=needle
252 ; $R2=haystack
253 ; $R3=len(needle)
254 ; $R4=cnt
255 ; $R5=tmp
256 loop:
257 StrCpy $R5 $R2 $R3 $R4
258 StrCmp $R5 $R1 done
259 StrCmp $R5 "" done
260 IntOp $R4 $R4 + 1
261 Goto loop
262 done:
263 StrCpy $R1 $R2 "" $R4
264 Pop $R5
265 Pop $R4
266 Pop $R3
267 Pop $R2
268 Exch $R1
269 FunctionEnd
271 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
273 ; GetParameters
274 ; input, none
275 ; output, top of stack (replaces, with e.g. whatever)
276 ; modifies no other variables.
278 Function GetParameters
280 Push $R0
281 Push $R1
282 Push $R2
283 Push $R3
285 StrCpy $R2 1
286 StrLen $R3 $CMDLINE
288 ;Check for quote or space
289 StrCpy $R0 $CMDLINE $R2
290 StrCmp $R0 '"' 0 +3
291 StrCpy $R1 '"'
292 Goto loop
293 StrCpy $R1 " "
295 loop:
296 IntOp $R2 $R2 + 1
297 StrCpy $R0 $CMDLINE 1 $R2
298 StrCmp $R0 $R1 get
299 StrCmp $R2 $R3 get
300 Goto loop
302 get:
303 IntOp $R2 $R2 + 1
304 StrCpy $R0 $CMDLINE 1 $R2
305 StrCmp $R0 " " get
306 StrCpy $R0 $CMDLINE "" $R2
308 Pop $R3
309 Pop $R2
310 Pop $R1
311 Exch $R0
313 FunctionEnd
315 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
316 ; GetParameterValue
317 ; Chris Morgan<cmorgan@alum.wpi.edu> 5/10/2004
318 ; -Updated 4/7/2005 to add support for retrieving a command line switch
319 ; and additional documentation
320 ;
321 ; Searches the command line input, retrieved using GetParameters, for the
322 ; value of an option given the option name. If no option is found the
323 ; default value is placed on the top of the stack upon function return.
324 ;
325 ; This function can also be used to detect the existence of just a
326 ; command line switch like /OUTPUT Pass the default and "OUTPUT"
327 ; on the stack like normal. An empty return string "" will indicate
328 ; that the switch was found, the default value indicates that
329 ; neither a parameter or switch was found.
330 ;
331 ; Inputs - Top of stack is default if parameter isn't found,
332 ; second in stack is parameter to search for, ex. "OUTPUT"
333 ; Outputs - Top of the stack contains the value of this parameter
334 ; So if the command line contained /OUTPUT=somedirectory, "somedirectory"
335 ; will be on the top of the stack when this function returns
336 ;
337 ; Register usage
338 ;$R0 - default return value if the parameter isn't found
339 ;$R1 - input parameter, for example OUTPUT from the above example
340 ;$R2 - the length of the search, this is the search parameter+2
341 ; as we have '/OUTPUT='
342 ;$R3 - the command line string
343 ;$R4 - result from StrStr calls
344 ;$R5 - search for ' ' or '"'
346 Function GetParameterValue
347 Exch $R0 ; get the top of the stack(default parameter) into R0
348 Exch ; exchange the top of the stack(default) with
349 ; the second in the stack(parameter to search for)
350 Exch $R1 ; get the top of the stack(search parameter) into $R1
352 ;Preserve on the stack the registers used in this function
353 Push $R2
354 Push $R3
355 Push $R4
356 Push $R5
358 Strlen $R2 $R1+2 ; store the length of the search string into R2
360 Call GetParameters ; get the command line parameters
361 Pop $R3 ; store the command line string in R3
363 # search for quoted search string
364 StrCpy $R5 '"' ; later on we want to search for a open quote
365 Push $R3 ; push the 'search in' string onto the stack
366 Push '"/$R1=' ; push the 'search for'
367 Call StrStr ; search for the quoted parameter value
368 Pop $R4
369 StrCpy $R4 $R4 "" 1 ; skip over open quote character, "" means no maxlen
370 StrCmp $R4 "" "" next ; if we didn't find an empty string go to next
372 # search for non-quoted search string
373 StrCpy $R5 ' ' ; later on we want to search for a space since we
374 ; didn't start with an open quote '"' we shouldn't
375 ; look for a close quote '"'
376 Push $R3 ; push the command line back on the stack for searching
377 Push '/$R1=' ; search for the non-quoted search string
378 Call StrStr
379 Pop $R4
381 ; $R4 now contains the parameter string starting at the search string,
382 ; if it was found
383 next:
384 StrCmp $R4 "" check_for_switch ; if we didn't find anything then look for
385 ; usage as a command line switch
386 # copy the value after /$R1= by using StrCpy with an offset of $R2,
387 # the length of '/OUTPUT='
388 StrCpy $R0 $R4 "" $R2 ; copy commandline text beyond parameter into $R0
389 # search for the next parameter so we can trim this extra text off
390 Push $R0
391 Push $R5 ; search for either the first space ' ', or the first
392 ; quote '"'
393 ; if we found '"/output' then we want to find the
394 ; ending ", as in '"/output=somevalue"'
395 ; if we found '/output' then we want to find the first
396 ; space after '/output=somevalue'
397 Call StrStr ; search for the next parameter
398 Pop $R4
399 StrCmp $R4 "" done ; if 'somevalue' is missing, we are done
400 StrLen $R4 $R4 ; get the length of 'somevalue' so we can copy this
401 ; text into our output buffer
402 StrCpy $R0 $R0 -$R4 ; using the length of the string beyond the value,
403 ; copy only the value into $R0
404 goto done ; if we are in the parameter retrieval path skip over
405 ; the check for a command line switch
407 ; See if the parameter was specified as a command line switch, like '/output'
408 check_for_switch:
409 Push $R3 ; push the command line back on the stack for searching
410 Push '/$R1' ; search for the non-quoted search string
411 Call StrStr
412 Pop $R4
413 StrCmp $R4 "" done ; if we didn't find anything then use the default
414 StrCpy $R0 "" ; otherwise copy in an empty string since we found the
415 ; parameter, just didn't find a value
417 done:
418 Pop $R5
419 Pop $R4
420 Pop $R3
421 Pop $R2
422 Pop $R1
423 Exch $R0 ; put the value in $R0 at the top of the stack
424 FunctionEnd
426 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
428 !macro Language polng lng
429 SectionIn 1 2 3
430 SetOutPath $INSTDIR
431 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
432 File /nonfatal /a "..\..\inkscape\*.${lng}.txt"
433 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
434 SetOutPath $INSTDIR\locale
435 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
436 File /nonfatal /a /r "..\..\inkscape\locale\${polng}"
437 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
438 SetOutPath $INSTDIR\lib\locale
439 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
440 File /nonfatal /a /r "..\..\inkscape\lib\locale\${polng}"
441 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
442 SetOutPath $INSTDIR\share\clipart
443 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
444 File /nonfatal /a /r "..\..\inkscape\share\clipart\*.${polng}.svg"
445 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
446 ; the keyboard tables
447 SetOutPath $INSTDIR\share\screens
448 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
449 File /nonfatal /a /r "..\..\inkscape\share\screens\*.${polng}.svg"
450 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
451 SetOutPath $INSTDIR\share\templates
452 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
453 File /nonfatal /a /r "..\..\inkscape\share\templates\*.${polng}.svg"
454 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
455 SetOutPath $INSTDIR\doc
456 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
457 File /nonfatal /a /r "..\..\inkscape\doc\keys.${polng}.xml"
458 File /nonfatal /a /r "..\..\inkscape\doc\keys.${polng}.html"
459 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
460 SectionGetFlags ${SecTutorials} $R1
461 IntOp $R1 $R1 & ${SF_SELECTED}
462 IntCmp $R1 ${SF_SELECTED} 0 skip_tutorials
463 SetOutPath $INSTDIR\share\tutorials
464 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
465 File /nonfatal /a "..\..\inkscape\share\tutorials\*.${polng}.*"
466 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
467 skip_tutorials:
468 !macroend
470 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
472 ;;;;;;;;;;;;;;;;;;;;;;;;;;
473 ; Delete prefs
474 ; code taken from the vlc project
475 ;;;;;;;;;;;;;;;;;;;;;;;;;;
476 !macro delprefs
477 StrCpy $0 0
478 DetailPrint "Delete personal preferences ..."
479 DetailPrint "try to find all users ..."
480 delprefs-Loop:
481 ; FIXME
482 ; this will loop through all the logged users and "virtual" windows users
483 ; (it looks like users are only present in HKEY_USERS when they are logged in)
484 ClearErrors
485 EnumRegKey $1 HKU "" $0
486 StrCmp $1 "" delprefs-End
487 IntOp $0 $0 + 1
488 ReadRegStr $2 HKU "$1\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" AppData
489 StrCmp $2 "" delprefs-Loop
490 DetailPrint "$2\Inkscape will be removed"
491 Delete "$2\Inkscape\preferences.xml"
492 Delete "$2\Inkscape\extension-errors.log"
493 RMDir "$2\Inkscape"
494 Goto delprefs-Loop
495 delprefs-End:
496 !macroend
499 ;--------------------------------
500 ; Installer Sections
501 Section -removeInkscape
502 ; check for an old installation and clean that dlls and stuff
504 FindFirstINSTDIR:
505 FindFirst $0 $1 $INSTDIR\*.*
506 FindINSTDIR:
507 StrCmp $1 "" FindNextDoneINSTDIR
508 StrCmp $1 "." FindNextINSTDIR
509 StrCmp $1 ".." FindNextINSTDIR
510 Goto FoundSomethingINSTDIR
511 FindNextINSTDIR:
512 FindNext $0 $1
513 Goto FindINSTDIR
514 FoundSomethingINSTDIR:
515 MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "$(lng_ClearDirectoryBefore)" /SD IDCANCEL IDRETRY FindFirstINSTDIR
516 Quit
517 FindNextDoneINSTDIR:
519 ;remove the old inkscape shortcuts from the startmenu
520 ;just in case they are still there
521 SetShellVarContext current
522 Delete "$SMPROGRAMS\Inkscape\Uninstall Inkscape.lnk"
523 Delete "$SMPROGRAMS\Inkscape\Inkscape.lnk"
524 RMDir "$SMPROGRAMS\Inkscape"
525 Delete "$SMPROGRAMS\Inkscape.lnk"
526 SetShellVarContext all
527 Delete "$SMPROGRAMS\Inkscape\Uninstall Inkscape.lnk"
528 Delete "$SMPROGRAMS\Inkscape\Inkscape.lnk"
529 RMDir "$SMPROGRAMS\Inkscape"
530 Delete "$SMPROGRAMS\Inkscape.lnk"
532 SectionEnd
534 Section $(lng_Core) SecCore
536 DetailPrint "Installing Inkscape Core Files ..."
538 SectionIn 1 2 3 RO
539 SetOutPath $INSTDIR
540 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
541 SetOverwrite on
542 SetAutoClose false
544 File /a "..\..\inkscape\ink*.exe"
545 File /a "..\..\inkscape\AUTHORS"
546 File /a "..\..\inkscape\COPYING"
547 File /a "..\..\inkscape\COPYING.LIB"
548 File /a "..\..\inkscape\NEWS"
549 File /a "..\..\inkscape\gspawn-win32-helper.exe"
550 File /a "..\..\inkscape\gspawn-win32-helper-console.exe"
551 File /nonfatal /a "..\..\inkscape\HACKING.txt"
552 File /a "..\..\inkscape\README"
553 File /nonfatal /a "..\..\inkscape\README.txt"
554 File /a "..\..\inkscape\TRANSLATORS"
555 File /nonfatal /a /r "..\..\inkscape\data"
556 File /nonfatal /a /r "..\..\inkscape\doc"
557 File /nonfatal /a /r "..\..\inkscape\plugins"
558 File /nonfatal /a /r /x *.??*.???* /x "examples" /x "tutorials" "..\..\inkscape\share"
559 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
560 ; this files are added because it slips through the filter
561 SetOutPath $INSTDIR\share\clipart
562 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
563 File /a "..\..\inkscape\share\clipart\inkscape.logo.svg"
564 ;File /a "..\..\inkscape\share\clipart\inkscape.logo.classic.svg"
565 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
566 SetOutPath $INSTDIR\share\extensions
567 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
568 File /a "..\..\inkscape\share\extensions\pdf_output.inx.txt"
569 File /a "..\..\inkscape\share\extensions\pdf_output_via_gs_on_win32.inx.txt"
570 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
571 SetOutPath $INSTDIR\share\icons
572 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
573 File /a "..\..\inkscape\share\icons\inkscape.file.png"
574 File /a "..\..\inkscape\share\icons\inkscape.file.svg"
575 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
576 SetOutPath $INSTDIR\modules
577 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
578 File /nonfatal /a /r "..\..\inkscape\modules\*.*"
579 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
580 SetOutPath $INSTDIR\python
581 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
582 File /nonfatal /a /r "..\..\inkscape\python\*.*"
583 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
584 SectionEnd
586 Section $(lng_GTKFiles) SecGTK
588 DetailPrint "Installing GTK Files ..."
590 SectionIn 1 2 3 RO
591 SetOutPath $INSTDIR
592 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
593 SetOverwrite on
594 File /a /r "..\..\inkscape\*.dll"
595 File /a /r /x "locale" "..\..\inkscape\lib"
596 File /a /r "..\..\inkscape\etc"
597 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
598 SectionEnd
600 Section $(lng_Alluser) SecAlluser
601 ; disable this option in Win95/Win98/WinME
602 SectionIn 1 2 3
603 StrCpy $MultiUser "1"
604 StrCmp $MultiUser "1" "" SingleUser
605 DetailPrint "admin mode, registry root will be HKLM"
606 SetShellVarContext all
607 Goto endSingleUser
608 SingleUser:
609 DetailPrint "single user mode, registry root will be HKCU"
610 SetShellVarContext current
611 endSingleUser:
612 SectionEnd
614 SectionGroup $(lng_Shortcuts) SecShortcuts
616 Section /o $(lng_Desktop) SecDesktop
617 ClearErrors
618 CreateShortCut "$DESKTOP\Inkscape.lnk" "$INSTDIR\inkscape.exe"
619 IfErrors 0 +2
620 DetailPrint "Uups! Problems creating desktop shortcuts"
621 SectionEnd
623 Section /o $(lng_Quicklaunch) SecQuicklaunch
624 ClearErrors
625 StrCmp $QUICKLAUNCH $TEMP +2
626 CreateShortCut "$QUICKLAUNCH\Inkscape.lnk" "$INSTDIR\inkscape.exe"
627 IfErrors 0 +2
628 DetailPrint "Uups! Problems creating quicklaunch shortcuts"
629 SectionEnd
631 Section $(lng_SVGWriter) SecSVGWriter
632 SectionIn 1 2 3
633 ; create file associations, test before if needed
634 DetailPrint "creating file associations"
635 ClearErrors
636 ReadRegStr $0 HKCR ".svg" ""
637 StrCmp $0 "" 0 +3
638 WriteRegStr HKCR ".svg" "" "svgfile"
639 WriteRegStr HKCR "svgfile" "" "Scalable Vector Graphics file"
640 ReadRegStr $0 HKCR ".svgz" ""
641 StrCmp $0 "" 0 +3
642 WriteRegStr HKCR ".svgz" "" "svgfile"
643 WriteRegStr HKCR "svgfile" "" "Scalable Vector Graphics file"
644 IfErrors 0 +2
645 DetailPrint "Uups! Problems creating file assoziations for svg writer"
647 DetailPrint "creating default editor"
648 ClearErrors
649 ReadRegStr $0 HKCR ".svg" ""
650 WriteRegStr HKCR "$0\shell\edit\command" "" '"$INSTDIR\Inkscape.exe" "%1"'
651 ReadRegStr $0 HKCR ".svgz" ""
652 WriteRegStr HKCR "$0\shell\edit\command" "" '"$INSTDIR\Inkscape.exe" "%1"'
653 IfErrors 0 +2
654 DetailPrint "Uups! Problems creating default editor"
655 SectionEnd
657 Section $(lng_ContextMenu) SecContextMenu
658 SectionIn 1 2 3
659 ; create file associations, test before if needed
660 DetailPrint "creating file associations"
661 ClearErrors
662 ReadRegStr $0 HKCR ".svg" ""
663 StrCmp $0 "" 0 +3
664 WriteRegStr HKCR ".svg" "" "svgfile"
665 WriteRegStr HKCR "svgfile" "" "Scalable Vector Graphics file"
666 ReadRegStr $0 HKCR ".svgz" ""
667 StrCmp $0 "" 0 +3
668 WriteRegStr HKCR ".svgz" "" "svgfile"
669 WriteRegStr HKCR "svgfile" "" "Scalable Vector Graphics file"
670 IfErrors 0 +2
671 DetailPrint "Uups! Problems creating file assoziations for context menu"
673 DetailPrint "creating context menue"
674 ClearErrors
675 ReadRegStr $0 HKCR ".svg" ""
676 WriteRegStr HKCR "$0\shell\${PRODUCT_NAME}\command" "" '"$INSTDIR\Inkscape.exe" "%1"'
677 ReadRegStr $0 HKCR ".svgz" ""
678 WriteRegStr HKCR "$0\shell\${PRODUCT_NAME}\command" "" '"$INSTDIR\Inkscape.exe" "%1"'
679 IfErrors 0 +2
680 DetailPrint "Uups! Problems creating context menue integration"
682 SectionEnd
684 SectionGroupEnd
686 Section /o $(lng_DeletePrefs) SecPrefs
687 !insertmacro delprefs
688 SectionEnd
690 SectionGroup $(lng_Addfiles) SecAddfiles
692 Section $(lng_Examples) SecExamples
693 SectionIn 1 2
694 SetOutPath $INSTDIR\share
695 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
696 File /nonfatal /a /r /x "*.??*.???*" "..\..\inkscape\share\examples"
697 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
698 SectionEnd
700 Section $(lng_Tutorials) SecTutorials
701 SectionIn 1 2
702 SetOutPath $INSTDIR\share
703 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
704 File /nonfatal /a /r /x "*.??*.???*" "..\..\inkscape\share\tutorials"
705 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
706 SectionEnd
708 SectionGroupEnd
710 SectionGroup /e $(lng_Languages) SecLanguages
712 Section $(lng_am) SecAmharic
713 !insertmacro Language am am
714 SectionEnd
716 Section $(lng_az) SecAzerbaijani
717 !insertmacro Language az az
718 SectionEnd
720 Section $(lng_be) SecByelorussian
721 !insertmacro Language be be
722 SectionEnd
724 Section $(lng_bg) SecBulgarian
725 !insertmacro Language bg bg
726 SectionEnd
728 Section $(lng_bn) SecBengali
729 !insertmacro Language bn bn
730 SectionEnd
732 Section $(lng_ca) SecCatalan
733 !insertmacro Language ca ca
734 SectionEnd
736 Section $(lng_ca@valencia) SecCatalanValencia
737 !insertmacro Language ca@valencia ca@valencia
738 SectionEnd
740 Section $(lng_cs) SecCzech
741 !insertmacro Language cs cs
742 SectionEnd
744 Section $(lng_da) SecDanish
745 !insertmacro Language da da
746 SectionEnd
748 Section $(lng_de) SecGerman
749 !insertmacro Language 'de' 'de'
750 SectionEnd
752 Section $(lng_dz) SecDzongkha
753 !insertmacro Language dz dz
754 SectionEnd
756 Section $(lng_el) SecGreek
757 !insertmacro Language el el
758 SectionEnd
760 Section $(lng_en) SecEnglish
761 SectionIn 1 2 3 RO
762 SectionEnd
764 Section $(lng_en_AU) SecEnglishAustralian
765 !insertmacro Language en_AU en_AU
766 SectionEnd
768 Section $(lng_en_CA) SecEnglishCanadian
769 !insertmacro Language en_CA en_CA
770 SectionEnd
772 Section $(lng_en_GB) SecEnglishBritain
773 !insertmacro Language en_GB en_GB
774 SectionEnd
776 Section $(lng_en_US@piglatin) SecEnglishPiglatin
777 !insertmacro Language en_US@piglatin en_US@Piglatin
778 SectionEnd
780 Section $(lng_eo) SecEsperanto
781 !insertmacro Language eo eo
782 SectionEnd
784 Section $(lng_es) SecSpanish
785 !insertmacro Language 'es' 'es'
786 SectionEnd
788 Section $(lng_es_MX) SecSpanishMexico
789 !insertmacro Language 'es_MX' 'es_MX'
790 SectionEnd
792 Section $(lng_et) SecEstonian
793 !insertmacro Language et et
794 SectionEnd
796 Section $(lng_eu) SecBasque
797 !insertmacro Language eu eu
798 SectionEnd
800 Section $(lng_fr) SecFrench
801 !insertmacro Language 'fr' 'fr'
802 SectionEnd
804 Section $(lng_fi) SecFinnish
805 !insertmacro Language 'fi' 'fi'
806 SectionEnd
808 Section $(lng_ga) SecIrish
809 !insertmacro Language ga ga
810 SectionEnd
812 Section $(lng_gl) SecGallegan
813 !insertmacro Language gl gl
814 SectionIn 1 2 3
815 SectionEnd
817 Section $(lng_he) SecHebrew
818 !insertmacro Language he he
819 SectionIn 1 2 3
820 SectionEnd
822 Section $(lng_hr) SecCroatian
823 !insertmacro Language hr hr
824 SectionIn 1 2 3
825 SectionEnd
827 Section $(lng_hu) SecHungarian
828 !insertmacro Language hu hu
829 SectionIn 1 2 3
830 SectionEnd
832 Section $(lng_id) SecIndonesian
833 !insertmacro Language id id
834 SectionIn 1 2 3
835 SectionEnd
837 Section $(lng_it) SecItalian
838 !insertmacro Language it it
839 SectionIn 1 2 3
840 SectionEnd
842 Section $(lng_ja) SecJapanese
843 !insertmacro Language 'ja' 'jp'
844 SectionEnd
846 Section $(lng_km) SecKhmer
847 !insertmacro Language km km
848 SectionEnd
850 Section $(lng_ko) SecKorean
851 !insertmacro Language 'ko' 'ko'
852 SectionEnd
854 Section $(lng_lt) SecLithuanian
855 !insertmacro Language 'lt' 'lt'
856 SectionEnd
858 Section $(lng_mn) SecMongolian
859 !insertmacro Language mn mn
860 SectionEnd
862 Section $(lng_mk) SecMacedonian
863 !insertmacro Language mk mk
864 SectionEnd
866 Section $(lng_nb) SecNorwegianBokmal
867 !insertmacro Language nb nb
868 SectionEnd
870 Section $(lng_ne) SecNepali
871 !insertmacro Language ne ne
872 SectionEnd
874 Section $(lng_nl) SecDutch
875 !insertmacro Language nl nl
876 SectionEnd
878 Section $(lng_nn) SecNorwegianNynorsk
879 !insertmacro Language nn nn
880 SectionEnd
882 Section $(lng_pa) SecPanjabi
883 !insertmacro Language pa pa
884 SectionEnd
886 Section $(lng_pl) SecPolish
887 !insertmacro Language pl pl
888 SectionEnd
890 Section $(lng_pt) SecPortuguese
891 !insertmacro Language pt pt
892 SectionEnd
894 Section $(lng_pt_BR) SecPortugueseBrazil
895 !insertmacro Language pt_BR pt_BR
896 SectionEnd
898 Section $(lng_ro) SecRomanian
899 !insertmacro Language ro ro
900 SectionEnd
902 Section $(lng_ru) SecRussian
903 !insertmacro Language ru ru
904 SectionEnd
906 Section $(lng_rw) SecKinyarwanda
907 !insertmacro Language rw rw
908 SectionEnd
910 Section $(lng_sk) SecSlovak
911 !insertmacro Language sk sk
912 SectionEnd
914 Section $(lng_sl) SecSlovenian
915 !insertmacro Language sl sl
916 SectionEnd
918 Section $(lng_sq) SecAlbanian
919 !insertmacro Language sq sq
920 SectionEnd
922 Section $(lng_sr) SecSerbian
923 !insertmacro Language sr sr
924 SectionEnd
926 Section $(lng_sr@Latn) SecSerbianLatin
927 !insertmacro Language 'sr@Latn' 'sr@Latn'
928 SectionEnd
930 Section $(lng_sv) SecSwedish
931 !insertmacro Language sv sv
932 SectionEnd
934 Section $(lng_th) SecThai
935 !insertmacro Language th th
936 SectionEnd
938 Section $(lng_tr) SecTurkish
939 !insertmacro Language tr tr
940 SectionEnd
942 Section $(lng_uk) SecUkrainian
943 !insertmacro Language uk uk
944 SectionEnd
946 Section $(lng_vi) SecVietnamese
947 !insertmacro Language vi vi
948 SectionEnd
950 Section $(lng_zh_CN) SecChineseSimplified
951 !insertmacro Language zh_CN zh_CN
952 SectionEnd
954 Section $(lng_zh_TW) SecChineseTaiwan
955 !insertmacro Language zh_TW zh_TW
956 SectionEnd
958 SectionGroupEnd
961 Section -FinalizeInstallation
962 DetailPrint "finalize installation"
963 StrCmp $MultiUser "1" "" SingleUser
964 DetailPrint "admin mode, registry root will be HKLM"
965 SetShellVarContext all
966 Goto endSingleUser
967 SingleUser:
968 DetailPrint "single user mode, registry root will be HKCU"
969 SetShellVarContext current
970 endSingleUser:
972 ; check for writing registry
973 ClearErrors
974 WriteRegStr SHCTX "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\inkscape.exe"
975 ;IfErrors 0 +4
976 ; DetailPrint "fatal: failed to write to ${PRODUCT_DIR_REGKEY}"
977 ; DetailPrint "aborting installation"
978 ; Abort
979 WriteRegStr SHCTX "${PRODUCT_DIR_REGKEY}" "MultiUser" "$MultiUser"
980 WriteRegStr SHCTX "${PRODUCT_DIR_REGKEY}" "askMultiUser" "$askMultiUser"
981 WriteRegStr SHCTX "${PRODUCT_DIR_REGKEY}" "User" "$User"
982 IfErrors 0 +2
983 DetailPrint "fatal: failed to write to registry installation info"
985 ; start menu entries
986 ClearErrors
987 CreateShortCut "$SMPROGRAMS\Inkscape.lnk" "$INSTDIR\inkscape.exe"
988 IfErrors 0 +2
989 DetailPrint "fatal: failed to write to start menu info"
991 ; uninstall settings
992 ClearErrors
993 ; WriteUninstaller "$INSTDIR\uninst.exe"
994 WriteRegExpandStr SHCTX "${PRODUCT_UNINST_KEY}" "UninstallString" "${UNINST_EXE}"
995 WriteRegExpandStr SHCTX "${PRODUCT_UNINST_KEY}" "InstallDir" "$INSTDIR"
996 WriteRegExpandStr SHCTX "${PRODUCT_UNINST_KEY}" "InstallLocation" "$INSTDIR"
997 WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "DisplayName" "${PRODUCT_NAME} ${PRODUCT_VERSION}"
998 WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\Inkscape.exe,0"
999 WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
1000 WriteRegDWORD SHCTX "${PRODUCT_UNINST_KEY}" "NoModify" "1"
1001 WriteRegDWORD SHCTX "${PRODUCT_UNINST_KEY}" "NoRepair" "1"
1002 IfErrors 0 +2
1003 DetailPrint "fatal: failed to write to registry un-installation info"
1005 ;create/update log always within .onInstSuccess function
1006 !insertmacro UNINSTALL.LOG_UPDATE_INSTALL
1008 DetailPrint "create MD5 sums"
1009 ClearErrors
1010 FileOpen $0 $INSTDIR\uninstall.dat r
1011 FileOpen $9 $INSTDIR\uninstall.log w
1012 IfErrors doneinstall
1013 readnextlineinstall:
1014 ClearErrors
1015 FileRead $0 $1
1016 IfErrors doneinstall
1017 StrCpy $1 $1 -2
1018 ;DetailPrint $1
1019 md5dll::GetMD5File /NOUNLOAD $1
1020 Pop $2
1021 ;DetailPrint $2
1022 StrCmp $2 "" +2
1023 FileWrite $9 "$2 $1$\r$\n"
1024 Goto readnextlineinstall
1025 doneinstall:
1026 FileClose $0
1027 FileClose $9
1028 ; this file is not needed anymore
1029 Delete $INSTDIR\uninstall.dat
1031 SectionEnd
1033 ; Last the Descriptions
1034 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
1035 !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} $(lng_CoreDesc)
1036 !insertmacro MUI_DESCRIPTION_TEXT ${SecGTK} $(lng_GTKFilesDesc)
1037 !insertmacro MUI_DESCRIPTION_TEXT ${SecShortcuts} $(lng_ShortcutsDesc)
1038 !insertmacro MUI_DESCRIPTION_TEXT ${SecAlluser} $(lng_AlluserDesc)
1039 !insertmacro MUI_DESCRIPTION_TEXT ${SecDesktop} $(lng_DesktopDesc)
1040 !insertmacro MUI_DESCRIPTION_TEXT ${SecQuicklaunch} $(lng_QuicklaunchDesc)
1041 !insertmacro MUI_DESCRIPTION_TEXT ${SecSVGWriter} $(lng_SVGWriterDesc)
1042 !insertmacro MUI_DESCRIPTION_TEXT ${SecContextMenu} $(lng_ContextMenuDesc)
1043 !insertmacro MUI_DESCRIPTION_TEXT ${SecPrefs} $(lng_DeletePrefsDesc)
1044 !insertmacro MUI_DESCRIPTION_TEXT ${SecAddfiles} $(lng_AddfilesDesc)
1045 !insertmacro MUI_DESCRIPTION_TEXT ${SecExamples} $(lng_ExamplesDesc)
1046 !insertmacro MUI_DESCRIPTION_TEXT ${SecTutorials} $(lng_TutorialsDesc)
1047 !insertmacro MUI_DESCRIPTION_TEXT ${SecLanguages} $(lng_LanguagesDesc)
1048 !insertmacro MUI_FUNCTION_DESCRIPTION_END
1050 !macro Parameter key Section
1051 Push ${key}
1052 Push ""
1053 Call GetParameterValue
1054 Pop $1
1055 StrCmp $1 "OFF" 0 +5
1056 SectionGetFlags ${Section} $0
1057 IntOp $2 ${SF_SELECTED} ~
1058 IntOp $0 $0 & $2
1059 SectionSetFlags ${Section} $0
1060 StrCmp $1 "ON" 0 +4
1061 SectionGetFlags ${Section} $0
1062 IntOp $0 $0 | ${SF_SELECTED}
1063 SectionSetFlags ${Section} $0
1064 !macroend
1066 Function .onInit
1067 ;prepare log always within .onInit function
1068 !insertmacro UNINSTALL.LOG_PREPARE_INSTALL
1070 ;Extract InstallOptions INI files
1071 StrCpy $AskMultiUser "1"
1072 StrCpy $MultiUser "0"
1073 ; this resets AskMultiUser if Win95/98/ME
1074 Call GetWindowsVersion
1075 Pop $R0
1076 DetailPrint "detected operating system $R0"
1077 ;MessageBox MB_OK "operating system: $R0; AskMultiuser: $AskMultiUser"
1079 ; hide all user section if win98
1080 StrCmp $AskMultiUser "1" +2
1081 SectionSetText ${SecAlluser} ""
1083 ; hide if quick launch if not available
1084 StrCmp $QUICKLAUNCH $TEMP 0 +2
1085 SectionSetText ${SecQuicklaunch} ""
1087 ;check if user is admin
1088 ClearErrors
1089 UserInfo::GetName
1090 IfErrors info_Win9x
1091 Pop $0
1092 StrCpy $User $0
1093 UserInfo::GetAccountType
1094 Pop $1
1095 StrCmp $1 "Admin" info_done
1097 MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "$(lng_NO_ADMIN)$(lng_OK_CANCEL_DESC)" /SD IDOK IDOK info_done IDCANCEL +1
1098 Quit
1100 Goto info_done
1102 info_Win9x:
1103 # This one means you don't need to care about admin or
1104 # not admin because Windows 9x doesn't either
1105 MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "$(lng_NOT_SUPPORTED)$(lng_OK_CANCEL_DESC)" /SD IDOK IDOK info_done IDCANCEL +1
1106 Quit
1108 info_done:
1110 ;check for previous installation
1111 ReadRegStr $0 HKLM "${PRODUCT_DIR_REGKEY}" "User"
1112 StrCmp $0 "" +1 +2
1113 ReadRegStr $0 HKCU "${PRODUCT_DIR_REGKEY}" "User"
1114 ;check user if applicable
1115 StrCmp $0 "" diff_user_install_done
1116 StrCmp $0 $User diff_user_install_done
1117 MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "$(lng_DIFFERENT_USER)$(lng_OK_CANCEL_DESC)" /SD IDOK IDOK diff_user_install_done IDCANCEL +1
1118 Quit
1119 diff_user_install_done:
1121 ; call uninstall first
1122 ; code taken from the vlc project
1123 ReadRegStr $R0 HKLM ${PRODUCT_UNINST_KEY} "UninstallString"
1124 ReadRegStr $R1 HKLM ${PRODUCT_UNINST_KEY} "DisplayName"
1125 StrCmp $R0 "" +1 +3
1126 ReadRegStr $R0 HKCU ${PRODUCT_UNINST_KEY} "UninstallString"
1127 ReadRegStr $R1 HKCU ${PRODUCT_UNINST_KEY} "DisplayName"
1128 StrCmp $R0 "" uninstall_before_done
1130 MessageBox MB_YESNO|MB_ICONEXCLAMATION $(lng_WANT_UNINSTALL_BEFORE) /SD IDNO IDNO uninstall_before_done
1131 ;Run the uninstaller
1132 ;uninst:
1133 DetailPrint "execute $R0 in $INSTDIR"
1134 ClearErrors
1135 ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
1136 uninstall_before_done:
1138 ; proccess command line parameter
1139 !insertmacro Parameter "GTK" ${SecGTK}
1140 !insertmacro Parameter "SHORTCUTS" ${secShortcuts}
1141 !insertmacro Parameter "ALLUSER" ${SecAlluser}
1142 !insertmacro Parameter "DESKTOP" ${SecDesktop}
1143 !insertmacro Parameter "QUICKLAUNCH" ${SecQUICKlaunch}
1144 !insertmacro Parameter "SVGEDITOR" ${SecSVGWriter}
1145 !insertmacro Parameter "CONTEXTMENUE" ${SecContextMenu}
1146 !insertmacro Parameter "PREFERENCES" ${SecPrefs}
1147 !insertmacro Parameter "ADDFILES" ${SecAddfiles}
1148 !insertmacro Parameter "EXAMPLES" ${SecExamples}
1149 !insertmacro Parameter "TUTORIALS" ${SecTutorials}
1150 !insertmacro Parameter "LANGUAGES" ${SecLanguages}
1151 !insertmacro Parameter "am" ${SecAmharic}
1152 !insertmacro Parameter "az" ${SecAzerbaijani}
1153 !insertmacro Parameter "be" ${SecByelorussian}
1154 !insertmacro Parameter "bg" ${SecBulgarian}
1155 !insertmacro Parameter "bn" ${SecBengali}
1156 !insertmacro Parameter "ca" ${SecCatalan}
1157 !insertmacro Parameter "ca@valencia" ${SecCatalanValencia}
1158 !insertmacro Parameter "cs" ${SecCzech}
1159 !insertmacro Parameter "da" ${SecDanish}
1160 !insertmacro Parameter "de" ${SecGerman}
1161 !insertmacro Parameter "dz" ${SecDzongkha}
1162 !insertmacro Parameter "el" ${SecGreek}
1163 !insertmacro Parameter "en_AU" ${SecEnglishAustralian}
1164 !insertmacro Parameter "en_CA" ${SecEnglishCanadian}
1165 !insertmacro Parameter "en_GB" ${SecEnglishBritain}
1166 !insertmacro Parameter "en_US@piglatin" ${SecEnglishPiglatin}
1167 !insertmacro Parameter "eo" ${SecEsperanto}
1168 !insertmacro Parameter "es" ${SecSpanish}
1169 !insertmacro Parameter "es_MX" ${SecSpanishMexico}
1170 !insertmacro Parameter "et" ${SecEstonian}
1171 !insertmacro Parameter "eu" ${SecBasque}
1172 !insertmacro Parameter "fi" ${SecFinnish}
1173 !insertmacro Parameter "fr" ${SecFrench}
1174 !insertmacro Parameter "ga" ${SecIrish}
1175 !insertmacro Parameter "gl" ${SecGallegan}
1176 !insertmacro Parameter "he" ${SecHebrew}
1177 !insertmacro Parameter "hr" ${SecCroatian}
1178 !insertmacro Parameter "hu" ${SecHungarian}
1179 !insertmacro Parameter "id" ${SecIndonesian}
1180 !insertmacro Parameter "it" ${SecItalian}
1181 !insertmacro Parameter "ja" ${SecJapanese}
1182 !insertmacro Parameter "km" ${SecKhmer}
1183 !insertmacro Parameter "ko" ${SecKorean}
1184 !insertmacro Parameter "lt" ${SecLithuanian}
1185 !insertmacro Parameter "mk" ${SecMacedonian}
1186 !insertmacro Parameter "mn" ${SecMongolian}
1187 !insertmacro Parameter "nb" ${SecNorwegianBokmal}
1188 !insertmacro Parameter "ne" ${SecNepali}
1189 !insertmacro Parameter "nl" ${SecDutch}
1190 !insertmacro Parameter "nn" ${SecNorwegianNynorsk}
1191 !insertmacro Parameter "pa" ${SecPanjabi}
1192 !insertmacro Parameter "pl" ${SecPolish}
1193 !insertmacro Parameter "pt" ${SecPortuguese}
1194 !insertmacro Parameter "pt_BR" ${SecPortugueseBrazil}
1195 !insertmacro Parameter "ro" ${SecRomanian}
1196 !insertmacro Parameter "ru" ${SecRussian}
1197 !insertmacro Parameter "rw" ${SecKinyarwanda}
1198 !insertmacro Parameter "sk" ${SecSlovak}
1199 !insertmacro Parameter "sl" ${SecSlovenian}
1200 !insertmacro Parameter "sq" ${SecAlbanian}
1201 !insertmacro Parameter "sr" ${SecSerbian}
1202 !insertmacro Parameter "sr@Latn" ${SecSerbianLatin}
1203 !insertmacro Parameter "sv" ${SecSwedish}
1204 !insertmacro Parameter "th" ${SecThai}
1205 !insertmacro Parameter "tr" ${SecTurkish}
1206 !insertmacro Parameter "uk" ${SecUkrainian}
1207 !insertmacro Parameter "vi" ${SecVietnamese}
1208 !insertmacro Parameter "zh_CN" ${SecChineseSimplified}
1209 !insertmacro Parameter "zh_TW" ${SecChineseTaiwan}
1211 Push "?"
1212 Push "TEST"
1213 Call GetParameterValue
1214 Pop $1
1215 StrCmp $1 "TEST" +3
1216 MessageBox MB_OK "possible parameters for installer:$\r$\n \
1217 /?: this help screen$\r$\n \
1218 /S: silent$\r$\n \
1219 /D=(directory): where to install inkscape$\r$\n \
1220 /GTK=(OFF/ON): GTK+ Runtime environment$\r$\n \
1221 /SHORTCUTS=(OFF/ON): shortcuts to start inkscape$\r$\n \
1222 /ALLUSER=(OFF/ON): for all users on the computer$\r$\n \
1223 /DESKTOP=(OFF/ON): Desktop icon$\r$\n \
1224 /QUICKLAUNCH=(OFF/ON): quick launch icon$\r$\n \
1225 /SVGEDITOR=(OFF/ON): default SVG editor$\r$\n \
1226 /CONTEXTMENUE=(OFF/ON): context menue integration$\r$\n \
1227 /PREFERENCES=(OFF/ON): delete users preference files$\r$\n \
1228 /ADDFILES=(OFF/ON): additional files$\r$\n \
1229 /EXAMPLES=(OFF/ON): examples$\r$\n \
1230 /TUTORIALS=(OFF/ON): tutorials$\r$\n \
1231 /LANGUAGES=(OFF/ON): translated menues, examples, etc.$\r$\n \
1232 /[locale code]=(OFF/ON): e.g am, es, es_MX as in Inkscape supported"
1233 Abort
1234 FunctionEnd
1236 Function .onSelChange
1237 FunctionEnd
1240 Function .onInstSuccess
1242 FunctionEnd
1244 ; --------------------------------------------------
1246 Function un.CustomPageUninstall
1247 !insertmacro MUI_HEADER_TEXT "$(lng_UInstOpt)" "$(lng_UInstOpt1)"
1248 !insertmacro MUI_INSTALLOPTIONS_WRITE "inkscape.nsi.uninstall" "Field 1" "Text" "$APPDATA\Inkscape\"
1249 !insertmacro MUI_INSTALLOPTIONS_WRITE "inkscape.nsi.uninstall" "Field 2" "Text" "$(lng_PurgePrefs)"
1251 !insertmacro MUI_INSTALLOPTIONS_DISPLAY "inkscape.nsi.uninstall"
1252 !insertmacro MUI_INSTALLOPTIONS_READ $MultiUser "inkscape.nsi.uninstall" "Field 2" "State"
1253 DetailPrint "keepfiles = $MultiUser"
1254 ;MessageBox MB_OK "adminmode = $MultiUser MultiUserOS = $askMultiUser"
1256 FunctionEnd
1259 Function un.onInit
1260 ;begin uninstall, could be added on top of uninstall section instead
1261 ;!insertmacro UNINSTALL.LOG_BEGIN_UNINSTALL
1262 IfFileExists $INSTDIR\uninstall.log uninstalllogpresent
1263 MessageBox MB_OK|MB_ICONEXCLAMATION "$(lng_UninstallLogNotFound)" /SD IDOK
1264 Quit
1265 uninstalllogpresent:
1266 ClearErrors
1267 StrCpy $User ""
1268 UserInfo::GetName
1269 IfErrors +3
1270 Pop $0
1271 StrCpy $User $0
1273 StrCpy $askMultiUser "1"
1274 StrCpy $MultiUser "1"
1276 ; Test if this was a multiuser installation
1277 ReadRegStr $0 HKLM "${PRODUCT_DIR_REGKEY}" ""
1278 StrCmp $0 "$INSTDIR\inkscape.exe" 0 hkcu_user_uninstall
1279 ReadRegStr $MultiUser HKLM "${PRODUCT_DIR_REGKEY}" "MultiUser"
1280 ReadRegStr $askMultiUser HKLM "${PRODUCT_DIR_REGKEY}" "askMultiUser"
1281 ReadRegStr $0 HKLM "${PRODUCT_DIR_REGKEY}" "User"
1282 Goto check_user_uninstall
1283 hkcu_user_uninstall:
1284 ReadRegStr $MultiUser HKCU "${PRODUCT_DIR_REGKEY}" "MultiUser"
1285 ReadRegStr $askMultiUser HKCU "${PRODUCT_DIR_REGKEY}" "askMultiUser"
1286 ReadRegStr $0 HKCU "${PRODUCT_DIR_REGKEY}" "User"
1287 ;check user if applicable
1288 check_user_uninstall:
1289 StrCmp $0 "" diff_user_uninstall_done
1290 StrCmp $0 $User diff_user_uninstall_done
1291 MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "$(lng_DIFFERENT_USER)$(lng_OK_CANCEL_DESC)" /SD IDOK IDOK diff_user_uninstall_done IDCANCEL +1
1292 Quit
1293 diff_user_uninstall_done:
1295 !insertmacro MUI_INSTALLOPTIONS_EXTRACT "inkscape.nsi.uninstall"
1297 ;check whether Multi user installation ?
1298 SetShellVarContext all
1299 StrCmp $MultiUser "0" 0 +2
1300 SetShellVarContext current
1301 ;MessageBox MB_OK "adminmode = $MultiUser MultiUserOS = $askMultiUser"
1303 FunctionEnd
1305 # removes a file and if the directory is empty afterwards the directory also
1306 # push md5, push filename, call unremovefilename
1307 Function un.RemoveFile
1308 Var /Global filename
1309 Var /Global md5sum
1310 Var /Global ismd5sum
1311 Var /Global removenever ; never remove a touched file
1312 Var /Global removealways ; always remove files touched by user
1313 Pop $filename
1314 Pop $md5sum
1316 IfFileExists $filename +2 0
1317 Return
1318 StrCmp $removealways "always" unremovefile 0
1319 md5dll::GetMD5File /NOUNLOAD $filename
1320 Pop $ismd5sum ;md5 of file
1321 StrCmp $md5sum $ismd5sum unremovefile 0
1322 ;DetailPrint "uups MD5 does not match"
1323 StrCmp $removenever "never" 0 +2
1324 Return
1325 ; the md5 sums does not match so we ask
1326 messagebox::show MB_DEFBUTTON3|MB_TOPMOST "" "0,103" \
1327 "$(lng_FileChanged)" "$(lng_Yes)" "$(lng_AlwaysYes)" "$(lng_No)" "$(lng_AlwaysNo)"
1328 ;DetailPrint "messagebox finished"
1329 Pop $md5sum
1330 ;DetailPrint "messagebox call returned... $md5sum"
1331 StrCmp $md5sum "1" unremovefile 0 ; Yes
1332 StrCmp $md5sum "2" 0 unremoveno ; Yes always
1333 StrCpy $removealways "always"
1334 ;DetailPrint "removealways"
1335 Goto unremovefile
1336 unremoveno:
1337 StrCmp $md5sum "3" 0 unremovenever ; No
1338 ;DetailPrint "No remove"
1339 Return
1340 unremovenever:
1341 StrCpy $removenever "never"
1342 ;DetailPrint "removenever"
1343 Return
1344 unremovefile:
1345 ;DetailPrint "removefile"
1346 ClearErrors
1347 Delete $filename
1348 ;now recursivly remove the path
1349 unrmdir:
1350 ${un.GetParent} $filename $filename
1351 IfErrors 0 +2
1352 Return
1353 RMDir $filename
1354 IfErrors +2
1355 Goto unrmdir
1356 FunctionEnd
1358 Section Uninstall
1360 ; remove personal settings
1361 Delete "$APPDATA\Inkscape\extension-errors.log"
1362 StrCmp $MultiUser "0" 0 endPurge ; multiuser assigned in dialog
1363 DetailPrint "purge personal settings in $APPDATA\Inkscape"
1364 ;RMDir /r "$APPDATA\Inkscape"
1365 !insertmacro delprefs
1366 endPurge:
1368 ; Remove file associations for svg editor
1369 DetailPrint "removing file associations for svg editor"
1370 ClearErrors
1371 ReadRegStr $0 HKCR ".svg" ""
1372 DetailPrint ".svg associated as $0"
1373 IfErrors endUninstSVGEdit
1374 ReadRegStr $1 HKCR "$0\shell\edit\command" ""
1375 IfErrors 0 +2
1376 DetailPrint "svg editor is $1"
1377 StrCmp $1 '"$INSTDIR\Inkscape.exe" "%1"' 0 +3
1378 DetailPrint "removing default .svg editor"
1379 DeleteRegKey HKCR "$0\shell\edit\command"
1380 DeleteRegKey /ifempty HKCR "$0\shell\edit"
1381 DeleteRegKey /ifempty HKCR "$0\shell"
1382 DeleteRegKey /ifempty HKCR "$0"
1383 endUninstSVGEdit:
1385 ClearErrors
1386 ReadRegStr $2 HKCR ".svgz" ""
1387 DetailPrint ".svgz associated as $2"
1388 IfErrors endUninstSVGZEdit
1389 ReadRegStr $3 HKCR "$2\shell\edit\command" ""
1390 IfErrors 0 +2
1391 DetailPrint "svgz editor is $1"
1392 StrCmp $3 '"$INSTDIR\Inkscape.exe" "%1"' 0 +3
1393 DetailPrint "removing default .svgz editor"
1394 DeleteRegKey HKCR "$2\shell\edit\command"
1395 DeleteRegKey /ifempty HKCR "$2\shell\edit"
1396 DeleteRegKey /ifempty HKCR "$2\shell"
1397 DeleteRegKey /ifempty HKCR "$2"
1398 endUninstSVGZEdit:
1400 ; Remove file associations for svg editor
1401 DetailPrint "removing file associations for svg editor"
1402 ClearErrors
1403 ReadRegStr $0 HKCR ".svg" ""
1404 IfErrors endUninstSVGView
1405 ReadRegStr $1 HKCR "$0\shell\open\command" ""
1406 IfErrors 0 +2
1407 DetailPrint "svg viewer is $1"
1408 StrCmp $1 '"$INSTDIR\Inkscape.exe" "%1"' 0 +3
1409 DetailPrint "removing default .svg viewer"
1410 DeleteRegKey HKCR "$0\shell\open\command"
1411 DeleteRegKey /ifempty HKCR "$0\shell\open"
1412 DeleteRegKey /ifempty HKCR "$0\shell"
1413 DeleteRegKey /ifempty HKCR "$0"
1414 endUninstSVGView:
1416 ClearErrors
1417 ReadRegStr $2 HKCR ".svgz" ""
1418 IfErrors endUninstSVGZView
1419 ReadRegStr $3 HKCR "$2\shell\open\command" ""
1420 IfErrors 0 +2
1421 DetailPrint "svgz viewer is $1"
1422 StrCmp $3 '"$INSTDIR\Inkscape.exe" "%1"' 0 +3
1423 DetailPrint "removing default .svgz viewer"
1424 DeleteRegKey HKCR "$2\shell\open\command"
1425 DeleteRegKey /ifempty HKCR "$2\shell\open"
1426 DeleteRegKey /ifempty HKCR "$2\shell"
1427 DeleteRegKey /ifempty HKCR "$2"
1428 endUninstSVGZView:
1430 ; Remove file associations for context menue
1431 DetailPrint "removing file associations for svg editor"
1432 ClearErrors
1433 ReadRegStr $0 HKCR ".svg" ""
1434 IfErrors endUninstSVGContext
1435 DetailPrint "removing default .svg context menue"
1436 DeleteRegKey HKCR "$0\shell\${PRODUCT_NAME}"
1437 DeleteRegKey /ifempty HKCR "$0\shell"
1438 DeleteRegKey /ifempty HKCR "$0"
1439 endUninstSVGContext:
1441 ClearErrors
1442 ReadRegStr $2 HKCR ".svgz" ""
1443 IfErrors endUninstSVGZContext
1444 DetailPrint "removing default .svgzcontext menue"
1445 DeleteRegKey HKCR "$2\shell\${PRODUCT_NAME}"
1446 DeleteRegKey /ifempty HKCR "$2\shell"
1447 DeleteRegKey /ifempty HKCR "$2"
1448 endUninstSVGZContext:
1450 ReadRegStr $1 HKCR "$0" ""
1451 StrCmp $1 "" 0 +3
1452 DetailPrint "removing filetype .svg $0"
1453 DeleteRegKey HKCR ".svg"
1455 ReadRegStr $3 HKCR "$2" ""
1456 StrCmp $3 "" 0 +3
1457 DetailPrint "removing filetype .svgz $2"
1458 DeleteRegKey HKCR ".svgz"
1461 SetShellVarContext all
1462 DetailPrint "removing product regkey"
1463 DeleteRegKey SHCTX "${PRODUCT_DIR_REGKEY}"
1464 DetailPrint "removing uninstall info"
1465 DeleteRegKey SHCTX "${PRODUCT_UNINST_KEY}"
1466 DetailPrint "removing shortcuts"
1467 Delete "$DESKTOP\Inkscape.lnk"
1468 Delete "$QUICKLAUNCH\Inkscape.lnk"
1469 Delete "$SMPROGRAMS\Inkscape.lnk"
1470 ;just in case they are still there
1471 Delete "$SMPROGRAMS\Inkscape\Uninstall Inkscape.lnk"
1472 Delete "$SMPROGRAMS\Inkscape\Inkscape.lnk"
1473 RMDir "$SMPROGRAMS\Inkscape"
1475 SetShellVarContext current
1476 DetailPrint "removing product regkey"
1477 DeleteRegKey SHCTX "${PRODUCT_DIR_REGKEY}"
1478 DetailPrint "removing uninstall info"
1479 DeleteRegKey SHCTX "${PRODUCT_UNINST_KEY}"
1480 DetailPrint "removing shortcuts"
1481 Delete "$DESKTOP\Inkscape.lnk"
1482 Delete "$QUICKLAUNCH\Inkscape.lnk"
1483 Delete "$SMPROGRAMS\Inkscape.lnk"
1484 ;just in case they are still there
1485 Delete "$SMPROGRAMS\Inkscape\Uninstall Inkscape.lnk"
1486 Delete "$SMPROGRAMS\Inkscape\Inkscape.lnk"
1487 RMDir "$SMPROGRAMS\Inkscape"
1489 DetailPrint "removing uninstall info"
1491 ;uninstall from path, must be repeated for every install logged path individual
1492 ;!insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\lib\locale"
1493 ;!insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\locale"
1494 ;!insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\doc"
1495 ;!insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\share\tutorials"
1496 ;!insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\share\templates"
1497 ;!insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\share\screens"
1498 ;!insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\share\clipart"
1499 ;!insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\share\extensions"
1500 ;!insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\share\icons"
1501 ;!insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\share"
1502 ;!insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\modules"
1503 ;!insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\python"
1504 ;!insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR"
1506 ;end uninstall, after uninstall from all logged paths has been performed
1507 ;!insertmacro UNINSTALL.LOG_END_UNINSTALL
1509 ;RMDir /r "$INSTDIR"
1511 StrCpy $removenever ""
1512 StrCpy $removealways ""
1514 InitPluginsDir
1515 SetPluginUnload manual
1517 ClearErrors
1518 FileOpen $0 $INSTDIR\uninstall.log r
1519 IfErrors uninstallnotfound
1520 readnextline:
1521 ClearErrors
1522 FileRead $0 $1
1523 IfErrors done
1524 ; cat the line into md5 and filename
1525 StrLen $2 $1
1526 IntCmp $2 35 readnextline readnextline
1527 StrCpy $3 $1 32
1528 StrCpy $4 $1 $2-36 34 #remove trailing CR/LF
1529 StrCpy $4 $4 -2
1530 Push $3
1531 Push $4
1532 Call un.RemoveFile
1533 Goto readnextline
1534 uninstallnotfound:
1535 MessageBox MB_OK|MB_ICONEXCLAMATION "$(lng_UninstallLogNotFound)" /SD IDOK
1536 done:
1537 FileClose $0
1539 Delete "$INSTDIR\uninstall.log"
1540 Delete "$INSTDIR\uninstall.exe"
1541 ; remove empty directories
1542 RMDir "$INSTDIR\data"
1543 RMDir "$INSTDIR\doc"
1544 RMDir "$INSTDIR\modules"
1545 RMDir "$INSTDIR\plugins"
1547 RMDir $INSTDIR
1549 SetAutoClose false
1551 SectionEnd