Code

New Slovenian translation. Closes 1559630.
[inkscape.git] / packaging / win32 / inkscape.nsi
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.44+devel"
11 !define PRODUCT_PUBLISHER "Inkscape Organization"
12 !define PRODUCT_WEB_SITE "http://www.inkscape.org"
13 !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\inkscape.exe"
14 !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
18 ; #######################################
19 ; MUI   SETTINGS
20 ; #######################################
21 ; MUI 1.67 compatible ------
22 SetCompressor /SOLID lzma
23 !include "MUI.nsh"
24 !include "sections.nsh"
25 !define MUI_ABORTWARNING
26 !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
27 !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
28 !define MUI_HEADERIMAGE
29 !define MUI_HEADERIMAGE_BITMAP "header.bmp"
30 !define MUI_COMPONENTSPAGE_SMALLDESC
33 ; Welcome page
34 !insertmacro MUI_PAGE_WELCOME
35 ; License page
36 ; !define MUI_LICENSEPAGE_RADIOBUTTONS
37 LicenseForceSelection off
38 !define MUI_LICENSEPAGE_BUTTON $(lng_LICENSE_BUTTON)
39 !define MUI_LICENSEPAGE_TEXT_BOTTOM $(lng_LICENSE_BOTTOM_TEXT)
40 !insertmacro MUI_PAGE_LICENSE "..\..\Copying"
41 !insertmacro MUI_PAGE_COMPONENTS
42 ; InstType $(lng_Full)
43 ; InstType $(lng_Optimal)
44 ; InstType $(lng_Minimal)
45 ; Directory page
46 !insertmacro MUI_PAGE_DIRECTORY
47 ; Instfiles page
48 !insertmacro MUI_PAGE_INSTFILES
49 ; Finish page
50 !define MUI_FINISHPAGE_RUN "$INSTDIR\inkscape.exe"
51 !insertmacro MUI_PAGE_FINISH
53 ; Uninstaller pages
54 !insertmacro MUI_UNPAGE_CONFIRM
55 UninstPage custom un.CustomPageUninstall
56 !insertmacro MUI_UNPAGE_INSTFILES
57 ShowUninstDetails hide
58 !insertmacro MUI_UNPAGE_FINISH
60 ; #######################################
61 ; STRING   LOCALIZATION
62 ; #######################################
63 ; Thanks to Adib Taraben and Luca Bruno for getting this started
64 ; Add your translation here!  :-)
65 ; I had wanted to list the languages alphabetically, but apparently
66 ; the first is the default.  So putting English first is just being
67 ; practical.  It is not chauvinism or hubris, I swear!  ;-)
68 ; default language first
70 ; Language files
71 !include "english.nsh" 
72 !include "catalan.nsh" 
73 !include "czech.nsh" 
74 !include "french.nsh" 
75 !include "german.nsh" 
76 !include "italian.nsh" 
77 !include "slovak.nsh" 
78 !include "polish.nsh" 
79 !include "spanish.nsh" 
80 !include "slovenian.nsh" 
82 ReserveFile "inkscape.nsi.uninstall"
85 ; #######################################
86 ; SETTINGS
87 ; #######################################
89 Name              "${PRODUCT_NAME} ${PRODUCT_VERSION}"
90 Caption           $(lng_Caption)
91 OutFile           "Inkscape-${PRODUCT_VERSION}-1.win32.exe"
92 InstallDir        "$PROGRAMFILES\Inkscape"
93 InstallDirRegKey  HKLM "${PRODUCT_DIR_REGKEY}" ""
94 ShowInstDetails   hide
95 ShowUnInstDetails hide
97 var askMultiUser
98 Var MultiUser
99 var User
101 ; #######################################
102 ;  I N S T A L L E R    S E C T I O N S
103 ; #######################################
105 ; Turn off old selected section
106 ; GetWindowsVersion
108 ; Based on Yazno's function, http://yazno.tripod.com/powerpimpit/
109 ; Updated by Joost Verburg
110 ; Updated for Windows 98 SE by Matthew Win Tibbals 5-21-03
112 ; Returns on top of stack
114 ; Windows Version (95, 98, ME, NT x.x, 2000, XP, 2003)
115 ; or
116 ; '' (Unknown Windows Version)
118 ; Usage:
119 ;   Call GetWindowsVersion
120 ;   Pop $R0
121 ;   ; at this point $R0 is "NT 4.0" or whatnot
122 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
123 Function GetWindowsVersion
124  
125   Push $R0
126   Push $R1
127  
128   ClearErrors
129  
130   ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
131  
132   IfErrors 0 lbl_winnt
133  
134   ; we are not NT
135   ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion" VersionNumber
136  
137   StrCpy $R1 $R0 1
138   StrCmp $R1 '4' 0 lbl_error
139  
140   StrCpy $R1 $R0 3
141  
142   StrCmp $R1 '4.0' lbl_win32_95
143   StrCmp $R1 '4.9' lbl_win32_ME lbl_win32_98
144  
145   lbl_win32_95:
146     StrCpy $R0 '95'
147         StrCpy $AskMultiUser "0"
148   Goto lbl_done
149  
150   lbl_win32_98:
151     StrCpy $R0 '98'
152         StrCpy $AskMultiUser "0"
153   Goto lbl_done
154   lbl_win32_ME:
155     StrCpy $R0 'ME'
156         StrCpy $AskMultiUser "0"
157   Goto lbl_done
158  
159   lbl_winnt:
160  
161   StrCpy $R1 $R0 1
162  
163   StrCmp $R1 '3' lbl_winnt_x
164   StrCmp $R1 '4' lbl_winnt_x
165  
166   StrCpy $R1 $R0 3
167  
168   StrCmp $R1 '5.0' lbl_winnt_2000
169   StrCmp $R1 '5.1' lbl_winnt_XP
170   StrCmp $R1 '5.2' lbl_winnt_2003 lbl_error
171  
172   lbl_winnt_x:
173     StrCpy $R0 "NT $R0" 6
174   Goto lbl_done
175  
176   lbl_winnt_2000:
177     Strcpy $R0 '2000'
178   Goto lbl_done
179  
180   lbl_winnt_XP:
181     Strcpy $R0 'XP'
182   Goto lbl_done
183  
184   lbl_winnt_2003:
185     Strcpy $R0 '2003'
186   Goto lbl_done
187  
188   lbl_error:
189     Strcpy $R0 ''
190   lbl_done:
191  
192   Pop $R1
193   Exch $R0
195 FunctionEnd
197 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
199  ; StrStr
200  ; input, top of stack = string to search for
201  ;        top of stack-1 = string to search in
202  ; output, top of stack (replaces with the portion of the string remaining)
203  ; modifies no other variables.
204  ;
205  ; Usage:
206  ;   Push "this is a long ass string"
207  ;   Push "ass"
208  ;   Call StrStr
209  ;   Pop $R0
210  ;  ($R0 at this point is "ass string")
212  Function StrStr
213    Exch $R1 ; st=haystack,old$R1, $R1=needle
214    Exch    ; st=old$R1,haystack
215    Exch $R2 ; st=old$R1,old$R2, $R2=haystack
216    Push $R3
217    Push $R4
218    Push $R5
219    StrLen $R3 $R1
220    StrCpy $R4 0
221    ; $R1=needle
222    ; $R2=haystack
223    ; $R3=len(needle)
224    ; $R4=cnt
225    ; $R5=tmp
226    loop:
227      StrCpy $R5 $R2 $R3 $R4
228      StrCmp $R5 $R1 done
229      StrCmp $R5 "" done
230      IntOp $R4 $R4 + 1
231      Goto loop
232  done:
233    StrCpy $R1 $R2 "" $R4
234    Pop $R5
235    Pop $R4
236    Pop $R3
237    Pop $R2
238    Exch $R1
239  FunctionEnd
241 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
243  ; GetParameters
244  ; input, none
245  ; output, top of stack (replaces, with e.g. whatever)
246  ; modifies no other variables.
247  
248  Function GetParameters
249  
250    Push $R0
251    Push $R1
252    Push $R2
253    Push $R3
254    
255    StrCpy $R2 1
256    StrLen $R3 $CMDLINE
257    
258    ;Check for quote or space
259    StrCpy $R0 $CMDLINE $R2
260    StrCmp $R0 '"' 0 +3
261      StrCpy $R1 '"'
262      Goto loop
263    StrCpy $R1 " "
264    
265    loop:
266      IntOp $R2 $R2 + 1
267      StrCpy $R0 $CMDLINE 1 $R2
268      StrCmp $R0 $R1 get
269      StrCmp $R2 $R3 get
270      Goto loop
271    
272    get:
273      IntOp $R2 $R2 + 1
274      StrCpy $R0 $CMDLINE 1 $R2
275      StrCmp $R0 " " get
276      StrCpy $R0 $CMDLINE "" $R2
277    
278    Pop $R3
279    Pop $R2
280    Pop $R1
281    Exch $R0
282  
283  FunctionEnd
285 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
286 ; GetParameterValue
287 ; Chris Morgan<cmorgan@alum.wpi.edu> 5/10/2004
288 ; -Updated 4/7/2005 to add support for retrieving a command line switch
289 ;  and additional documentation
291 ; Searches the command line input, retrieved using GetParameters, for the
292 ; value of an option given the option name.  If no option is found the
293 ; default value is placed on the top of the stack upon function return.
295 ; This function can also be used to detect the existence of just a
296 ; command line switch like /OUTPUT  Pass the default and "OUTPUT"
297 ; on the stack like normal.  An empty return string "" will indicate
298 ; that the switch was found, the default value indicates that
299 ; neither a parameter or switch was found.
301 ; Inputs - Top of stack is default if parameter isn't found,
302 ;  second in stack is parameter to search for, ex. "OUTPUT"
303 ; Outputs - Top of the stack contains the value of this parameter
304 ;  So if the command line contained /OUTPUT=somedirectory, "somedirectory"
305 ;  will be on the top of the stack when this function returns
307 ; Register usage
308 ;$R0 - default return value if the parameter isn't found
309 ;$R1 - input parameter, for example OUTPUT from the above example
310 ;$R2 - the length of the search, this is the search parameter+2
311 ;      as we have '/OUTPUT='
312 ;$R3 - the command line string
313 ;$R4 - result from StrStr calls
314 ;$R5 - search for ' ' or '"'
315  
316 Function GetParameterValue
317   Exch $R0  ; get the top of the stack(default parameter) into R0
318   Exch      ; exchange the top of the stack(default) with
319             ; the second in the stack(parameter to search for)
320   Exch $R1  ; get the top of the stack(search parameter) into $R1
321  
322   ;Preserve on the stack the registers used in this function
323   Push $R2
324   Push $R3
325   Push $R4
326   Push $R5
327  
328   Strlen $R2 $R1+2    ; store the length of the search string into R2
329  
330   Call GetParameters  ; get the command line parameters
331   Pop $R3             ; store the command line string in R3
332  
333   # search for quoted search string
334   StrCpy $R5 '"'      ; later on we want to search for a open quote
335   Push $R3            ; push the 'search in' string onto the stack
336   Push '"/$R1='       ; push the 'search for'
337   Call StrStr         ; search for the quoted parameter value
338   Pop $R4
339   StrCpy $R4 $R4 "" 1   ; skip over open quote character, "" means no maxlen
340   StrCmp $R4 "" "" next ; if we didn't find an empty string go to next
341  
342   # search for non-quoted search string
343   StrCpy $R5 ' '      ; later on we want to search for a space since we
344                       ; didn't start with an open quote '"' we shouldn't
345                       ; look for a close quote '"'
346   Push $R3            ; push the command line back on the stack for searching
347   Push '/$R1='        ; search for the non-quoted search string
348   Call StrStr
349   Pop $R4
350  
351   ; $R4 now contains the parameter string starting at the search string,
352   ; if it was found
353 next:
354   StrCmp $R4 "" check_for_switch ; if we didn't find anything then look for
355                                  ; usage as a command line switch
356   # copy the value after /$R1= by using StrCpy with an offset of $R2,
357   # the length of '/OUTPUT='
358   StrCpy $R0 $R4 "" $R2  ; copy commandline text beyond parameter into $R0
359   # search for the next parameter so we can trim this extra text off
360   Push $R0
361   Push $R5            ; search for either the first space ' ', or the first
362                       ; quote '"'
363                       ; if we found '"/output' then we want to find the
364                       ; ending ", as in '"/output=somevalue"'
365                       ; if we found '/output' then we want to find the first
366                       ; space after '/output=somevalue'
367   Call StrStr         ; search for the next parameter
368   Pop $R4
369   StrCmp $R4 "" done  ; if 'somevalue' is missing, we are done
370   StrLen $R4 $R4      ; get the length of 'somevalue' so we can copy this
371                       ; text into our output buffer
372   StrCpy $R0 $R0 -$R4 ; using the length of the string beyond the value,
373                       ; copy only the value into $R0
374   goto done           ; if we are in the parameter retrieval path skip over
375                       ; the check for a command line switch
376  
377 ; See if the parameter was specified as a command line switch, like '/output'
378 check_for_switch:
379   Push $R3            ; push the command line back on the stack for searching
380   Push '/$R1'         ; search for the non-quoted search string
381   Call StrStr
382   Pop $R4
383   StrCmp $R4 "" done  ; if we didn't find anything then use the default
384   StrCpy $R0 ""       ; otherwise copy in an empty string since we found the
385                       ; parameter, just didn't find a value
386  
387 done:
388   Pop $R5
389   Pop $R4
390   Pop $R3
391   Pop $R2
392   Pop $R1
393   Exch $R0 ; put the value in $R0 at the top of the stack
394 FunctionEnd
396 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
398 !macro Language polng lng
399   SectionIn 1 2 3
400   SetOutPath $INSTDIR
401   File /nonfatal /a "..\..\inkscape\*.${lng}.txt"
402   SetOutPath $INSTDIR\locale
403   File /nonfatal /a /r "..\..\inkscape\locale\${polng}"
404   SetOutPath $INSTDIR\lib\locale
405   File /nonfatal /a /r "..\..\inkscape\lib\locale\${polng}"
406   ; the keyboard tables
407   SetOutPath $INSTDIR\share\screens
408   File /nonfatal /a /r "..\..\inkscape\share\screens\keys.${polng}.svg"  
409   SetOutPath $INSTDIR\share\templates
410   File /nonfatal /a /r "..\..\inkscape\share\templates\default.${polng}.svg"  
411   SetOutPath $INSTDIR\doc
412   File /nonfatal /a /r "..\..\inkscape\doc\keys.${polng}.xml"  
413   File /nonfatal /a /r "..\..\inkscape\doc\keys.${polng}.html"  
414   SectionGetFlags ${SecTutorials} $R1 
415   IntOp $R1 $R1 & ${SF_SELECTED} 
416   IntCmp $R1 ${SF_SELECTED} 0 skip_tutorials 
417     SetOutPath $INSTDIR\share\tutorials
418     File /nonfatal /a "..\..\inkscape\share\tutorials\*.${polng}.*"
419   skip_tutorials:
420 !macroend
422 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
427 ;--------------------------------
428 ; Installer Sections
429 ; @todo better idea is to call the original uninstaller first
430 Section -removeInkscape
431   ; check for an old installation and clean that dlls and stuff
432   ClearErrors
433   IfFileExists $INSTDIR\etc 0 doDeleteLib
434     DetailPrint "$INSTDIR\etc exists, will be removed"
435     RmDir /r $INSTDIR\etc
436         IfErrors 0 +4
437       DetailPrint "fatal: failed to delete $INSTDIR\etc"
438       DetailPrint "aborting installation"
439           Abort
440   doDeleteLib:
442   ClearErrors
443   IfFileExists $INSTDIR\lib 0 doDeleteLocale
444     DetailPrint "$INSTDIR\lib exists, will be removed"  
445     RmDir /r $INSTDIR\lib
446         IfErrors 0 +4
447       DetailPrint "fatal: failed to delete $INSTDIR\lib"
448       DetailPrint "aborting installation"
449           Abort
450   doDeleteLocale:
452   ClearErrors
453   IfFileExists $INSTDIR\locale 0 doDeleteDll
454     DetailPrint "$INSTDIR\locale exists, will be removed"
455     RmDir /r $INSTDIR\locale
456         IfErrors 0 +4
457       DetailPrint "fatal: failed to delete $INSTDIR\locale"
458       DetailPrint "aborting installation"
459           Abort
460   doDeleteDll:
462   ClearErrors
463   FindFirst $0 $1 $INSTDIR\*.dll
464     FindNextLoop:
465     StrCmp $1 "" FindNextDone
466     DetailPrint "$INSTDIR\$1 exists, will be removed"
467     Delete $INSTDIR\$1
468     IfErrors 0 +4
469       DetailPrint "fatal: failed to delete $INSTDIR\$1"
470       DetailPrint "aborting installation"
471       Abort
472     FindNext $0 $1
473     Goto FindNextLoop
474   FindNextDone:
475   
476   ;remove the old inkscape shortcuts from the startmenu
477   ;just in case they are still there
478   SetShellVarContext current
479   Delete "$SMPROGRAMS\Inkscape\Uninstall Inkscape.lnk"
480   Delete "$SMPROGRAMS\Inkscape\Inkscape.lnk"
481   RMDir  "$SMPROGRAMS\Inkscape"
482   SetShellVarContext all
483   Delete "$SMPROGRAMS\Inkscape\Uninstall Inkscape.lnk"
484   Delete "$SMPROGRAMS\Inkscape\Inkscape.lnk"
485   RMDir  "$SMPROGRAMS\Inkscape"
486   
487 SectionEnd
489 Section $(lng_Core) SecCore
491   DetailPrint "Installing Inkscape Core Files ..."
493   SectionIn 1 2 3 RO
494   SetOutPath $INSTDIR
495   SetOverwrite on
496   SetAutoClose false
498   File /a "..\..\inkscape\ink*.exe"
499   File /a "..\..\inkscape\AUTHORS"
500   File /a "..\..\inkscape\COPYING"
501   File /a "..\..\inkscape\COPYING.LIB"
502   File /a "..\..\inkscape\NEWS"
503   File /a "..\..\inkscape\HACKING.txt"
504   File /a "..\..\inkscape\README"
505   File /a "..\..\inkscape\README.txt"
506   File /a "..\..\inkscape\TRANSLATORS"
507   File /nonfatal /a /r "..\..\inkscape\data"
508   File /nonfatal /a /r "..\..\inkscape\doc"
509   File /nonfatal /a /r "..\..\inkscape\plugins"
510   File /nonfatal /a /r /x *.??*.???* /x "examples" /x "tutorials" "..\..\inkscape\share"
511   ; this files are added because it slips through the filter
512   SetOutPath $INSTDIR\share\clipart
513   File /a "..\..\inkscape\share\clipart\inkscape.logo.svg"
514   ;File /a "..\..\inkscape\share\clipart\inkscape.logo.classic.svg"  
515   SetOutPath $INSTDIR\share\extensions
516   File /a "..\..\inkscape\share\extensions\pdf_output.inx.txt"
517   File /a "..\..\inkscape\share\extensions\pdf_output_via_gs_on_win32.inx.txt"
518   SetOutPath $INSTDIR\modules
519   File /nonfatal /a /r "..\..\inkscape\modules\*.*"
520   SetOutPath $INSTDIR\python
521   File /nonfatal /a /r "..\..\inkscape\python\*.*"
523   
524 SectionEnd
526 Section $(lng_GTKFiles) SecGTK
528   DetailPrint "Installing GTK Files ..."
529   
530   SectionIn 1 2 3 RO
531   SetOutPath $INSTDIR
532   SetOverwrite on
533   File /a /r "..\..\inkscape\*.dll"
534   File /a /r /x "locale" "..\..\inkscape\lib"
535   File /a /r "..\..\inkscape\etc"
536 SectionEnd
538 Section $(lng_Alluser) SecAlluser
539   ; disable this option in Win95/Win98/WinME
540   SectionIn 1 2 3 
541   StrCpy $MultiUser "1"
542   StrCmp $MultiUser "1" "" SingleUser
543     DetailPrint "admin mode, registry root will be HKLM"
544     SetShellVarContext all
545     Goto endSingleUser
546   SingleUser:
547     DetailPrint "single user mode, registry root will be HKCU"
548     SetShellVarContext current
549   endSingleUser:                
550 SectionEnd
552 SectionGroup $(lng_Shortcuts) SecShortcuts
554 Section $(lng_Desktop) SecDesktop
555   SectionIn 1 2 3
556   ClearErrors
557   CreateShortCut "$DESKTOP\Inkscape.lnk" "$INSTDIR\inkscape.exe"
558   IfErrors 0 +2
559     DetailPrint "Uups! Problems creating desktop shortcuts"
560 SectionEnd
562 Section $(lng_Quicklaunch) SecQuicklaunch
563   SectionIn 1 2 3
564   ClearErrors
565   StrCmp $QUICKLAUNCH $TEMP +2
566     CreateShortCut "$QUICKLAUNCH\Inkscape.lnk" "$INSTDIR\inkscape.exe"
567   IfErrors 0 +2
568     DetailPrint "Uups! Problems creating quicklaunch shortcuts"
569 SectionEnd
571 Section $(lng_SVGWriter) SecSVGWriter 
572   SectionIn 1 2 3
573   ; create file associations, test before if needed
574   DetailPrint "creating file associations"
575   ClearErrors
576   ReadRegStr $0 HKCR ".svg" ""
577   StrCmp $0 "" 0 +3
578     WriteRegStr HKCR ".svg" "" "svgfile"
579     WriteRegStr HKCR "svgfile" "" "Scalable Vector Graphics file"
580   ReadRegStr $0 HKCR ".svgz" ""
581   StrCmp $0 "" 0 +3
582     WriteRegStr HKCR ".svgz" "" "svgfile"
583     WriteRegStr HKCR "svgfile" "" "Scalable Vector Graphics file"
584   IfErrors 0 +2
585     DetailPrint "Uups! Problems creating file assoziations for svg writer"
586   
587   DetailPrint "creating default editor"
588   ClearErrors
589   ReadRegStr $0 HKCR ".svg" ""
590   WriteRegStr HKCR "$0\shell\edit\command" "" '"$INSTDIR\Inkscape.exe" "%1"'
591   ReadRegStr $0 HKCR ".svgz" ""
592   WriteRegStr HKCR "$0\shell\edit\command" "" '"$INSTDIR\Inkscape.exe" "%1"'
593   IfErrors 0 +2
594     DetailPrint "Uups! Problems creating default editor"
595 SectionEnd
597 Section $(lng_ContextMenu) SecContextMenu
598   SectionIn 1 2 3
599   ; create file associations, test before if needed
600   DetailPrint "creating file associations"
601   ClearErrors
602   ReadRegStr $0 HKCR ".svg" ""
603   StrCmp $0 "" 0 +3
604     WriteRegStr HKCR ".svg" "" "svgfile"
605     WriteRegStr HKCR "svgfile" "" "Scalable Vector Graphics file"
606   ReadRegStr $0 HKCR ".svgz" ""
607   StrCmp $0 "" 0 +3
608     WriteRegStr HKCR ".svgz" "" "svgfile"
609     WriteRegStr HKCR "svgfile" "" "Scalable Vector Graphics file"
610   IfErrors 0 +2
611     DetailPrint "Uups! Problems creating file assoziations for context menu"
612   
613   DetailPrint "creating context menue"
614   ClearErrors
615   ReadRegStr $0 HKCR ".svg" ""
616   WriteRegStr HKCR "$0\shell\${PRODUCT_NAME}\command" "" '"$INSTDIR\Inkscape.exe" "%1"'
617   ReadRegStr $0 HKCR ".svgz" ""
618   WriteRegStr HKCR "$0\shell\${PRODUCT_NAME}\command" "" '"$INSTDIR\Inkscape.exe" "%1"'
619   IfErrors 0 +2
620     DetailPrint "Uups! Problems creating context menue integration"
622 SectionEnd
624 SectionGroupEnd
626 SectionGroup $(lng_Addfiles) SecAddfiles
628 Section $(lng_Examples) SecExamples
629   SectionIn 1 2
630   SetOutPath $INSTDIR\share
631   File /nonfatal /a /r /x "*.??*.???*" "..\..\inkscape\share\examples"
632 SectionEnd
634 Section $(lng_Tutorials) SecTutorials
635   SectionIn 1 2
636   SetOutPath $INSTDIR\share
637   File /nonfatal /a /r /x "*.??*.???*" "..\..\inkscape\share\tutorials"
638 SectionEnd
640 SectionGroupEnd
642 SectionGroup /e $(lng_Languages) SecLanguages
644 Section $(lng_am) SecAmharic
645   !insertmacro Language am am
646 SectionEnd
648 Section $(lng_az) SecAzerbaijani
649   !insertmacro Language az az
650 SectionEnd
652 Section $(lng_be) SecByelorussian
653   !insertmacro Language be be
654 SectionEnd
656 Section $(lng_bg) SecBulgarian
657   !insertmacro Language bg bg
658 SectionEnd
660 Section $(lng_ca) SecCatalan
661   !insertmacro Language ca ca
662 SectionEnd
664 Section $(lng_cs) SecCzech
665   !insertmacro Language cs cs
666 SectionEnd
668 Section $(lng_da) SecDanish
669   !insertmacro Language da da
670 SectionEnd
672 Section $(lng_de) SecGerman
673   !insertmacro Language 'de' 'de'
674 SectionEnd
676 Section $(lng_dz) SecDzongkha
677   !insertmacro Language dz dz
678 SectionEnd
680 Section $(lng_el) SecGreek
681   !insertmacro Language el el
682 SectionEnd
684 Section $(lng_en) SecEnglish
685   SectionIn 1 2 3 RO
686 SectionEnd
688 Section $(lng_en_CA) SecEnglishCanadian
689   !insertmacro Language en_CA en_CA
690 SectionEnd
692 Section $(lng_en_GB) SecEnglishBritain
693   !insertmacro Language en_GB en_GB
694 SectionEnd
696 Section $(lng_es) SecSpanish
697   !insertmacro Language 'es' 'es'
698 SectionEnd
700 Section $(lng_es_MX) SecSpanishMexico
701   !insertmacro Language 'es_MX' 'es_MX'
702 SectionEnd
704 Section $(lng_et) SecEstonian
705   !insertmacro Language et et
706 SectionEnd
708 Section $(lng_fr) SecFrench
709   !insertmacro Language 'fr' 'fr'
710 SectionEnd
712 Section $(lng_fi) SecFinish
713   !insertmacro Language 'fi' 'fi'
714 SectionEnd
716 Section $(lng_ga) SecIrish
717   !insertmacro Language ga ga
718 SectionEnd
720 Section $(lng_gl) SecGallegan
721   !insertmacro Language gl gl
722   SectionIn 1 2 3
723 SectionEnd
725 Section $(lng_hr) SecCroatian
726   !insertmacro Language hr hr
727   SectionIn 1 2 3
728 SectionEnd
730 Section $(lng_hu) SecHungarian
731   !insertmacro Language hu hu
732   SectionIn 1 2 3
733 SectionEnd
735 Section $(lng_it) SecItalian
736   !insertmacro Language it it
737   SectionIn 1 2 3
738 SectionEnd
740 Section $(lng_ja) SecJapanese
741   !insertmacro Language 'ja' 'jp'
742 SectionEnd
744 Section $(lng_ko) SecKorean
745   !insertmacro Language 'ko' 'ko'
746 SectionEnd
748 Section $(lng_lt) SecLithuanian
749   !insertmacro Language 'lt' 'lt'
750 SectionEnd
752 Section $(lng_mn) SecMongolian
753   !insertmacro Language mn mn
754 SectionEnd
756 Section $(lng_mk) SecMacedonian
757   !insertmacro Language mk mk
758 SectionEnd
760 Section $(lng_nb) SecNorwegianBokmal
761   !insertmacro Language nb nb
762 SectionEnd
764 Section $(lng_ne) SecNepali
765   !insertmacro Language ne ne
766 SectionEnd
768 Section $(lng_nl) SecDutch
769   !insertmacro Language nl nl
770 SectionEnd
772 Section $(lng_nn) SecNorwegianNynorsk
773   !insertmacro Language nn nn
774 SectionEnd
776 Section $(lng_pa) SecPanjabi
777   !insertmacro Language pa pa
778 SectionEnd
780 Section $(lng_pl) SecPolish
781   !insertmacro Language pl pl
782 SectionEnd
784 Section $(lng_pt) SecPortuguese
785   !insertmacro Language pt pt
786 SectionEnd
788 Section $(lng_pt_BR) SecPortugueseBrazil
789   !insertmacro Language pt_BR pt_BR
790 SectionEnd
792 Section $(lng_ru) SecRussian
793   !insertmacro Language ru ru
794 SectionEnd
796 Section $(lng_rw) SecKinyarwanda
797   !insertmacro Language rw rw
798 SectionEnd
800 Section $(lng_sk) SecSlovak
801   !insertmacro Language sk sk
802 SectionEnd
804 Section $(lng_sl) SecSlovenian
805   !insertmacro Language sl sl
806 SectionEnd
808 Section $(lng_sq) SecAlbanian
809   !insertmacro Language sq sq
810 SectionEnd
812 Section $(lng_sr) SecSerbian
813   !insertmacro Language sr sr
814 SectionEnd
816 Section $(lng_sr@Latn) SecSerbianLatin
817   !insertmacro Language 'sr@Latn' 'sr@Latn'
818 SectionEnd
820 Section $(lng_sv) SecSwedish
821   !insertmacro Language sv sv
822 SectionEnd
824 Section $(lng_tr) SecTurkish
825   !insertmacro Language tr tr
826 SectionEnd
828 Section $(lng_uk) SecUkrainian
829   !insertmacro Language uk uk
830 SectionEnd
832 Section $(lng_vi) SecVietnamese
833   !insertmacro Language vi vi
834 SectionEnd
836 Section $(lng_zh_CN) SecChineseSimplified
837   !insertmacro Language zh_CN zh_CN
838 SectionEnd
840 Section $(lng_zh_TW) SecChineseTaiwan
841   !insertmacro Language zh_TW zh_TW
842 SectionEnd
844 SectionGroupEnd
847 Section -FinalizeInstallation
848   StrCmp $MultiUser "1" "" SingleUser
849     DetailPrint "admin mode, registry root will be HKLM"
850     SetShellVarContext all
851     Goto endSingleUser
852   SingleUser:
853     DetailPrint "single user mode, registry root will be HKCU"
854     SetShellVarContext current
855   endSingleUser:                
857   ; check for writing registry
858   ClearErrors
859   WriteRegStr SHCTX "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\inkscape.exe"  
860   ;IfErrors 0 +4
861   ;  DetailPrint "fatal: failed to write to ${PRODUCT_DIR_REGKEY}"
862   ;  DetailPrint "aborting installation"
863   ;     Abort
864   WriteRegStr SHCTX "${PRODUCT_DIR_REGKEY}" "MultiUser" "$MultiUser"  
865   WriteRegStr SHCTX "${PRODUCT_DIR_REGKEY}" "askMultiUser" "$askMultiUser"
866   WriteRegStr SHCTX "${PRODUCT_DIR_REGKEY}" "User" "$User"
867   IfErrors 0 +2
868     DetailPrint "fatal: failed to write to registry installation info"
870   ; start menu entries
871   ClearErrors
872   CreateShortCut "$SMPROGRAMS\Inkscape.lnk" "$INSTDIR\inkscape.exe"
873   IfErrors 0 +2
874     DetailPrint "fatal: failed to write to start menu info"
876   ; uninstall settings
877   ClearErrors
878   WriteUninstaller "$INSTDIR\uninst.exe"
879   WriteRegExpandStr SHCTX "${PRODUCT_UNINST_KEY}" "UninstallString" '"$INSTDIR\uninst.exe"'
880   WriteRegExpandStr SHCTX "${PRODUCT_UNINST_KEY}" "InstallLocation" "$INSTDIR"
881   WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "DisplayName" "${PRODUCT_NAME} ${PRODUCT_VERSION}"
882   WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\Inkscape.exe,0"
883   WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
884   WriteRegDWORD SHCTX "${PRODUCT_UNINST_KEY}" "NoModify" "1"
885   WriteRegDWORD SHCTX "${PRODUCT_UNINST_KEY}" "NoRepair" "1"
886   IfErrors 0 +2
887     DetailPrint "fatal: failed to write to registry un-installation info"
888 SectionEnd
889  
890 ; Last the Descriptions
891 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
892   !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} $(lng_CoreDesc)
893   !insertmacro MUI_DESCRIPTION_TEXT ${SecGTK} $(lng_GTKFilesDesc)
894   !insertmacro MUI_DESCRIPTION_TEXT ${SecShortcuts} $(lng_ShortcutsDesc)
895   !insertmacro MUI_DESCRIPTION_TEXT ${SecAlluser} $(lng_AlluserDesc) 
896   !insertmacro MUI_DESCRIPTION_TEXT ${SecDesktop} $(lng_DesktopDesc)
897   !insertmacro MUI_DESCRIPTION_TEXT ${SecQuicklaunch} $(lng_QuicklaunchDesc)
898   !insertmacro MUI_DESCRIPTION_TEXT ${SecSVGWriter} $(lng_SVGWriterDesc)
899   !insertmacro MUI_DESCRIPTION_TEXT ${SecContextMenu} $(lng_ContextMenuDesc)
900   !insertmacro MUI_DESCRIPTION_TEXT ${SecAddfiles} $(lng_AddfilesDesc)
901   !insertmacro MUI_DESCRIPTION_TEXT ${SecExamples} $(lng_ExamplesDesc)
902   !insertmacro MUI_DESCRIPTION_TEXT ${SecTutorials} $(lng_TutorialsDesc)
903   !insertmacro MUI_DESCRIPTION_TEXT ${SecLanguages} $(lng_LanguagesDesc)
904 !insertmacro MUI_FUNCTION_DESCRIPTION_END
906 !macro Parameter key Section
907   Push ${key}
908   Push ""
909   Call GetParameterValue
910   Pop $1
911   StrCmp $1 "OFF" 0 +5
912     SectionGetFlags ${Section} $0
913     IntOp $2 ${SF_SELECTED} ~
914     IntOp $0 $0 & $2
915     SectionSetFlags ${Section} $0
916   StrCmp $1 "ON" 0 +4
917     SectionGetFlags ${Section} $0
918     IntOp $0 $0 | ${SF_SELECTED}
919     SectionSetFlags ${Section} $0
920 !macroend
922 Function .onInit
923   ;Extract InstallOptions INI files
924   StrCpy $AskMultiUser "1"
925   StrCpy $MultiUser "0"
926   ; this resets AskMultiUser if Win95/98/ME
927   Call GetWindowsVersion
928   Pop $R0
929   DetailPrint "detected operating system $R0"
930   ;MessageBox MB_OK "operating system: $R0; AskMultiuser: $AskMultiUser"
931   
932   ; hide all user section if win98
933   StrCmp $AskMultiUser "1" +2
934     SectionSetText ${SecAlluser} ""
936   ; hide if quick launch if not available
937   StrCmp $QUICKLAUNCH $TEMP 0 +2
938     SectionSetText ${SecQuicklaunch} ""
940   ;check if user is admin
941   ClearErrors
942         UserInfo::GetName
943         IfErrors info_Win9x
944         Pop $0
945         StrCpy $User $0
946         UserInfo::GetAccountType
947         Pop $1
948         StrCmp $1 "Admin" info_done
950         MessageBox MB_OK|MB_ICONEXCLAMATION "$(lng_NO_ADMIN)"
952         Goto info_done
954         info_Win9x:
955                 # This one means you don't need to care about admin or
956                 # not admin because Windows 9x doesn't either
957                 MessageBox MB_OK|MB_ICONEXCLAMATION $(lng_NOT_SUPPORTED)
959         info_done:
961   ;check for previous installation
962   ReadRegStr $0 HKLM "${PRODUCT_DIR_REGKEY}" "User"
963   StrCmp $0 "" +1 +2
964   ReadRegStr $0 HKCU "${PRODUCT_DIR_REGKEY}" "User"
965   ;check user if applicable
966   StrCmp $0 "" +3
967     StrCmp $0 $User +2
968           MessageBox MB_OK|MB_ICONEXCLAMATION "$(lng_DIFFERENT_USER)"
969         
970   ; proccess command line parameter
971   !insertmacro Parameter "GTK" ${SecGTK}
972   !insertmacro Parameter "SHORTCUTS" ${secShortcuts}
973   !insertmacro Parameter "ALLUSER" ${SecAlluser}
974   !insertmacro Parameter "DESKTOP" ${SecDesktop}
975   !insertmacro Parameter "QUICKLAUNCH" ${SecQUICKlaunch}
976   !insertmacro Parameter "SVGEDITOR" ${SecSVGWriter}
977   !insertmacro Parameter "CONTEXTMENUE" ${SecContextMenu}
978   !insertmacro Parameter "ADDFILES" ${SecAddfiles}
979   !insertmacro Parameter "EXAMPLES" ${SecExamples}
980   !insertmacro Parameter "TUTORIALS" ${SecTutorials}
981   !insertmacro Parameter "LANGUAGES" ${SecLanguages}
982   !insertmacro Parameter "am" ${SecAmharic}
983   !insertmacro Parameter "az" ${SecAzerbaijani}
984   !insertmacro Parameter "be" ${SecByelorussian}
985   !insertmacro Parameter "ca" ${SecCatalan}
986   !insertmacro Parameter "cs" ${SecCzech}
987   !insertmacro Parameter "da" ${SecDanish}
988   !insertmacro Parameter "de" ${SecGerman}
989   !insertmacro Parameter "el" ${SecGreek}
990   !insertmacro Parameter "es" ${SecSpanish}
991   !insertmacro Parameter "es_MX" ${SecSpanishMexico}
992   !insertmacro Parameter "et" ${SecEstonian}
993   !insertmacro Parameter "fr" ${SecFrench}
994   !insertmacro Parameter "ga" ${SecIrish}
995   !insertmacro Parameter "gl" ${SecGallegan}
996   !insertmacro Parameter "hu" ${SecHungarian}
997   !insertmacro Parameter "it" ${SecItalian}
998   !insertmacro Parameter "ja" ${SecJapanese}
999   !insertmacro Parameter "ko" ${SecKorean}
1000   !insertmacro Parameter "mk" ${SecMacedonian}
1001   !insertmacro Parameter "nb" ${SecNorwegianBokmal}
1002   !insertmacro Parameter "nl" ${SecDutch}
1003   !insertmacro Parameter "nn" ${SecNorwegianNynorsk}
1004   !insertmacro Parameter "pa" ${SecPanjabi}
1005   !insertmacro Parameter "pl" ${SecPolish}
1006   !insertmacro Parameter "pt" ${SecPortuguese}
1007   !insertmacro Parameter "pt_BR" ${SecPortugueseBrazil}
1008   !insertmacro Parameter "ru" ${SecRussian}
1009   !insertmacro Parameter "sk" ${SecSlovak}
1010   !insertmacro Parameter "sl" ${SecSlovenian}
1011   !insertmacro Parameter "sr" ${SecSerbian}
1012   !insertmacro Parameter "sr@Latn" ${SecSerbianLatin}
1013   !insertmacro Parameter "sv" ${SecSwedish}
1014   !insertmacro Parameter "tr" ${SecTurkish}
1015   !insertmacro Parameter "uk" ${SecUkrainian}
1016   !insertmacro Parameter "zh_CN" ${SecChineseSimplified}
1017   !insertmacro Parameter "zh_TW" ${SecChineseTaiwan}
1018   
1019   Push "?"
1020   Push "TEST"
1021   Call GetParameterValue
1022   Pop $1
1023   StrCmp $1 "TEST" +3
1024     MessageBox MB_OK "possible parameters for installer:$\r$\n \
1025       /?: this help screen$\r$\n \
1026       /S: silent$\r$\n \
1027       /D=(directory): where to install inkscape$\r$\n \
1028       /GTK=(OFF/ON): GTK+ Runtime environment$\r$\n \
1029       /SHORTCUTS=(OFF/ON): shortcuts to start inkscape$\r$\n \
1030       /ALLUSER=(OFF/ON): for all users on the computer$\r$\n \
1031       /DESKTOP=(OFF/ON): Desktop icon$\r$\n \
1032       /QUICKLAUNCH=(OFF/ON): quick launch icon$\r$\n \
1033       /SVGEDITOR=(OFF/ON): default SVG editor$\r$\n \
1034       /CONTEXTMENUE=(OFF/ON): context menue integration$\r$\n \
1035       /ADDFILES=(OFF/ON): additional files$\r$\n \
1036       /EXAMPLES=(OFF/ON): examples$\r$\n \
1037       /TUTORIALS=(OFF/ON): tutorials$\r$\n \
1038       /LANGUAGES=(OFF/ON): translated menues, examples, etc.$\r$\n \
1039       /[locale code]=(OFF/ON): e.g am, es, es_MX as in Inkscape supported"
1040     Abort
1041 FunctionEnd
1043 Function .onSelChange
1044 FunctionEnd
1046 ; --------------------------------------------------
1048 Function un.CustomPageUninstall
1049   !insertmacro MUI_HEADER_TEXT "$(lng_UInstOpt)" "$(lng_UInstOpt1)"
1050   !insertmacro MUI_INSTALLOPTIONS_WRITE "inkscape.nsi.uninstall" "Field 1" "Text" "$APPDATA\Inkscape\preferences.xml"
1051   !insertmacro MUI_INSTALLOPTIONS_WRITE "inkscape.nsi.uninstall" "Field 2" "Text" "$(lng_PurgePrefs)"
1053   !insertmacro MUI_INSTALLOPTIONS_DISPLAY "inkscape.nsi.uninstall"
1054   !insertmacro MUI_INSTALLOPTIONS_READ $MultiUser "inkscape.nsi.uninstall" "Field 2" "State"
1055   DetailPrint "keepfiles = $MultiUser" 
1056           ;MessageBox MB_OK "adminmode = $MultiUser MultiUserOS = $askMultiUser" 
1058 FunctionEnd
1061 Function un.onInit
1063   ClearErrors
1064   StrCpy $User ""
1065         UserInfo::GetName
1066         IfErrors +3
1067         Pop $0
1068         StrCpy $User $0
1070   StrCpy $askMultiUser "1"
1071   StrCpy $MultiUser "1"
1072  
1073   ; Test if this was a multiuser installation
1074   ReadRegStr $0 HKLM "${PRODUCT_DIR_REGKEY}" ""
1075   StrCmp $0  "$INSTDIR\inkscape.exe" 0 +5  
1076     ReadRegStr $MultiUser HKLM "${PRODUCT_DIR_REGKEY}" "MultiUser"
1077     ReadRegStr $askMultiUser HKLM "${PRODUCT_DIR_REGKEY}" "askMultiUser"
1078         ReadRegStr $0 HKLM "${PRODUCT_DIR_REGKEY}" "User"
1079         Goto +4
1080   ReadRegStr $MultiUser HKCU "${PRODUCT_DIR_REGKEY}" "MultiUser"
1081   ReadRegStr $askMultiUser HKCU "${PRODUCT_DIR_REGKEY}" "askMultiUser"
1082   ReadRegStr $0 HKCU "${PRODUCT_DIR_REGKEY}" "User"
1083   ;check user if applicable
1084   StrCmp $0 "" +3
1085     StrCmp $0 $User +2
1086           MessageBox MB_OK|MB_ICONEXCLAMATION "$(lng_DIFFERENT_USER)"
1087     
1088  !insertmacro MUI_INSTALLOPTIONS_EXTRACT "inkscape.nsi.uninstall"
1090  ;check whether Multi user installation ?
1091  SetShellVarContext all
1092  StrCmp $MultiUser "0" 0 +2 
1093  SetShellVarContext current
1094  ;MessageBox MB_OK "adminmode = $MultiUser MultiUserOS = $askMultiUser" 
1095    
1096 FunctionEnd
1098 Section Uninstall
1100   ; remove personal settings
1101   Delete "$APPDATA\Inkscape\extension-errors.log"
1102   StrCmp $MultiUser "0" 0 endPurge  ; multiuser assigned in dialog
1103     DetailPrint "purge personal settings in $APPDATA\Inkscape"
1104     RMDir /r "$APPDATA\Inkscape"
1105   endPurge:
1107   ; Remove file associations for svg editor
1108   DetailPrint "removing file associations for svg editor"
1109   ClearErrors
1110   ReadRegStr $0 HKCR ".svg" ""
1111   DetailPrint ".svg associated as $0"
1112   IfErrors endUninstSVGEdit  
1113     ReadRegStr $1 HKCR "$0\shell\edit\command" ""
1114         IfErrors 0 +2  
1115       DetailPrint "svg editor is $1"
1116     StrCmp $1 '"$INSTDIR\Inkscape.exe" "%1"' 0 +3
1117       DetailPrint "removing default .svg editor"
1118       DeleteRegKey HKCR "$0\shell\edit\command"
1119     DeleteRegKey /ifempty HKCR "$0\shell\edit"
1120     DeleteRegKey /ifempty HKCR "$0\shell"
1121     DeleteRegKey /ifempty HKCR "$0"
1122   endUninstSVGEdit:
1123   
1124   ClearErrors
1125   ReadRegStr $2 HKCR ".svgz" ""
1126   DetailPrint ".svgz associated as $2"
1127   IfErrors endUninstSVGZEdit  
1128     ReadRegStr $3 HKCR "$2\shell\edit\command" ""
1129     IfErrors 0 +2  
1130       DetailPrint "svgz editor is $1"
1131     StrCmp $3 '"$INSTDIR\Inkscape.exe" "%1"' 0 +3
1132       DetailPrint "removing default .svgz editor"
1133       DeleteRegKey HKCR "$2\shell\edit\command"
1134     DeleteRegKey /ifempty HKCR "$2\shell\edit"
1135     DeleteRegKey /ifempty HKCR "$2\shell"
1136     DeleteRegKey /ifempty HKCR "$2"
1137   endUninstSVGZEdit:
1138   
1139   ; Remove file associations for svg editor
1140   DetailPrint "removing file associations for svg editor"
1141   ClearErrors
1142   ReadRegStr $0 HKCR ".svg" ""
1143   IfErrors endUninstSVGView
1144     ReadRegStr $1 HKCR "$0\shell\open\command" ""
1145     IfErrors 0 +2  
1146       DetailPrint "svg viewer is $1"
1147     StrCmp $1 '"$INSTDIR\Inkscape.exe" "%1"' 0 +3
1148       DetailPrint "removing default .svg viewer"
1149       DeleteRegKey HKCR "$0\shell\open\command"
1150     DeleteRegKey /ifempty HKCR "$0\shell\open"
1151     DeleteRegKey /ifempty HKCR "$0\shell"
1152     DeleteRegKey /ifempty HKCR "$0"
1153   endUninstSVGView:
1154   
1155   ClearErrors
1156   ReadRegStr $2 HKCR ".svgz" ""
1157   IfErrors endUninstSVGZView
1158     ReadRegStr $3 HKCR "$2\shell\open\command" ""
1159     IfErrors 0 +2  
1160       DetailPrint "svgz viewer is $1"
1161     StrCmp $3 '"$INSTDIR\Inkscape.exe" "%1"' 0 +3
1162       DetailPrint "removing default .svgz viewer"
1163       DeleteRegKey HKCR "$2\shell\open\command"
1164     DeleteRegKey /ifempty HKCR "$2\shell\open"
1165     DeleteRegKey /ifempty HKCR "$2\shell"
1166     DeleteRegKey /ifempty HKCR "$2"
1167   endUninstSVGZView:
1168   
1169   ; Remove file associations for context menue
1170   DetailPrint "removing file associations for svg editor"
1171   ClearErrors
1172   ReadRegStr $0 HKCR ".svg" ""
1173   IfErrors endUninstSVGContext
1174   DetailPrint "removing default .svg context menue"
1175   DeleteRegKey HKCR "$0\shell\${PRODUCT_NAME}"
1176   DeleteRegKey /ifempty HKCR "$0\shell"
1177   DeleteRegKey /ifempty HKCR "$0"
1178   endUninstSVGContext:
1179   
1180   ClearErrors
1181   ReadRegStr $2 HKCR ".svgz" ""
1182   IfErrors endUninstSVGZContext
1183   DetailPrint "removing default .svgzcontext menue"
1184   DeleteRegKey HKCR "$2\shell\${PRODUCT_NAME}"
1185   DeleteRegKey /ifempty HKCR "$2\shell"
1186   DeleteRegKey /ifempty HKCR "$2"
1187   endUninstSVGZContext:
1189   ReadRegStr $1 HKCR "$0" ""
1190   StrCmp $1 "" 0 +3
1191     DetailPrint "removing filetype .svg $0"
1192     DeleteRegKey HKCR ".svg"
1193   
1194   ReadRegStr $3 HKCR "$2" ""
1195   StrCmp $3 "" 0 +3
1196     DetailPrint "removing filetype .svgz $2"
1197     DeleteRegKey HKCR ".svgz"
1198   
1199     
1200   SetShellVarContext all
1201   DetailPrint "removing product regkey"
1202   DeleteRegKey SHCTX "${PRODUCT_DIR_REGKEY}"
1203   DetailPrint "removing uninstall info"
1204   DeleteRegKey SHCTX "${PRODUCT_UNINST_KEY}"
1205   DetailPrint "removing shortcuts"
1206   Delete "$DESKTOP\Inkscape.lnk"
1207   Delete "$QUICKLAUNCH\Inkscape.lnk"
1208   Delete "$SMPROGRAMS\Inkscape.lnk"
1209   ;just in case they are still there
1210   Delete "$SMPROGRAMS\Inkscape\Uninstall Inkscape.lnk"
1211   Delete "$SMPROGRAMS\Inkscape\Inkscape.lnk"
1212   RMDir  "$SMPROGRAMS\Inkscape"
1214   SetShellVarContext current
1215   DetailPrint "removing product regkey"
1216   DeleteRegKey SHCTX "${PRODUCT_DIR_REGKEY}"
1217   DetailPrint "removing uninstall info"
1218   DeleteRegKey SHCTX "${PRODUCT_UNINST_KEY}"
1219   DetailPrint "removing shortcuts"
1220   Delete "$DESKTOP\Inkscape.lnk"
1221   Delete "$QUICKLAUNCH\Inkscape.lnk"
1222   Delete "$SMPROGRAMS\Inkscape.lnk"
1223   ;just in case they are still there
1224   Delete "$SMPROGRAMS\Inkscape\Uninstall Inkscape.lnk"
1225   Delete "$SMPROGRAMS\Inkscape\Inkscape.lnk"
1226   RMDir  "$SMPROGRAMS\Inkscape"
1228   DetailPrint "removing uninstall info"
1229   RMDir /r "$INSTDIR"
1231   SetAutoClose false
1233 SectionEnd