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+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}"
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_ar) SecArabic
717 !insertmacro Language ar ar
718 SectionEnd
720 Section $(lng_az) SecAzerbaijani
721 !insertmacro Language az az
722 SectionEnd
724 Section $(lng_be) SecByelorussian
725 !insertmacro Language be be
726 SectionEnd
728 Section $(lng_bg) SecBulgarian
729 !insertmacro Language bg bg
730 SectionEnd
732 Section $(lng_bn) SecBengali
733 !insertmacro Language bn bn
734 SectionEnd
736 Section $(lng_br) SecBreton
737 !insertmacro Language br br
738 SectionEnd
740 Section $(lng_ca) SecCatalan
741 !insertmacro Language ca ca
742 SectionEnd
744 Section $(lng_ca@valencia) SecCatalanValencia
745 !insertmacro Language ca@valencia ca@valencia
746 SectionEnd
748 Section $(lng_cs) SecCzech
749 !insertmacro Language cs cs
750 SectionEnd
752 Section $(lng_da) SecDanish
753 !insertmacro Language da da
754 SectionEnd
756 Section $(lng_de) SecGerman
757 !insertmacro Language 'de' 'de'
758 SectionEnd
760 Section $(lng_dz) SecDzongkha
761 !insertmacro Language dz dz
762 SectionEnd
764 Section $(lng_el) SecGreek
765 !insertmacro Language el el
766 SectionEnd
768 Section $(lng_en) SecEnglish
769 SectionIn 1 2 3 RO
770 SectionEnd
772 Section $(lng_en_AU) SecEnglishAustralian
773 !insertmacro Language en_AU en_AU
774 SectionEnd
776 Section $(lng_en_CA) SecEnglishCanadian
777 !insertmacro Language en_CA en_CA
778 SectionEnd
780 Section $(lng_en_GB) SecEnglishBritain
781 !insertmacro Language en_GB en_GB
782 SectionEnd
784 Section $(lng_en_US@piglatin) SecEnglishPiglatin
785 !insertmacro Language en_US@piglatin en_US@Piglatin
786 SectionEnd
788 Section $(lng_eo) SecEsperanto
789 !insertmacro Language eo eo
790 SectionEnd
792 Section $(lng_es) SecSpanish
793 !insertmacro Language 'es' 'es'
794 SectionEnd
796 Section $(lng_es_MX) SecSpanishMexico
797 !insertmacro Language 'es_MX' 'es_MX'
798 SectionEnd
800 Section $(lng_et) SecEstonian
801 !insertmacro Language et et
802 SectionEnd
804 Section $(lng_eu) SecBasque
805 !insertmacro Language eu eu
806 SectionEnd
808 Section $(lng_fr) SecFrench
809 !insertmacro Language 'fr' 'fr'
810 SectionEnd
812 Section $(lng_fi) SecFinnish
813 !insertmacro Language 'fi' 'fi'
814 SectionEnd
816 Section $(lng_ga) SecIrish
817 !insertmacro Language ga ga
818 SectionEnd
820 Section $(lng_gl) SecGallegan
821 !insertmacro Language gl gl
822 SectionIn 1 2 3
823 SectionEnd
825 Section $(lng_he) SecHebrew
826 !insertmacro Language he he
827 SectionIn 1 2 3
828 SectionEnd
830 Section $(lng_hr) SecCroatian
831 !insertmacro Language hr hr
832 SectionIn 1 2 3
833 SectionEnd
835 Section $(lng_hu) SecHungarian
836 !insertmacro Language hu hu
837 SectionIn 1 2 3
838 SectionEnd
840 Section $(lng_id) SecIndonesian
841 !insertmacro Language id id
842 SectionIn 1 2 3
843 SectionEnd
845 Section $(lng_it) SecItalian
846 !insertmacro Language it it
847 SectionIn 1 2 3
848 SectionEnd
850 Section $(lng_ja) SecJapanese
851 !insertmacro Language 'ja' 'jp'
852 SectionEnd
854 Section $(lng_km) SecKhmer
855 !insertmacro Language km km
856 SectionEnd
858 Section $(lng_ko) SecKorean
859 !insertmacro Language 'ko' 'ko'
860 SectionEnd
862 Section $(lng_lt) SecLithuanian
863 !insertmacro Language 'lt' 'lt'
864 SectionEnd
866 Section $(lng_mn) SecMongolian
867 !insertmacro Language mn mn
868 SectionEnd
870 Section $(lng_mk) SecMacedonian
871 !insertmacro Language mk mk
872 SectionEnd
874 Section $(lng_nb) SecNorwegianBokmal
875 !insertmacro Language nb nb
876 SectionEnd
878 Section $(lng_ne) SecNepali
879 !insertmacro Language ne ne
880 SectionEnd
882 Section $(lng_nl) SecDutch
883 !insertmacro Language nl nl
884 SectionEnd
886 Section $(lng_nn) SecNorwegianNynorsk
887 !insertmacro Language nn nn
888 SectionEnd
890 Section $(lng_pa) SecPanjabi
891 !insertmacro Language pa pa
892 SectionEnd
894 Section $(lng_pl) SecPolish
895 !insertmacro Language pl pl
896 SectionEnd
898 Section $(lng_pt) SecPortuguese
899 !insertmacro Language pt pt
900 SectionEnd
902 Section $(lng_pt_BR) SecPortugueseBrazil
903 !insertmacro Language pt_BR pt_BR
904 SectionEnd
906 Section $(lng_ro) SecRomanian
907 !insertmacro Language ro ro
908 SectionEnd
910 Section $(lng_ru) SecRussian
911 !insertmacro Language ru ru
912 SectionEnd
914 Section $(lng_rw) SecKinyarwanda
915 !insertmacro Language rw rw
916 SectionEnd
918 Section $(lng_sk) SecSlovak
919 !insertmacro Language sk sk
920 SectionEnd
922 Section $(lng_sl) SecSlovenian
923 !insertmacro Language sl sl
924 SectionEnd
926 Section $(lng_sq) SecAlbanian
927 !insertmacro Language sq sq
928 SectionEnd
930 Section $(lng_sr) SecSerbian
931 !insertmacro Language sr sr
932 SectionEnd
934 Section $(lng_sr@latin) SecSerbianLatin
935 !insertmacro Language 'sr@latin' 'sr@latin'
936 SectionEnd
938 Section $(lng_sv) SecSwedish
939 !insertmacro Language sv sv
940 SectionEnd
942 Section $(lng_th) SecThai
943 !insertmacro Language th th
944 SectionEnd
946 Section $(lng_tr) SecTurkish
947 !insertmacro Language tr tr
948 SectionEnd
950 Section $(lng_uk) SecUkrainian
951 !insertmacro Language uk uk
952 SectionEnd
954 Section $(lng_vi) SecVietnamese
955 !insertmacro Language vi vi
956 SectionEnd
958 Section $(lng_zh_CN) SecChineseSimplified
959 !insertmacro Language zh_CN zh_CN
960 SectionEnd
962 Section $(lng_zh_TW) SecChineseTaiwan
963 !insertmacro Language zh_TW zh_TW
964 SectionEnd
966 SectionGroupEnd
969 Section -FinalizeInstallation
970 DetailPrint "finalize installation"
971 StrCmp $MultiUser "1" "" SingleUser
972 DetailPrint "admin mode, registry root will be HKLM"
973 SetShellVarContext all
974 Goto endSingleUser
975 SingleUser:
976 DetailPrint "single user mode, registry root will be HKCU"
977 SetShellVarContext current
978 endSingleUser:
980 ; check for writing registry
981 ClearErrors
982 WriteRegStr SHCTX "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\inkscape.exe"
983 ;IfErrors 0 +4
984 ; DetailPrint "fatal: failed to write to ${PRODUCT_DIR_REGKEY}"
985 ; DetailPrint "aborting installation"
986 ; Abort
987 WriteRegStr SHCTX "${PRODUCT_DIR_REGKEY}" "MultiUser" "$MultiUser"
988 WriteRegStr SHCTX "${PRODUCT_DIR_REGKEY}" "askMultiUser" "$askMultiUser"
989 WriteRegStr SHCTX "${PRODUCT_DIR_REGKEY}" "User" "$User"
990 IfErrors 0 +2
991 DetailPrint "fatal: failed to write to registry installation info"
993 ; start menu entries
994 ClearErrors
995 CreateShortCut "$SMPROGRAMS\Inkscape.lnk" "$INSTDIR\inkscape.exe"
996 IfErrors 0 +2
997 DetailPrint "fatal: failed to write to start menu info"
999 ; uninstall settings
1000 ClearErrors
1001 ; WriteUninstaller "$INSTDIR\uninst.exe"
1002 WriteRegExpandStr SHCTX "${PRODUCT_UNINST_KEY}" "UninstallString" "${UNINST_EXE}"
1003 WriteRegExpandStr SHCTX "${PRODUCT_UNINST_KEY}" "InstallDir" "$INSTDIR"
1004 WriteRegExpandStr SHCTX "${PRODUCT_UNINST_KEY}" "InstallLocation" "$INSTDIR"
1005 WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "DisplayName" "${PRODUCT_NAME} ${PRODUCT_VERSION}"
1006 WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\Inkscape.exe,0"
1007 WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
1008 WriteRegDWORD SHCTX "${PRODUCT_UNINST_KEY}" "NoModify" "1"
1009 WriteRegDWORD SHCTX "${PRODUCT_UNINST_KEY}" "NoRepair" "1"
1010 IfErrors 0 +2
1011 DetailPrint "fatal: failed to write to registry un-installation info"
1013 ;create/update log always within .onInstSuccess function
1014 !insertmacro UNINSTALL.LOG_UPDATE_INSTALL
1016 DetailPrint "create MD5 sums"
1017 ClearErrors
1018 FileOpen $0 $INSTDIR\uninstall.dat r
1019 FileOpen $9 $INSTDIR\uninstall.log w
1020 IfErrors doneinstall
1021 readnextlineinstall:
1022 ClearErrors
1023 FileRead $0 $1
1024 IfErrors doneinstall
1025 StrCpy $1 $1 -2
1026 ;DetailPrint $1
1027 md5dll::GetMD5File /NOUNLOAD $1
1028 Pop $2
1029 ;DetailPrint $2
1030 StrCmp $2 "" +2
1031 FileWrite $9 "$2 $1$\r$\n"
1032 Goto readnextlineinstall
1033 doneinstall:
1034 FileClose $0
1035 FileClose $9
1036 ; this file is not needed anymore
1037 Delete $INSTDIR\uninstall.dat
1039 SectionEnd
1041 ; Last the Descriptions
1042 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
1043 !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} $(lng_CoreDesc)
1044 !insertmacro MUI_DESCRIPTION_TEXT ${SecGTK} $(lng_GTKFilesDesc)
1045 !insertmacro MUI_DESCRIPTION_TEXT ${SecShortcuts} $(lng_ShortcutsDesc)
1046 !insertmacro MUI_DESCRIPTION_TEXT ${SecAlluser} $(lng_AlluserDesc)
1047 !insertmacro MUI_DESCRIPTION_TEXT ${SecDesktop} $(lng_DesktopDesc)
1048 !insertmacro MUI_DESCRIPTION_TEXT ${SecQuicklaunch} $(lng_QuicklaunchDesc)
1049 !insertmacro MUI_DESCRIPTION_TEXT ${SecSVGWriter} $(lng_SVGWriterDesc)
1050 !insertmacro MUI_DESCRIPTION_TEXT ${SecContextMenu} $(lng_ContextMenuDesc)
1051 !insertmacro MUI_DESCRIPTION_TEXT ${SecPrefs} $(lng_DeletePrefsDesc)
1052 !insertmacro MUI_DESCRIPTION_TEXT ${SecAddfiles} $(lng_AddfilesDesc)
1053 !insertmacro MUI_DESCRIPTION_TEXT ${SecExamples} $(lng_ExamplesDesc)
1054 !insertmacro MUI_DESCRIPTION_TEXT ${SecTutorials} $(lng_TutorialsDesc)
1055 !insertmacro MUI_DESCRIPTION_TEXT ${SecLanguages} $(lng_LanguagesDesc)
1056 !insertmacro MUI_FUNCTION_DESCRIPTION_END
1058 !macro Parameter key Section
1059 Push ${key}
1060 Push ""
1061 Call GetParameterValue
1062 Pop $1
1063 StrCmp $1 "OFF" 0 +5
1064 SectionGetFlags ${Section} $0
1065 IntOp $2 ${SF_SELECTED} ~
1066 IntOp $0 $0 & $2
1067 SectionSetFlags ${Section} $0
1068 StrCmp $1 "ON" 0 +4
1069 SectionGetFlags ${Section} $0
1070 IntOp $0 $0 | ${SF_SELECTED}
1071 SectionSetFlags ${Section} $0
1072 !macroend
1074 Function .onInit
1075 ;prepare log always within .onInit function
1076 !insertmacro UNINSTALL.LOG_PREPARE_INSTALL
1078 ;Extract InstallOptions INI files
1079 StrCpy $AskMultiUser "1"
1080 StrCpy $MultiUser "0"
1081 ; this resets AskMultiUser if Win95/98/ME
1082 Call GetWindowsVersion
1083 Pop $R0
1084 DetailPrint "detected operating system $R0"
1085 ;MessageBox MB_OK "operating system: $R0; AskMultiuser: $AskMultiUser"
1087 ; hide all user section if win98
1088 StrCmp $AskMultiUser "1" +2
1089 SectionSetText ${SecAlluser} ""
1091 ; hide if quick launch if not available
1092 StrCmp $QUICKLAUNCH $TEMP 0 +2
1093 SectionSetText ${SecQuicklaunch} ""
1095 ;check if user is admin
1096 ClearErrors
1097 UserInfo::GetName
1098 IfErrors info_Win9x
1099 Pop $0
1100 StrCpy $User $0
1101 UserInfo::GetAccountType
1102 Pop $1
1103 StrCmp $1 "Admin" info_done
1105 MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "$(lng_NO_ADMIN)$(lng_OK_CANCEL_DESC)" /SD IDOK IDOK info_done IDCANCEL +1
1106 Quit
1108 Goto info_done
1110 info_Win9x:
1111 # This one means you don't need to care about admin or
1112 # not admin because Windows 9x doesn't either
1113 MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "$(lng_NOT_SUPPORTED)$(lng_OK_CANCEL_DESC)" /SD IDOK IDOK info_done IDCANCEL +1
1114 Quit
1116 info_done:
1118 ;check for previous installation
1119 ReadRegStr $0 HKLM "${PRODUCT_DIR_REGKEY}" "User"
1120 StrCmp $0 "" +1 +2
1121 ReadRegStr $0 HKCU "${PRODUCT_DIR_REGKEY}" "User"
1122 ;check user if applicable
1123 StrCmp $0 "" diff_user_install_done
1124 StrCmp $0 $User diff_user_install_done
1125 MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "$(lng_DIFFERENT_USER)$(lng_OK_CANCEL_DESC)" /SD IDOK IDOK diff_user_install_done IDCANCEL +1
1126 Quit
1127 diff_user_install_done:
1129 ; call uninstall first
1130 ; code taken from the vlc project
1131 ReadRegStr $R0 HKLM ${PRODUCT_UNINST_KEY} "UninstallString"
1132 ReadRegStr $R1 HKLM ${PRODUCT_UNINST_KEY} "DisplayName"
1133 StrCmp $R0 "" +1 +3
1134 ReadRegStr $R0 HKCU ${PRODUCT_UNINST_KEY} "UninstallString"
1135 ReadRegStr $R1 HKCU ${PRODUCT_UNINST_KEY} "DisplayName"
1136 StrCmp $R0 "" uninstall_before_done
1138 MessageBox MB_YESNO|MB_ICONEXCLAMATION $(lng_WANT_UNINSTALL_BEFORE) /SD IDNO IDNO uninstall_before_done
1139 ;Run the uninstaller
1140 ;uninst:
1141 DetailPrint "execute $R0 in $INSTDIR"
1142 ClearErrors
1143 ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
1144 uninstall_before_done:
1146 ; proccess command line parameter
1147 !insertmacro Parameter "GTK" ${SecGTK}
1148 !insertmacro Parameter "SHORTCUTS" ${secShortcuts}
1149 !insertmacro Parameter "ALLUSER" ${SecAlluser}
1150 !insertmacro Parameter "DESKTOP" ${SecDesktop}
1151 !insertmacro Parameter "QUICKLAUNCH" ${SecQUICKlaunch}
1152 !insertmacro Parameter "SVGEDITOR" ${SecSVGWriter}
1153 !insertmacro Parameter "CONTEXTMENUE" ${SecContextMenu}
1154 !insertmacro Parameter "PREFERENCES" ${SecPrefs}
1155 !insertmacro Parameter "ADDFILES" ${SecAddfiles}
1156 !insertmacro Parameter "EXAMPLES" ${SecExamples}
1157 !insertmacro Parameter "TUTORIALS" ${SecTutorials}
1158 !insertmacro Parameter "LANGUAGES" ${SecLanguages}
1159 !insertmacro Parameter "am" ${SecAmharic}
1160 !insertmacro Parameter "ar" ${SecArabic}
1161 !insertmacro Parameter "az" ${SecAzerbaijani}
1162 !insertmacro Parameter "be" ${SecByelorussian}
1163 !insertmacro Parameter "bg" ${SecBulgarian}
1164 !insertmacro Parameter "bn" ${SecBengali}
1165 !insertmacro Parameter "br" ${SecBreton}
1166 !insertmacro Parameter "ca" ${SecCatalan}
1167 !insertmacro Parameter "ca@valencia" ${SecCatalanValencia}
1168 !insertmacro Parameter "cs" ${SecCzech}
1169 !insertmacro Parameter "da" ${SecDanish}
1170 !insertmacro Parameter "de" ${SecGerman}
1171 !insertmacro Parameter "dz" ${SecDzongkha}
1172 !insertmacro Parameter "el" ${SecGreek}
1173 !insertmacro Parameter "en_AU" ${SecEnglishAustralian}
1174 !insertmacro Parameter "en_CA" ${SecEnglishCanadian}
1175 !insertmacro Parameter "en_GB" ${SecEnglishBritain}
1176 !insertmacro Parameter "en_US@piglatin" ${SecEnglishPiglatin}
1177 !insertmacro Parameter "eo" ${SecEsperanto}
1178 !insertmacro Parameter "es" ${SecSpanish}
1179 !insertmacro Parameter "es_MX" ${SecSpanishMexico}
1180 !insertmacro Parameter "et" ${SecEstonian}
1181 !insertmacro Parameter "eu" ${SecBasque}
1182 !insertmacro Parameter "fi" ${SecFinnish}
1183 !insertmacro Parameter "fr" ${SecFrench}
1184 !insertmacro Parameter "ga" ${SecIrish}
1185 !insertmacro Parameter "gl" ${SecGallegan}
1186 !insertmacro Parameter "he" ${SecHebrew}
1187 !insertmacro Parameter "hr" ${SecCroatian}
1188 !insertmacro Parameter "hu" ${SecHungarian}
1189 !insertmacro Parameter "id" ${SecIndonesian}
1190 !insertmacro Parameter "it" ${SecItalian}
1191 !insertmacro Parameter "ja" ${SecJapanese}
1192 !insertmacro Parameter "km" ${SecKhmer}
1193 !insertmacro Parameter "ko" ${SecKorean}
1194 !insertmacro Parameter "lt" ${SecLithuanian}
1195 !insertmacro Parameter "mk" ${SecMacedonian}
1196 !insertmacro Parameter "mn" ${SecMongolian}
1197 !insertmacro Parameter "nb" ${SecNorwegianBokmal}
1198 !insertmacro Parameter "ne" ${SecNepali}
1199 !insertmacro Parameter "nl" ${SecDutch}
1200 !insertmacro Parameter "nn" ${SecNorwegianNynorsk}
1201 !insertmacro Parameter "pa" ${SecPanjabi}
1202 !insertmacro Parameter "pl" ${SecPolish}
1203 !insertmacro Parameter "pt" ${SecPortuguese}
1204 !insertmacro Parameter "pt_BR" ${SecPortugueseBrazil}
1205 !insertmacro Parameter "ro" ${SecRomanian}
1206 !insertmacro Parameter "ru" ${SecRussian}
1207 !insertmacro Parameter "rw" ${SecKinyarwanda}
1208 !insertmacro Parameter "sk" ${SecSlovak}
1209 !insertmacro Parameter "sl" ${SecSlovenian}
1210 !insertmacro Parameter "sq" ${SecAlbanian}
1211 !insertmacro Parameter "sr" ${SecSerbian}
1212 !insertmacro Parameter "sr@latin" ${SecSerbianLatin}
1213 !insertmacro Parameter "sv" ${SecSwedish}
1214 !insertmacro Parameter "th" ${SecThai}
1215 !insertmacro Parameter "tr" ${SecTurkish}
1216 !insertmacro Parameter "uk" ${SecUkrainian}
1217 !insertmacro Parameter "vi" ${SecVietnamese}
1218 !insertmacro Parameter "zh_CN" ${SecChineseSimplified}
1219 !insertmacro Parameter "zh_TW" ${SecChineseTaiwan}
1221 Push "?"
1222 Push "TEST"
1223 Call GetParameterValue
1224 Pop $1
1225 StrCmp $1 "TEST" +3
1226 MessageBox MB_OK "possible parameters for installer:$\r$\n \
1227 /?: this help screen$\r$\n \
1228 /S: silent$\r$\n \
1229 /D=(directory): where to install inkscape$\r$\n \
1230 /GTK=(OFF/ON): GTK+ Runtime environment$\r$\n \
1231 /SHORTCUTS=(OFF/ON): shortcuts to start inkscape$\r$\n \
1232 /ALLUSER=(OFF/ON): for all users on the computer$\r$\n \
1233 /DESKTOP=(OFF/ON): Desktop icon$\r$\n \
1234 /QUICKLAUNCH=(OFF/ON): quick launch icon$\r$\n \
1235 /SVGEDITOR=(OFF/ON): default SVG editor$\r$\n \
1236 /CONTEXTMENUE=(OFF/ON): context menue integration$\r$\n \
1237 /PREFERENCES=(OFF/ON): delete users preference files$\r$\n \
1238 /ADDFILES=(OFF/ON): additional files$\r$\n \
1239 /EXAMPLES=(OFF/ON): examples$\r$\n \
1240 /TUTORIALS=(OFF/ON): tutorials$\r$\n \
1241 /LANGUAGES=(OFF/ON): translated menues, examples, etc.$\r$\n \
1242 /[locale code]=(OFF/ON): e.g am, es, es_MX as in Inkscape supported"
1243 Abort
1244 FunctionEnd
1246 Function .onSelChange
1247 FunctionEnd
1250 Function .onInstSuccess
1252 FunctionEnd
1254 ; --------------------------------------------------
1256 Function un.CustomPageUninstall
1257 !insertmacro MUI_HEADER_TEXT "$(lng_UInstOpt)" "$(lng_UInstOpt1)"
1258 !insertmacro MUI_INSTALLOPTIONS_WRITE "inkscape.nsi.uninstall" "Field 1" "Text" "$APPDATA\Inkscape\"
1259 !insertmacro MUI_INSTALLOPTIONS_WRITE "inkscape.nsi.uninstall" "Field 2" "Text" "$(lng_PurgePrefs)"
1261 !insertmacro MUI_INSTALLOPTIONS_DISPLAY "inkscape.nsi.uninstall"
1262 !insertmacro MUI_INSTALLOPTIONS_READ $MultiUser "inkscape.nsi.uninstall" "Field 2" "State"
1263 DetailPrint "keepfiles = $MultiUser"
1264 ;MessageBox MB_OK "adminmode = $MultiUser MultiUserOS = $askMultiUser"
1266 FunctionEnd
1269 Function un.onInit
1270 ;begin uninstall, could be added on top of uninstall section instead
1271 ;!insertmacro UNINSTALL.LOG_BEGIN_UNINSTALL
1272 IfFileExists $INSTDIR\uninstall.log uninstalllogpresent
1273 MessageBox MB_OK|MB_ICONEXCLAMATION "$(lng_UninstallLogNotFound)" /SD IDOK
1274 Quit
1275 uninstalllogpresent:
1276 ClearErrors
1277 StrCpy $User ""
1278 UserInfo::GetName
1279 IfErrors +3
1280 Pop $0
1281 StrCpy $User $0
1283 StrCpy $askMultiUser "1"
1284 StrCpy $MultiUser "1"
1286 ; Test if this was a multiuser installation
1287 ReadRegStr $0 HKLM "${PRODUCT_DIR_REGKEY}" ""
1288 StrCmp $0 "$INSTDIR\inkscape.exe" 0 hkcu_user_uninstall
1289 ReadRegStr $MultiUser HKLM "${PRODUCT_DIR_REGKEY}" "MultiUser"
1290 ReadRegStr $askMultiUser HKLM "${PRODUCT_DIR_REGKEY}" "askMultiUser"
1291 ReadRegStr $0 HKLM "${PRODUCT_DIR_REGKEY}" "User"
1292 Goto check_user_uninstall
1293 hkcu_user_uninstall:
1294 ReadRegStr $MultiUser HKCU "${PRODUCT_DIR_REGKEY}" "MultiUser"
1295 ReadRegStr $askMultiUser HKCU "${PRODUCT_DIR_REGKEY}" "askMultiUser"
1296 ReadRegStr $0 HKCU "${PRODUCT_DIR_REGKEY}" "User"
1297 ;check user if applicable
1298 check_user_uninstall:
1299 StrCmp $0 "" diff_user_uninstall_done
1300 StrCmp $0 $User diff_user_uninstall_done
1301 MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "$(lng_DIFFERENT_USER)$(lng_OK_CANCEL_DESC)" /SD IDOK IDOK diff_user_uninstall_done IDCANCEL +1
1302 Quit
1303 diff_user_uninstall_done:
1305 !insertmacro MUI_INSTALLOPTIONS_EXTRACT "inkscape.nsi.uninstall"
1307 ;check whether Multi user installation ?
1308 SetShellVarContext all
1309 StrCmp $MultiUser "0" 0 +2
1310 SetShellVarContext current
1311 ;MessageBox MB_OK "adminmode = $MultiUser MultiUserOS = $askMultiUser"
1313 FunctionEnd
1315 # removes a file and if the directory is empty afterwards the directory also
1316 # push md5, push filename, call unremovefilename
1317 Function un.RemoveFile
1318 Var /Global filename
1319 Var /Global md5sum
1320 Var /Global ismd5sum
1321 Var /Global removenever ; never remove a touched file
1322 Var /Global removealways ; always remove files touched by user
1323 Pop $filename
1324 Pop $md5sum
1326 IfFileExists $filename +2 0
1327 Return
1328 StrCmp $removealways "always" unremovefile 0
1329 md5dll::GetMD5File /NOUNLOAD $filename
1330 Pop $ismd5sum ;md5 of file
1331 StrCmp $md5sum $ismd5sum unremovefile 0
1332 ;DetailPrint "uups MD5 does not match"
1333 StrCmp $removenever "never" 0 +2
1334 Return
1335 ; the md5 sums does not match so we ask
1336 messagebox::show MB_DEFBUTTON3|MB_TOPMOST "" "0,103" \
1337 "$(lng_FileChanged)" "$(lng_Yes)" "$(lng_AlwaysYes)" "$(lng_No)" "$(lng_AlwaysNo)"
1338 ;DetailPrint "messagebox finished"
1339 Pop $md5sum
1340 ;DetailPrint "messagebox call returned... $md5sum"
1341 StrCmp $md5sum "1" unremovefile 0 ; Yes
1342 StrCmp $md5sum "2" 0 unremoveno ; Yes always
1343 StrCpy $removealways "always"
1344 ;DetailPrint "removealways"
1345 Goto unremovefile
1346 unremoveno:
1347 StrCmp $md5sum "3" 0 unremovenever ; No
1348 ;DetailPrint "No remove"
1349 Return
1350 unremovenever:
1351 StrCpy $removenever "never"
1352 ;DetailPrint "removenever"
1353 Return
1354 unremovefile:
1355 ;DetailPrint "removefile"
1356 ClearErrors
1357 Delete $filename
1358 ;now recursivly remove the path
1359 unrmdir:
1360 ${un.GetParent} $filename $filename
1361 IfErrors 0 +2
1362 Return
1363 RMDir $filename
1364 IfErrors +2
1365 Goto unrmdir
1366 FunctionEnd
1368 Section Uninstall
1370 ; remove personal settings
1371 Delete "$APPDATA\Inkscape\extension-errors.log"
1372 StrCmp $MultiUser "0" 0 endPurge ; multiuser assigned in dialog
1373 DetailPrint "purge personal settings in $APPDATA\Inkscape"
1374 ;RMDir /r "$APPDATA\Inkscape"
1375 !insertmacro delprefs
1376 endPurge:
1378 ; Remove file associations for svg editor
1379 DetailPrint "removing file associations for svg editor"
1380 ClearErrors
1381 ReadRegStr $0 HKCR ".svg" ""
1382 DetailPrint ".svg associated as $0"
1383 IfErrors endUninstSVGEdit
1384 ReadRegStr $1 HKCR "$0\shell\edit\command" ""
1385 IfErrors 0 +2
1386 DetailPrint "svg editor is $1"
1387 StrCmp $1 '"$INSTDIR\Inkscape.exe" "%1"' 0 +3
1388 DetailPrint "removing default .svg editor"
1389 DeleteRegKey HKCR "$0\shell\edit\command"
1390 DeleteRegKey /ifempty HKCR "$0\shell\edit"
1391 DeleteRegKey /ifempty HKCR "$0\shell"
1392 DeleteRegKey /ifempty HKCR "$0"
1393 endUninstSVGEdit:
1395 ClearErrors
1396 ReadRegStr $2 HKCR ".svgz" ""
1397 DetailPrint ".svgz associated as $2"
1398 IfErrors endUninstSVGZEdit
1399 ReadRegStr $3 HKCR "$2\shell\edit\command" ""
1400 IfErrors 0 +2
1401 DetailPrint "svgz editor is $1"
1402 StrCmp $3 '"$INSTDIR\Inkscape.exe" "%1"' 0 +3
1403 DetailPrint "removing default .svgz editor"
1404 DeleteRegKey HKCR "$2\shell\edit\command"
1405 DeleteRegKey /ifempty HKCR "$2\shell\edit"
1406 DeleteRegKey /ifempty HKCR "$2\shell"
1407 DeleteRegKey /ifempty HKCR "$2"
1408 endUninstSVGZEdit:
1410 ; Remove file associations for svg editor
1411 DetailPrint "removing file associations for svg editor"
1412 ClearErrors
1413 ReadRegStr $0 HKCR ".svg" ""
1414 IfErrors endUninstSVGView
1415 ReadRegStr $1 HKCR "$0\shell\open\command" ""
1416 IfErrors 0 +2
1417 DetailPrint "svg viewer is $1"
1418 StrCmp $1 '"$INSTDIR\Inkscape.exe" "%1"' 0 +3
1419 DetailPrint "removing default .svg viewer"
1420 DeleteRegKey HKCR "$0\shell\open\command"
1421 DeleteRegKey /ifempty HKCR "$0\shell\open"
1422 DeleteRegKey /ifempty HKCR "$0\shell"
1423 DeleteRegKey /ifempty HKCR "$0"
1424 endUninstSVGView:
1426 ClearErrors
1427 ReadRegStr $2 HKCR ".svgz" ""
1428 IfErrors endUninstSVGZView
1429 ReadRegStr $3 HKCR "$2\shell\open\command" ""
1430 IfErrors 0 +2
1431 DetailPrint "svgz viewer is $1"
1432 StrCmp $3 '"$INSTDIR\Inkscape.exe" "%1"' 0 +3
1433 DetailPrint "removing default .svgz viewer"
1434 DeleteRegKey HKCR "$2\shell\open\command"
1435 DeleteRegKey /ifempty HKCR "$2\shell\open"
1436 DeleteRegKey /ifempty HKCR "$2\shell"
1437 DeleteRegKey /ifempty HKCR "$2"
1438 endUninstSVGZView:
1440 ; Remove file associations for context menue
1441 DetailPrint "removing file associations for svg editor"
1442 ClearErrors
1443 ReadRegStr $0 HKCR ".svg" ""
1444 IfErrors endUninstSVGContext
1445 DetailPrint "removing default .svg context menue"
1446 DeleteRegKey HKCR "$0\shell\${PRODUCT_NAME}"
1447 DeleteRegKey /ifempty HKCR "$0\shell"
1448 DeleteRegKey /ifempty HKCR "$0"
1449 endUninstSVGContext:
1451 ClearErrors
1452 ReadRegStr $2 HKCR ".svgz" ""
1453 IfErrors endUninstSVGZContext
1454 DetailPrint "removing default .svgzcontext menue"
1455 DeleteRegKey HKCR "$2\shell\${PRODUCT_NAME}"
1456 DeleteRegKey /ifempty HKCR "$2\shell"
1457 DeleteRegKey /ifempty HKCR "$2"
1458 endUninstSVGZContext:
1460 ReadRegStr $1 HKCR "$0" ""
1461 StrCmp $1 "" 0 +3
1462 DetailPrint "removing filetype .svg $0"
1463 DeleteRegKey HKCR ".svg"
1465 ReadRegStr $3 HKCR "$2" ""
1466 StrCmp $3 "" 0 +3
1467 DetailPrint "removing filetype .svgz $2"
1468 DeleteRegKey HKCR ".svgz"
1471 SetShellVarContext all
1472 DetailPrint "removing product regkey"
1473 DeleteRegKey SHCTX "${PRODUCT_DIR_REGKEY}"
1474 DetailPrint "removing uninstall info"
1475 DeleteRegKey SHCTX "${PRODUCT_UNINST_KEY}"
1476 DetailPrint "removing shortcuts"
1477 Delete "$DESKTOP\Inkscape.lnk"
1478 Delete "$QUICKLAUNCH\Inkscape.lnk"
1479 Delete "$SMPROGRAMS\Inkscape.lnk"
1480 ;just in case they are still there
1481 Delete "$SMPROGRAMS\Inkscape\Uninstall Inkscape.lnk"
1482 Delete "$SMPROGRAMS\Inkscape\Inkscape.lnk"
1483 RMDir "$SMPROGRAMS\Inkscape"
1485 SetShellVarContext current
1486 DetailPrint "removing product regkey"
1487 DeleteRegKey SHCTX "${PRODUCT_DIR_REGKEY}"
1488 DetailPrint "removing uninstall info"
1489 DeleteRegKey SHCTX "${PRODUCT_UNINST_KEY}"
1490 DetailPrint "removing shortcuts"
1491 Delete "$DESKTOP\Inkscape.lnk"
1492 Delete "$QUICKLAUNCH\Inkscape.lnk"
1493 Delete "$SMPROGRAMS\Inkscape.lnk"
1494 ;just in case they are still there
1495 Delete "$SMPROGRAMS\Inkscape\Uninstall Inkscape.lnk"
1496 Delete "$SMPROGRAMS\Inkscape\Inkscape.lnk"
1497 RMDir "$SMPROGRAMS\Inkscape"
1499 DetailPrint "removing uninstall info"
1501 ;uninstall from path, must be repeated for every install logged path individual
1502 ;!insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\lib\locale"
1503 ;!insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\locale"
1504 ;!insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\doc"
1505 ;!insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\share\tutorials"
1506 ;!insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\share\templates"
1507 ;!insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\share\screens"
1508 ;!insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\share\clipart"
1509 ;!insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\share\extensions"
1510 ;!insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\share\icons"
1511 ;!insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\share"
1512 ;!insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\modules"
1513 ;!insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\python"
1514 ;!insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR"
1516 ;end uninstall, after uninstall from all logged paths has been performed
1517 ;!insertmacro UNINSTALL.LOG_END_UNINSTALL
1519 ;RMDir /r "$INSTDIR"
1521 StrCpy $removenever ""
1522 StrCpy $removealways ""
1524 InitPluginsDir
1525 SetPluginUnload manual
1527 ClearErrors
1528 FileOpen $0 $INSTDIR\uninstall.log r
1529 IfErrors uninstallnotfound
1530 readnextline:
1531 ClearErrors
1532 FileRead $0 $1
1533 IfErrors done
1534 ; cat the line into md5 and filename
1535 StrLen $2 $1
1536 IntCmp $2 35 readnextline readnextline
1537 StrCpy $3 $1 32
1538 StrCpy $4 $1 $2-36 34 #remove trailing CR/LF
1539 StrCpy $4 $4 -2
1540 Push $3
1541 Push $4
1542 Call un.RemoveFile
1543 Goto readnextline
1544 uninstallnotfound:
1545 MessageBox MB_OK|MB_ICONEXCLAMATION "$(lng_UninstallLogNotFound)" /SD IDOK
1546 done:
1547 FileClose $0
1549 Delete "$INSTDIR\uninstall.log"
1550 Delete "$INSTDIR\uninstall.exe"
1551 ; remove empty directories
1552 RMDir "$INSTDIR\data"
1553 RMDir "$INSTDIR\doc"
1554 RMDir "$INSTDIR\modules"
1555 RMDir "$INSTDIR\plugins"
1557 RMDir $INSTDIR
1559 SetAutoClose false
1561 SectionEnd