b58e453f9e1ad5ae556b345258476b8fbe07dbdd
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.46+devel"
11 !define PRODUCT_REVISION 1
12 !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\inkscape.exe"
13 !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
14 ;!define DUMMYINSTALL ; Define this to make it build quickly, not including any of the files or code in the sections, for quick testing of features of the installer and development thereof.
16 ; #######################################
17 ; MUI SETTINGS
18 ; #######################################
19 ; MUI 1.67 compatible ------
20 SetCompressor /SOLID lzma
21 SetCompressorDictSize 32
22 RequestExecutionLevel highest
23 !include "MUI.nsh"
24 !include "LogicLib.nsh"
25 !include "sections.nsh"
26 !define MUI_ABORTWARNING
27 !define MUI_ICON "..\..\inkscape.ico";${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_WELCOMEFINISHPAGE_BITMAP "welcomefinish.bmp"
32 !define MUI_COMPONENTSPAGE_SMALLDESC
34 ;..................................................................................................
35 ;Following two definitions required. Uninstall log will use these definitions.
36 ;You may use these definitions also, when you want to set up the InstallDirRagKey,
37 ;store the language selection, store Start Menu folder etc.
38 ;Enter the windows uninstall reg sub key to add uninstall information to Add/Remove Programs also.
40 !define INSTDIR_REG_ROOT HKLM
41 !define INSTDIR_REG_KEY ${PRODUCT_UNINST_KEY}
43 ;include the Uninstall log header
44 !include AdvUninstLog.nsh
45 !insertmacro INTERACTIVE_UNINSTALL
47 ;For md5dll and messagebox
48 !addplugindir .
50 !include FileFunc.nsh
51 !insertmacro GetParameters
52 !insertmacro GetOptions
53 !insertmacro un.GetParent
55 ; Welcome page
56 !insertmacro MUI_PAGE_WELCOME
57 ; License page
58 ; !define MUI_LICENSEPAGE_RADIOBUTTONS
59 LicenseForceSelection off
60 !define MUI_LICENSEPAGE_BUTTON $(lng_LICENSE_BUTTON)
61 !define MUI_LICENSEPAGE_TEXT_BOTTOM $(lng_LICENSE_BOTTOM_TEXT)
62 !insertmacro MUI_PAGE_LICENSE "..\..\Copying"
63 !insertmacro MUI_PAGE_COMPONENTS
64 ; InstType $(lng_Full)
65 ; InstType $(lng_Optimal)
66 ; InstType $(lng_Minimal)
67 ; Directory page
68 !insertmacro MUI_PAGE_DIRECTORY
69 ; Instfiles page
70 !insertmacro MUI_PAGE_INSTFILES
71 ; Finish page
72 !define MUI_FINISHPAGE_RUN "$INSTDIR\inkscape.exe"
73 !insertmacro MUI_PAGE_FINISH
75 ; Uninstaller pages
76 !insertmacro MUI_UNPAGE_CONFIRM
77 UninstPage custom un.CustomPageUninstall
78 !insertmacro MUI_UNPAGE_INSTFILES
79 ShowUninstDetails hide
80 !insertmacro MUI_UNPAGE_FINISH
82 ; #######################################
83 ; STRING LOCALIZATION
84 ; #######################################
85 ; Thanks to Adib Taraben and Luca Bruno for getting this started
86 ; Add your translation here! :-)
87 ; I had wanted to list the languages alphabetically, but apparently
88 ; the first is the default. So putting English first is just being
89 ; practical. It is not chauvinism or hubris, I swear! ;-)
90 ; default language first
92 ; Language files
93 !insertmacro MUI_RESERVEFILE_LANGDLL
94 !include English.nsh
95 !include Breton.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
109 !include SimpChinese.nsh
110 !include TradChinese.nsh
112 ReserveFile "inkscape.nsi.uninstall"
113 ReserveFile "${NSISDIR}\Plugins\UserInfo.dll"
114 !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
116 ; #######################################
117 ; SETTINGS
118 ; #######################################
120 Name "${PRODUCT_NAME}"
121 Caption "$(lng_Caption)"
122 BrandingText "$(lng_Caption)"
123 !ifndef PRODUCT_REVISION
124 OutFile "Inkscape-${PRODUCT_VERSION}.exe"
125 !else
126 OutFile "Inkscape-${PRODUCT_VERSION}-${PRODUCT_REVISION}.exe"
127 !endif
128 InstallDir "$PROGRAMFILES\Inkscape"
129 InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
131 Var askMultiUser
132 Var filename
133 Var MultiUser
134 Var User
135 Var CMDARGS
137 ; #######################################
138 ; I N S T A L L E R S E C T I O N S
139 ; #######################################
141 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
143 ;;;;;;;;;;;;;;;;;;;;;;;;;;
144 ; Delete prefs
145 ; code originally taken from the vlc project
146 ;;;;;;;;;;;;;;;;;;;;;;;;;;
147 !macro delprefs
148 StrCpy $0 0
149 DetailPrint "Delete personal preferences ..."
150 DetailPrint "try to find all users ..."
151 ${Do}
152 ; FIXME
153 ; this will loop through all the logged users and "virtual" windows users
154 ; (it looks like users are only present in HKEY_USERS when they are logged in)
155 ClearErrors
156 EnumRegKey $1 HKU "" $0
157 ${IfThen} $1 == "" ${|} ${ExitDo} ${|}
158 IntOp $0 $0 + 1
159 ReadRegStr $2 HKU "$1\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" AppData
160 ${IfThen} $2 == "" ${|} ${Continue} ${|}
161 DetailPrint "$2\Inkscape will be removed"
162 Delete "$2\Inkscape\preferences.xml"
163 Delete "$2\Inkscape\extension-errors.log"
164 RMDir "$2\Inkscape"
165 ${Loop}
166 !macroend
169 ;--------------------------------
170 ; Installer Sections
171 Section -removeInkscape
172 !ifndef DUMMYINSTALL
173 ; check for an old installation and clean its DLLs etc.
174 FindFirst $0 $1 $INSTDIR\*.*
175 ${Do}
176 ${IfThen} $1 == "" ${|} ${ExitDo} ${|}
177 ${If} $1 == "."
178 ${OrIf} $1 == ".."
179 FindNext $0 $1
180 ${Continue}
181 ${EndIf}
182 ${If} ${Cmd} ${|} MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "$(lng_ClearDirectoryBefore)" /SD IDCANCEL IDCANCEL ${|}
183 FindFirst $0 $1 $INSTDIR\*.*
184 ${Continue}
185 ${Else}
186 ${EndIf}
187 ${Loop}
188 ;remove the old Inkscape shortcuts from the startmenu
189 ;just in case they are still there
190 SetShellVarContext current
191 Delete "$SMPROGRAMS\Inkscape\Uninstall Inkscape.lnk"
192 Delete "$SMPROGRAMS\Inkscape\Inkscape.lnk"
193 RMDir "$SMPROGRAMS\Inkscape"
194 Delete "$SMPROGRAMS\Inkscape.lnk"
195 SetShellVarContext all
196 Delete "$SMPROGRAMS\Inkscape\Uninstall Inkscape.lnk"
197 Delete "$SMPROGRAMS\Inkscape\Inkscape.lnk"
198 RMDir "$SMPROGRAMS\Inkscape"
199 Delete "$SMPROGRAMS\Inkscape.lnk"
200 !endif
201 SectionEnd
203 Section $(lng_Core) SecCore
204 SectionIn 1 2 3 RO
205 !ifndef DUMMYINSTALL
206 DetailPrint "Installing Inkscape Core Files ..."
207 SetOutPath $INSTDIR
208 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
209 SetOverwrite on
210 SetAutoClose false
212 File /a "..\..\inkscape\ink*.exe"
213 File /a "..\..\inkscape\AUTHORS"
214 File /a "..\..\inkscape\COPYING"
215 File /a "..\..\inkscape\COPYING.LIB"
216 File /a "..\..\inkscape\NEWS"
217 File /a "..\..\inkscape\gspawn-win32-helper.exe"
218 File /a "..\..\inkscape\gspawn-win32-helper-console.exe"
219 File /nonfatal /a "..\..\inkscape\HACKING.txt"
220 File /a "..\..\inkscape\README"
221 File /nonfatal /a "..\..\inkscape\README.txt"
222 File /a "..\..\inkscape\TRANSLATORS"
223 File /nonfatal /a /r "..\..\inkscape\data"
224 File /nonfatal /a /r "..\..\inkscape\doc"
225 File /nonfatal /a /r "..\..\inkscape\plugins"
226 File /nonfatal /a /r /x *.??*.???* /x "examples" /x "tutorials" "..\..\inkscape\share"
227 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
228 ; this files are added because it slips through the filter
229 SetOutPath $INSTDIR\share\clipart
230 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
231 File /a "..\..\inkscape\share\clipart\inkscape.logo.svg"
232 ;File /a "..\..\inkscape\share\clipart\inkscape.logo.classic.svg"
233 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
234 SetOutPath $INSTDIR\share\icons
235 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
236 File /a "..\..\inkscape\share\icons\inkscape.file.png"
237 File /a "..\..\inkscape\share\icons\inkscape.file.svg"
238 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
239 SetOutPath $INSTDIR\modules
240 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
241 File /nonfatal /a /r "..\..\inkscape\modules\*.*"
242 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
243 SetOutPath $INSTDIR\python
244 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
245 File /nonfatal /a /r "..\..\inkscape\python\*.*"
246 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
247 !endif
248 SectionEnd
250 Section $(lng_GTKFiles) SecGTK
251 SectionIn 1 2 3 RO
252 !ifndef DUMMYINSTALL
253 DetailPrint "Installing GTK Files ..."
254 SetOutPath $INSTDIR
255 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
256 SetOverwrite on
257 File /a /r "..\..\inkscape\*.dll"
258 File /a /r /x "locale" "..\..\inkscape\lib"
259 File /a /r "..\..\inkscape\etc"
260 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
261 !endif
262 SectionEnd
264 Section -SetCurrentUserOnly
265 !ifndef DUMMYINSTALL
266 StrCpy $MultiUser 0
267 SetShellVarContext current
268 !endif
269 SectionEnd
271 Section $(lng_Alluser) SecAlluser
272 SectionIn 1 2 3
273 !ifndef DUMMYINSTALL
274 ; disable this option in Win95/Win98/WinME
275 StrCpy $MultiUser 1
276 DetailPrint "admin mode, registry root will be HKLM"
277 SetShellVarContext all
278 !endif
279 SectionEnd
281 SectionGroup $(lng_Shortcuts) SecShortcuts
283 Section $(lng_Desktop) SecDesktop
284 !ifndef DUMMYINSTALL
285 ClearErrors
286 CreateShortCut "$DESKTOP\Inkscape.lnk" "$INSTDIR\inkscape.exe"
287 ${IfThen} ${Errors} ${|} DetailPrint "Uups! Problems creating desktop shortcuts" ${|}
288 !endif
289 SectionEnd
291 Section $(lng_Quicklaunch) SecQuicklaunch
292 !ifndef DUMMYINSTALL
293 ClearErrors
294 ${IfThen} $QUICKLAUNCH != $TEMP ${|} CreateShortCut "$QUICKLAUNCH\Inkscape.lnk" "$INSTDIR\inkscape.exe" ${|}
295 ${IfThen} ${Errors} ${|} DetailPrint "Uups! Problems creating quicklaunch shortcuts" ${|}
296 !endif
297 SectionEnd
299 Section $(lng_SVGWriter) SecSVGWriter
300 SectionIn 1 2 3
301 !ifndef DUMMYINSTALL
302 ; create file associations, test before if needed
303 DetailPrint "creating file associations"
304 ClearErrors
305 ReadRegStr $0 HKCR ".svg" ""
306 ${If} $0 == ""
307 WriteRegStr HKCR ".svg" "" "svgfile"
308 WriteRegStr HKCR "svgfile" "" "Scalable Vector Graphics file"
309 ${EndIf}
310 ReadRegStr $0 HKCR ".svgz" ""
311 ${If} $0 == ""
312 WriteRegStr HKCR ".svgz" "" "svgfile"
313 WriteRegStr HKCR "svgfile" "" "Scalable Vector Graphics file"
314 ${EndIf}
315 ${IfThen} ${Errors} ${|} DetailPrint "Uups! Problems creating file assoziations for svg writer" ${|}
317 DetailPrint "creating default editor"
318 ClearErrors
319 ReadRegStr $0 HKCR ".svg" ""
320 WriteRegStr HKCR "$0\shell\edit\command" "" '"$INSTDIR\Inkscape.exe" "%1"'
321 ReadRegStr $0 HKCR ".svgz" ""
322 WriteRegStr HKCR "$0\shell\edit\command" "" '"$INSTDIR\Inkscape.exe" "%1"'
323 ${IfThen} ${Errors} ${|} DetailPrint "Uups! Problems creating default editor" ${|}
324 !endif
325 SectionEnd
327 Section $(lng_ContextMenu) SecContextMenu
328 SectionIn 1 2 3
329 !ifndef DUMMYINSTALL
330 ; create file associations, test before if needed
331 DetailPrint "creating file associations"
332 ClearErrors
333 ReadRegStr $0 HKCR ".svg" ""
334 ${If} $0 == ""
335 WriteRegStr HKCR ".svg" "" "svgfile"
336 WriteRegStr HKCR "svgfile" "" "Scalable Vector Graphics file"
337 ${EndIf}
339 ReadRegStr $0 HKCR ".svgz" ""
340 ${If} $0 == ""
341 WriteRegStr HKCR ".svgz" "" "svgfile"
342 WriteRegStr HKCR "svgfile" "" "Scalable Vector Graphics file"
343 ${EndIf}
345 ${IfThen} ${Errors} ${|} DetailPrint "Uups! Problems creating file assoziations for context menu" ${|}
347 DetailPrint "creating context menue"
348 ClearErrors
349 ReadRegStr $0 HKCR ".svg" ""
350 WriteRegStr HKCR "$0\shell\${PRODUCT_NAME}\command" "" '"$INSTDIR\Inkscape.exe" "%1"'
351 ReadRegStr $0 HKCR ".svgz" ""
352 WriteRegStr HKCR "$0\shell\${PRODUCT_NAME}\command" "" '"$INSTDIR\Inkscape.exe" "%1"'
353 ${IfThen} ${Errors} ${|} DetailPrint "Uups! Problems creating context menue integration" ${|}
354 !endif
355 SectionEnd
357 SectionGroupEnd
359 Section /o $(lng_DeletePrefs) SecPrefs
360 !ifndef DUMMYINSTALL
361 !insertmacro delprefs
362 !endif
363 SectionEnd
365 SectionGroup $(lng_Addfiles) SecAddfiles
367 Section $(lng_Examples) SecExamples
368 SectionIn 1 2
369 !ifndef DUMMYINSTALL
370 SetOutPath $INSTDIR\share
371 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
372 File /nonfatal /a /r /x "*.??*.???*" "..\..\inkscape\share\examples"
373 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
374 !endif
375 SectionEnd
377 Section $(lng_Tutorials) SecTutorials
378 SectionIn 1 2
379 !ifndef DUMMYINSTALL
380 SetOutPath $INSTDIR\share
381 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
382 File /nonfatal /a /r /x "*.??*.???*" "..\..\inkscape\share\tutorials"
383 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
384 !endif
385 SectionEnd
387 SectionGroupEnd
389 SectionGroup $(lng_Languages) SecLanguages
390 !macro Language SecName lng
391 Section /o $(lng_${lng}) Sec${SecName}
392 ;SectionIn 1 2 3
393 !ifndef DUMMYINSTALL
394 SetOutPath $INSTDIR
395 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
396 File /nonfatal /a "..\..\inkscape\*.${lng}.txt" ; FIXME: remove this? No such files.
397 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
398 SetOutPath $INSTDIR\locale
399 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
400 File /nonfatal /a /r "..\..\inkscape\locale\${lng}"
401 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
402 SetOutPath $INSTDIR\lib\locale
403 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
404 File /nonfatal /a /r "..\..\inkscape\lib\locale\${lng}"
405 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
406 SetOutPath $INSTDIR\share\clipart
407 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
408 File /nonfatal /a /r "..\..\inkscape\share\clipart\*.${lng}.svg"
409 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
410 ; the keyboard tables
411 SetOutPath $INSTDIR\share\screens
412 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
413 File /nonfatal /a /r "..\..\inkscape\share\screens\*.${lng}.svg"
414 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
415 SetOutPath $INSTDIR\share\templates
416 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
417 File /nonfatal /a /r "..\..\inkscape\share\templates\*.${lng}.svg"
418 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
419 SetOutPath $INSTDIR\doc
420 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
421 File /nonfatal /a /r "..\..\inkscape\doc\keys.${lng}.xml"
422 File /nonfatal /a /r "..\..\inkscape\doc\keys.${lng}.html"
423 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
424 SectionGetFlags ${SecTutorials} $R1
425 IntOp $R1 $R1 & ${SF_SELECTED}
426 ${If} $R1 >= ${SF_SELECTED}
427 SetOutPath $INSTDIR\share\tutorials
428 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
429 File /nonfatal /a "..\..\inkscape\share\tutorials\*.${lng}.*"
430 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
431 ${EndIf}
432 !endif
433 SectionEnd
434 !macroend
436 !insertmacro Language Amharic am
437 !insertmacro Language Arabic ar
438 !insertmacro Language Azerbaijani az
439 !insertmacro Language Byelorussian be
440 !insertmacro Language Bulgarian bg
441 !insertmacro Language Bengali bn
442 !insertmacro Language Breton br
443 !insertmacro Language Catalan ca
444 !insertmacro Language CatalanValencia ca@valencia
445 !insertmacro Language Czech cs
446 !insertmacro Language Danish da
447 !insertmacro Language German de
448 !insertmacro Language Dzongkha dz
449 !insertmacro Language Greek el
450 !insertmacro Language EnglishAustralian en_AU
451 !insertmacro Language EnglishCanadian en_CA
452 !insertmacro Language EnglishBritain en_GB
453 !insertmacro Language EnglishPiglatin en_US@piglatin
454 !insertmacro Language Esperanto eo
455 !insertmacro Language Spanish es
456 !insertmacro Language SpanishMexico es_MX
457 !insertmacro Language Estonian et
458 !insertmacro Language Basque eu
459 !insertmacro Language French fr
460 !insertmacro Language Finnish fi
461 !insertmacro Language Irish ga
462 !insertmacro Language Gallegan gl
463 !insertmacro Language Hebrew he
464 !insertmacro Language Croatian hr
465 !insertmacro Language Hungarian hu
466 !insertmacro Language Indonesian id
467 !insertmacro Language Italian it
468 !insertmacro Language Japanese ja
469 !insertmacro Language Khmer km
470 !insertmacro Language Korean ko
471 !insertmacro Language Lithuanian lt
472 !insertmacro Language Mongolian mn
473 !insertmacro Language Macedonian mk
474 !insertmacro Language NorwegianBokmal nb
475 !insertmacro Language Nepali ne
476 !insertmacro Language Dutch nl
477 !insertmacro Language NorwegianNynorsk nn
478 !insertmacro Language Panjabi pa
479 !insertmacro Language Polish pl
480 !insertmacro Language Portuguese pt
481 !insertmacro Language PortugueseBrazil pt_BR
482 !insertmacro Language Romanian ro
483 !insertmacro Language Russian ru
484 !insertmacro Language Kinyarwanda rw
485 !insertmacro Language Slovak sk
486 !insertmacro Language Slovenian sl
487 !insertmacro Language Albanian sq
488 !insertmacro Language Serbian sr
489 !insertmacro Language SerbianLatin sr@latin
490 !insertmacro Language Swedish sv
491 !insertmacro Language Thai th
492 !insertmacro Language Turkish tr
493 !insertmacro Language Ukrainian uk
494 !insertmacro Language Vietnamese vi
495 !insertmacro Language ChineseSimplified zh_CN
496 !insertmacro Language ChineseTaiwan zh_TW
497 SectionGroupEnd
500 Section -FinalizeInstallation
501 !ifndef DUMMYINSTALL
502 DetailPrint "finalize installation"
503 ${If} $MultiUser = 1
504 DetailPrint "admin mode, registry root will be HKLM"
505 SetShellVarContext all
506 ${Else}
507 DetailPrint "single user mode, registry root will be HKCU"
508 SetShellVarContext current
509 ${EndIf}
511 ; check for writing registry
512 ClearErrors
513 WriteRegStr SHCTX "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\inkscape.exe"
514 ;${If} ${Errors}
515 ; DetailPrint "fatal: failed to write to ${PRODUCT_DIR_REGKEY}"
516 ; DetailPrint "aborting installation"
517 ; Abort
518 ;${EndIf}
519 WriteRegStr SHCTX "${PRODUCT_DIR_REGKEY}" "MultiUser" $MultiUser
520 WriteRegStr SHCTX "${PRODUCT_DIR_REGKEY}" "askMultiUser" $askMultiUser
521 WriteRegStr SHCTX "${PRODUCT_DIR_REGKEY}" "User" $User
522 ${IfThen} ${Errors} ${|} DetailPrint "Fatal: failed to write to registry installation info" ${|}
524 ; start menu entries
525 ClearErrors
526 CreateShortCut "$SMPROGRAMS\Inkscape.lnk" "$INSTDIR\inkscape.exe"
527 ${IfThen} ${Errors} ${|} DetailPrint "Fatal: failed to write to start menu info" ${|}
529 ; uninstall settings
530 ClearErrors
531 ; WriteUninstaller "$INSTDIR\uninst.exe"
532 WriteRegExpandStr SHCTX "${PRODUCT_UNINST_KEY}" "UninstallString" "${UNINST_EXE}"
533 WriteRegExpandStr SHCTX "${PRODUCT_UNINST_KEY}" "InstallDir" "$INSTDIR"
534 WriteRegExpandStr SHCTX "${PRODUCT_UNINST_KEY}" "InstallLocation" "$INSTDIR"
535 WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "DisplayName" "${PRODUCT_NAME} ${PRODUCT_VERSION}"
536 WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\Inkscape.exe,0"
537 WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
538 WriteRegDWORD SHCTX "${PRODUCT_UNINST_KEY}" "NoModify" "1"
539 WriteRegDWORD SHCTX "${PRODUCT_UNINST_KEY}" "NoRepair" "1"
540 ${IfThen} ${Errors} ${|} DetailPrint "fatal: failed to write to registry un-installation info" ${|}
542 ;create/update log always within .onInstSuccess function
543 !insertmacro UNINSTALL.LOG_UPDATE_INSTALL
545 DetailPrint "Creating MD5 checksums..."
546 ClearErrors
547 FileOpen $0 $INSTDIR\Uninstall.dat r
548 FileOpen $9 $INSTDIR\Uninstall.log w
549 ${IfNot} ${Errors}
550 ${Do}
551 ClearErrors
552 FileRead $0 $1
553 ${IfThen} ${Errors} ${|} ${ExitDo} ${|}
554 StrCpy $1 $1 -2
555 md5dll::GetMD5File /NOUNLOAD $1
556 Pop $2
557 ${IfThen} $2 != "" ${|} FileWrite $9 "$2 $1$\r$\n" ${|}
558 ${Loop}
559 ${EndIf}
560 FileClose $0
561 FileClose $9
562 ; Not needed any more
563 Delete $INSTDIR\Uninstall.dat
564 !endif
565 SectionEnd
567 ; Last the Descriptions
568 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
569 !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} $(lng_CoreDesc)
570 !insertmacro MUI_DESCRIPTION_TEXT ${SecGTK} $(lng_GTKFilesDesc)
571 !insertmacro MUI_DESCRIPTION_TEXT ${SecShortcuts} $(lng_ShortcutsDesc)
572 !insertmacro MUI_DESCRIPTION_TEXT ${SecAlluser} $(lng_AlluserDesc)
573 !insertmacro MUI_DESCRIPTION_TEXT ${SecDesktop} $(lng_DesktopDesc)
574 !insertmacro MUI_DESCRIPTION_TEXT ${SecQuicklaunch} $(lng_QuicklaunchDesc)
575 !insertmacro MUI_DESCRIPTION_TEXT ${SecSVGWriter} $(lng_SVGWriterDesc)
576 !insertmacro MUI_DESCRIPTION_TEXT ${SecContextMenu} $(lng_ContextMenuDesc)
577 !insertmacro MUI_DESCRIPTION_TEXT ${SecPrefs} $(lng_DeletePrefsDesc)
578 !insertmacro MUI_DESCRIPTION_TEXT ${SecAddfiles} $(lng_AddfilesDesc)
579 !insertmacro MUI_DESCRIPTION_TEXT ${SecExamples} $(lng_ExamplesDesc)
580 !insertmacro MUI_DESCRIPTION_TEXT ${SecTutorials} $(lng_TutorialsDesc)
581 !insertmacro MUI_DESCRIPTION_TEXT ${SecLanguages} $(lng_LanguagesDesc)
582 !insertmacro MUI_FUNCTION_DESCRIPTION_END
584 !macro Parameter key Section
585 ${GetOptions} $CMDARGS "/${key}=" $1
586 ${If} $1 == "OFF"
587 SectionGetFlags ${Section} $0
588 IntOp $2 ${SF_SELECTED} ~
589 IntOp $0 $0 & $2
590 SectionSetFlags ${Section} $0
591 ${EndIf}
592 ${If} $1 == "ON"
593 SectionGetFlags ${Section} $0
594 IntOp $0 $0 | ${SF_SELECTED}
595 SectionSetFlags ${Section} $0
596 ${EndIf}
597 !macroend
599 Function .onInit
600 !insertmacro MUI_LANGDLL_DISPLAY
602 !macro LanguageAutoSelect SecName LocaleID
603 ${If} $LANGUAGE = ${LocaleID}
604 SectionGetFlags ${Sec${SecName}} $0
605 IntOp $0 $0 | ${SF_SELECTED}
606 SectionSetFlags ${Sec${SecName}} $0
607 ${EndIf}
608 !macroend
610 ;!insertmacro LanguageAutoSelect English 1033
611 !insertmacro LanguageAutoSelect Breton 1150
612 !insertmacro LanguageAutoSelect Catalan 1027
613 !insertmacro LanguageAutoSelect Czech 1029
614 !insertmacro LanguageAutoSelect Finnish 1035
615 !insertmacro LanguageAutoSelect French 1036
616 !insertmacro LanguageAutoSelect Gallegan 1110 ; Galician, but section is called Gallegan
617 !insertmacro LanguageAutoSelect German 1031
618 !insertmacro LanguageAutoSelect Italian 1040
619 !insertmacro LanguageAutoSelect Japanese 1041
620 !insertmacro LanguageAutoSelect Polish 1045
621 !insertmacro LanguageAutoSelect Russian 1049
622 !insertmacro LanguageAutoSelect Slovak 1051
623 !insertmacro LanguageAutoSelect Slovenian 1060
624 !insertmacro LanguageAutoSelect Spanish 1034
625 !insertmacro LanguageAutoSelect ChineseTaiwan 1028 ; TradChinese, but section is called ChineseTaiwan
627 ${GetParameters} $CMDARGS
628 ;prepare log always within .onInit function
629 !insertmacro UNINSTALL.LOG_PREPARE_INSTALL
631 ;Extract InstallOptions INI files
632 StrCpy $AskMultiUser "1"
633 StrCpy $MultiUser "0"
634 ; this resets AskMultiUser if Win95/98/ME
635 ClearErrors
636 ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
637 ${If} ${Errors}
638 ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion" VersionNumber
639 StrCpy $R0 $R0 1
640 ${IfThen} $R0 = 4 ${|} StrCpy $AskMultiUser 0 ${|}
641 ${EndIf}
643 ; hide all user section if ME/9x
644 ${IfThen} $AskMultiUser != 1 ${|} SectionSetText ${SecAlluser} "" ${|}
646 ; hide if quick launch if not available
647 ${IfThen} $QUICKLAUNCH == $TEMP ${|} SectionSetText ${SecQuicklaunch} "" ${|}
649 ;check if user is admin
650 ClearErrors
651 UserInfo::GetName
652 ${If} ${Errors}
653 # This one means you don't need to care about admin or
654 # not admin because Windows 9x doesn't either
655 ${IfCmd} MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "$(lng_NOT_SUPPORTED)$(lng_OK_CANCEL_DESC)" /SD IDOK IDCANCEL ${||} Quit ${|}
656 ${Else}
657 Pop $User
658 UserInfo::GetAccountType
659 Pop $1
660 ${If} $1 != "Admin"
661 ${AndIf} ${Cmd} ${|} MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "$(lng_NO_ADMIN)$(lng_OK_CANCEL_DESC)" /SD IDOK IDCANCEL ${|}
662 Quit
663 ${EndIf}
664 ${EndIf}
666 ;check for previous installation
667 ReadRegStr $0 HKLM "${PRODUCT_DIR_REGKEY}" "User"
668 ${IfThen} $0 == "" ${|} ReadRegStr $0 HKCU "${PRODUCT_DIR_REGKEY}" "User" ${|}
669 ;check user if applicable
670 ${If} $0 != ""
671 ${AndIf} $0 != $User
672 ${AndIf} ${Cmd} ${|} MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "$(lng_DIFFERENT_USER)$(lng_OK_CANCEL_DESC)" /SD IDOK IDCANCEL ${|}
673 Quit
674 ${EndIf}
676 ; call uninstall first
677 ; code taken from the vlc project
678 ReadRegStr $R0 HKLM ${PRODUCT_UNINST_KEY} "UninstallString"
679 ReadRegStr $R1 HKLM ${PRODUCT_UNINST_KEY} "DisplayName"
680 ${If} $R0 == ""
681 ReadRegStr $R0 HKCU ${PRODUCT_UNINST_KEY} "UninstallString"
682 ReadRegStr $R1 HKCU ${PRODUCT_UNINST_KEY} "DisplayName"
683 ${EndIf}
684 ${If} $R0 != ""
685 ${AndIf} ${Cmd} ${|} MessageBox MB_YESNO|MB_ICONEXCLAMATION $(lng_WANT_UNINSTALL_BEFORE) /SD IDNO IDYES ${|}
686 ;Run the uninstaller
687 DetailPrint "Execute $R0 in $INSTDIR"
688 ClearErrors
689 ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
690 ${EndIf}
692 ; proccess command line parameter
693 !insertmacro Parameter "GTK" ${SecGTK}
694 !insertmacro Parameter "SHORTCUTS" ${secShortcuts}
695 !insertmacro Parameter "ALLUSER" ${SecAlluser}
696 !insertmacro Parameter "DESKTOP" ${SecDesktop}
697 !insertmacro Parameter "QUICKLAUNCH" ${SecQUICKlaunch}
698 !insertmacro Parameter "SVGEDITOR" ${SecSVGWriter}
699 !insertmacro Parameter "CONTEXTMENUE" ${SecContextMenu}
700 !insertmacro Parameter "PREFERENCES" ${SecPrefs}
701 !insertmacro Parameter "ADDFILES" ${SecAddfiles}
702 !insertmacro Parameter "EXAMPLES" ${SecExamples}
703 !insertmacro Parameter "TUTORIALS" ${SecTutorials}
704 !insertmacro Parameter "LANGUAGES" ${SecLanguages}
705 !insertmacro Parameter "am" ${SecAmharic}
706 !insertmacro Parameter "ar" ${SecArabic}
707 !insertmacro Parameter "az" ${SecAzerbaijani}
708 !insertmacro Parameter "be" ${SecByelorussian}
709 !insertmacro Parameter "bg" ${SecBulgarian}
710 !insertmacro Parameter "bn" ${SecBengali}
711 !insertmacro Parameter "br" ${SecBreton}
712 !insertmacro Parameter "ca" ${SecCatalan}
713 !insertmacro Parameter "ca@valencia" ${SecCatalanValencia}
714 !insertmacro Parameter "cs" ${SecCzech}
715 !insertmacro Parameter "da" ${SecDanish}
716 !insertmacro Parameter "de" ${SecGerman}
717 !insertmacro Parameter "dz" ${SecDzongkha}
718 !insertmacro Parameter "el" ${SecGreek}
719 !insertmacro Parameter "en_AU" ${SecEnglishAustralian}
720 !insertmacro Parameter "en_CA" ${SecEnglishCanadian}
721 !insertmacro Parameter "en_GB" ${SecEnglishBritain}
722 !insertmacro Parameter "en_US@piglatin" ${SecEnglishPiglatin}
723 !insertmacro Parameter "eo" ${SecEsperanto}
724 !insertmacro Parameter "es" ${SecSpanish}
725 !insertmacro Parameter "es_MX" ${SecSpanishMexico}
726 !insertmacro Parameter "et" ${SecEstonian}
727 !insertmacro Parameter "eu" ${SecBasque}
728 !insertmacro Parameter "fi" ${SecFinnish}
729 !insertmacro Parameter "fr" ${SecFrench}
730 !insertmacro Parameter "ga" ${SecIrish}
731 !insertmacro Parameter "gl" ${SecGallegan}
732 !insertmacro Parameter "he" ${SecHebrew}
733 !insertmacro Parameter "hr" ${SecCroatian}
734 !insertmacro Parameter "hu" ${SecHungarian}
735 !insertmacro Parameter "id" ${SecIndonesian}
736 !insertmacro Parameter "it" ${SecItalian}
737 !insertmacro Parameter "ja" ${SecJapanese}
738 !insertmacro Parameter "km" ${SecKhmer}
739 !insertmacro Parameter "ko" ${SecKorean}
740 !insertmacro Parameter "lt" ${SecLithuanian}
741 !insertmacro Parameter "mk" ${SecMacedonian}
742 !insertmacro Parameter "mn" ${SecMongolian}
743 !insertmacro Parameter "nb" ${SecNorwegianBokmal}
744 !insertmacro Parameter "ne" ${SecNepali}
745 !insertmacro Parameter "nl" ${SecDutch}
746 !insertmacro Parameter "nn" ${SecNorwegianNynorsk}
747 !insertmacro Parameter "pa" ${SecPanjabi}
748 !insertmacro Parameter "pl" ${SecPolish}
749 !insertmacro Parameter "pt" ${SecPortuguese}
750 !insertmacro Parameter "pt_BR" ${SecPortugueseBrazil}
751 !insertmacro Parameter "ro" ${SecRomanian}
752 !insertmacro Parameter "ru" ${SecRussian}
753 !insertmacro Parameter "rw" ${SecKinyarwanda}
754 !insertmacro Parameter "sk" ${SecSlovak}
755 !insertmacro Parameter "sl" ${SecSlovenian}
756 !insertmacro Parameter "sq" ${SecAlbanian}
757 !insertmacro Parameter "sr" ${SecSerbian}
758 !insertmacro Parameter "sr@latin" ${SecSerbianLatin}
759 !insertmacro Parameter "sv" ${SecSwedish}
760 !insertmacro Parameter "th" ${SecThai}
761 !insertmacro Parameter "tr" ${SecTurkish}
762 !insertmacro Parameter "uk" ${SecUkrainian}
763 !insertmacro Parameter "vi" ${SecVietnamese}
764 !insertmacro Parameter "zh_CN" ${SecChineseSimplified}
765 !insertmacro Parameter "zh_TW" ${SecChineseTaiwan}
767 ClearErrors
768 ${GetOptions} $CMDARGS "/?" $1
769 ${IfNot} ${Errors}
770 MessageBox MB_OK "Possible parameters for installer:$\r$\n \
771 /?: this help screen$\r$\n \
772 /S: silent$\r$\n \
773 /D=(directory): where to install Inkscape$\r$\n \
774 /GTK=(OFF/ON): GTK+ Runtime environment$\r$\n \
775 /SHORTCUTS=(OFF/ON): shortcuts to start Inkscape$\r$\n \
776 /ALLUSER=(OFF/ON): for all users on the computer$\r$\n \
777 /DESKTOP=(OFF/ON): Desktop icon$\r$\n \
778 /QUICKLAUNCH=(OFF/ON): quick launch icon$\r$\n \
779 /SVGEDITOR=(OFF/ON): default SVG editor$\r$\n \
780 /CONTEXTMENUE=(OFF/ON): context menue integration$\r$\n \
781 /PREFERENCES=(OFF/ON): delete users preference files$\r$\n \
782 /ADDFILES=(OFF/ON): additional files$\r$\n \
783 /EXAMPLES=(OFF/ON): examples$\r$\n \
784 /TUTORIALS=(OFF/ON): tutorials$\r$\n \
785 /LANGUAGES=(OFF/ON): translated menues, examples, etc.$\r$\n \
786 /[locale code]=(OFF/ON): e.g am, es, es_MX as in Inkscape supported"
787 Abort
788 ${EndIf}
789 FunctionEnd
791 ; --------------------------------------------------
793 Function un.CustomPageUninstall
794 !insertmacro MUI_HEADER_TEXT "$(lng_UInstOpt)" "$(lng_UInstOpt1)"
795 !insertmacro MUI_INSTALLOPTIONS_WRITE "inkscape.nsi.uninstall" "Field 1" "Text" "$APPDATA\Inkscape\"
796 !insertmacro MUI_INSTALLOPTIONS_WRITE "inkscape.nsi.uninstall" "Field 2" "Text" "$(lng_PurgePrefs)"
798 !insertmacro MUI_INSTALLOPTIONS_DISPLAY "inkscape.nsi.uninstall"
799 !insertmacro MUI_INSTALLOPTIONS_READ $MultiUser "inkscape.nsi.uninstall" "Field 2" "State"
800 DetailPrint "keepfiles = $MultiUser"
801 ;MessageBox MB_OK "adminmode = $MultiUser MultiUserOS = $askMultiUser"
803 FunctionEnd
805 Function un.onInit
806 ;begin uninstall, could be added on top of uninstall section instead
807 ;!insertmacro UNINSTALL.LOG_BEGIN_UNINSTALL
808 ${IfNot} ${FileExists} $INSTDIR\uninstall.log
809 MessageBox MB_OK|MB_ICONEXCLAMATION "$(lng_UninstallLogNotFound)" /SD IDOK
810 Quit
811 ${EndIf}
812 ClearErrors
813 StrCpy $User ""
814 UserInfo::GetName
815 ${IfNot} ${Errors}
816 Pop $0
817 StrCpy $User $0
818 ${EndIf}
819 StrCpy $askMultiUser 1
820 StrCpy $MultiUser 1
822 ; Test if this was a multiuser installation
823 ReadRegStr $0 HKLM "${PRODUCT_DIR_REGKEY}" ""
824 ${If} $0 == "$INSTDIR\inkscape.exe"
825 ReadRegStr $MultiUser HKLM "${PRODUCT_DIR_REGKEY}" "MultiUser"
826 ReadRegStr $askMultiUser HKLM "${PRODUCT_DIR_REGKEY}" "askMultiUser"
827 ReadRegStr $0 HKLM "${PRODUCT_DIR_REGKEY}" "User"
828 ${Else}
829 ReadRegStr $MultiUser HKCU "${PRODUCT_DIR_REGKEY}" "MultiUser"
830 ReadRegStr $askMultiUser HKCU "${PRODUCT_DIR_REGKEY}" "askMultiUser"
831 ReadRegStr $0 HKCU "${PRODUCT_DIR_REGKEY}" "User"
832 ${EndIf}
833 ;check user if applicable
834 ${If} $0 != ""
835 ${AndIf} $0 != $User
836 ${AndIf} ${Cmd} ${|} MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "$(lng_DIFFERENT_USER)$(lng_OK_CANCEL_DESC)" /SD IDOK IDCANCEL ${|}
837 Quit
838 ${EndIf}
840 !insertmacro MUI_INSTALLOPTIONS_EXTRACT "inkscape.nsi.uninstall"
842 SetShellVarContext all
843 ${IfThen} $MultiUser = 0 ${|} SetShellVarContext current ${|}
844 FunctionEnd
846 Section Uninstall
847 !ifndef DUMMYINSTALL
848 ; remove personal settings
849 Delete "$APPDATA\Inkscape\extension-errors.log"
850 ${If} $MultiUser = 0
851 DetailPrint "purge personal settings in $APPDATA\Inkscape"
852 ;RMDir /r "$APPDATA\Inkscape"
853 !insertmacro delprefs
854 ${EndIf}
856 ; Remove file associations for svg editor
857 StrCpy $3 "svg"
858 ${For} $2 0 1
859 ${IfThen} $2 = 1 ${|} StrCpy $3 $3z ${|}
860 DetailPrint "removing file associations for $3 editor"
861 ClearErrors
862 ReadRegStr $0 HKCR ".$3" ""
863 DetailPrint ".$3 associated as $0"
864 ${IfNot} ${Errors}
865 ReadRegStr $1 HKCR "$0\shell\edit\command" ""
866 ${IfNotThen} ${Errors} ${|} DetailPrint "$3 editor is $1" ${|}
867 ${If} $1 == '"$INSTDIR\Inkscape.exe" "%1"'
868 DetailPrint "removing default .$3 editor"
869 DeleteRegKey HKCR "$0\shell\edit\command"
870 ${EndIf}
872 ClearErrors
873 ReadRegStr $1 HKCR "$0\shell\open\command" ""
874 ${IfNotThen} ${Errors} ${|} DetailPrint "$3 viewer is $1" ${|}
875 ${If} $1 == '"$INSTDIR\Inkscape.exe" "%1"'
876 DetailPrint "removing default .$3 viewer"
877 DeleteRegKey HKCR "$0\shell\open\command"
878 ${EndIf}
880 DetailPrint "removing default .$3 context menu"
881 DeleteRegKey HKCR "$0\shell\${PRODUCT_NAME}"
882 DeleteRegKey /ifempty HKCR "$0\shell\edit"
883 DeleteRegKey /ifempty HKCR "$0\shell\open"
884 DeleteRegKey /ifempty HKCR "$0\shell"
885 DeleteRegKey /ifempty HKCR "$0"
887 ClearErrors
888 ReadRegStr $1 HKCR $0 ""
889 ${If} ${Errors} ; Formerly ${If} $1 == ""
890 DetailPrint "removing filetype .$3 $0"
891 DeleteRegKey HKCR ".$3"
892 ${EndIf}
893 ${EndIf}
894 ${Next}
896 SetShellVarContext all
897 DetailPrint "removing product regkey"
898 DeleteRegKey SHCTX "${PRODUCT_DIR_REGKEY}"
899 DetailPrint "removing uninstall info"
900 DeleteRegKey SHCTX "${PRODUCT_UNINST_KEY}"
901 DetailPrint "removing shortcuts"
902 Delete "$DESKTOP\Inkscape.lnk"
903 Delete "$QUICKLAUNCH\Inkscape.lnk"
904 Delete "$SMPROGRAMS\Inkscape.lnk"
905 ;just in case they are still there
906 Delete "$SMPROGRAMS\Inkscape\Uninstall Inkscape.lnk"
907 Delete "$SMPROGRAMS\Inkscape\Inkscape.lnk"
908 RMDir "$SMPROGRAMS\Inkscape"
910 SetShellVarContext current
911 DetailPrint "removing product regkey"
912 DeleteRegKey SHCTX "${PRODUCT_DIR_REGKEY}"
913 DetailPrint "removing uninstall info"
914 DeleteRegKey SHCTX "${PRODUCT_UNINST_KEY}"
915 DetailPrint "removing shortcuts"
916 Delete "$DESKTOP\Inkscape.lnk"
917 Delete "$QUICKLAUNCH\Inkscape.lnk"
918 Delete "$SMPROGRAMS\Inkscape.lnk"
919 ;just in case they are still there
920 Delete "$SMPROGRAMS\Inkscape\Uninstall Inkscape.lnk"
921 Delete "$SMPROGRAMS\Inkscape\Inkscape.lnk"
922 RMDir "$SMPROGRAMS\Inkscape"
924 DetailPrint "removing uninstall info"
926 InitPluginsDir
927 SetPluginUnload manual
929 ClearErrors
930 FileOpen $0 $INSTDIR\uninstall.log r
931 ${If} ${Errors} ;else uninstallnotfound
932 MessageBox MB_OK|MB_ICONEXCLAMATION "$(lng_UninstallLogNotFound)" /SD IDOK
933 ${Else}
934 ${Do}
935 ClearErrors
936 FileRead $0 $1
937 ${IfThen} ${Errors} ${|} ${ExitDo} ${|}
938 ; cat the line into md5 and filename
939 StrLen $2 $1
940 ${IfThen} $2 <= 35 ${|} ${Continue} ${|}
941 StrCpy $3 $1 32
942 StrCpy $filename $1 $2-36 34 #remove trailing CR/LF
943 StrCpy $filename $filename -2
944 ; $3 = MD5 when installed, then deletion choice
945 ; $filename = file
946 ; $5 = MD5 now
947 ; $6 = "always"/"never" remove files touched by user
949 ${If} ${FileExists} $filename
950 ${If} $6 == "always"
951 StrCpy $3 2
952 ${Else}
953 md5dll::GetMD5File /NOUNLOAD $filename
954 Pop $5 ;md5 of file
955 ${If} $3 != $5
956 ${AndIf} $6 != "never"
957 ; the md5 sums does not match so we ask
958 messagebox::show MB_DEFBUTTON3|MB_TOPMOST "" "0,103" \
959 "$(lng_FileChanged)" "$(lng_Yes)" "$(lng_AlwaysYes)" "$(lng_No)" "$(lng_AlwaysNo)"
960 Pop $3
961 ${IfThen} $3 = 2 ${|} StrCpy $6 "always" ${|}
962 ${IfThen} $3 = 4 ${|} StrCpy $6 "never" ${|}
963 ${EndIf}
964 ${EndIf}
966 ${If} $3 = 1 ; yes
967 ${OrIf} $3 = 2 ; always
968 ; Remove File
969 ClearErrors
970 Delete $filename
971 ;now recursivly remove the path
972 ${Do}
973 ClearErrors
974 ${un.GetParent} $filename $filename
975 ${IfThen} ${Errors} ${|} ${ExitDo} ${|}
976 RMDir $filename
977 ${IfThen} ${Errors} ${|} ${ExitDo} ${|}
978 ${Loop}
979 ${EndIf}
980 ${EndIf} ; complaining there's no opening if
981 ${Loop}
982 ${EndIf}
983 FileClose $0
984 Delete "$INSTDIR\uninstall.log"
985 Delete "$INSTDIR\uninstall.exe"
986 ; remove empty directories
987 RMDir "$INSTDIR\data"
988 RMDir "$INSTDIR\doc"
989 RMDir "$INSTDIR\modules"
990 RMDir "$INSTDIR\plugins"
991 RMDir $INSTDIR
992 SetAutoClose false
993 !endif
994 SectionEnd