131N/A; #######################################
131N/A; Inkscape NSIS installer project file
131N/A; #######################################
131N/A; #######################################
131N/A; #######################################
131N/A!define PRODUCT_NAME "Inkscape"
131N/A!define PRODUCT_VERSION "0.47"
131N/A!define PRODUCT_REVISION 3
131N/A!define PRODUCT_VERSION_4 "0.47.0.3"
131N/A!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\
inkscape.exe"
131N/A!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
131N/A;!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.
131N/A; #######################################
131N/A; #######################################
131N/A; MUI 1.67 compatible ------
131N/ASetCompressor /SOLID lzma
131N/ASetCompressorDictSize 32
131N/A!define MUI_ABORTWARNING
844N/A!define MUI_COMPONENTSPAGE_SMALLDESC
131N/A;..................................................................................................
1258N/A;Following two definitions required. Uninstall log will use these definitions.
131N/A;You may use these definitions also, when you want to set up the InstallDirRagKey,
2899N/A;store the language selection, store Start Menu folder etc.
2899N/A;Enter the windows uninstall reg sub key to add uninstall information to
Add/Remove Programs also.
131N/A!define INSTDIR_REG_ROOT HKLM
131N/A!define INSTDIR_REG_KEY ${PRODUCT_UNINST_KEY}
628N/A;include the Uninstall log header
131N/A!insertmacro INTERACTIVE_UNINSTALL
131N/A;For md5dll and messagebox
131N/A!insertmacro GetParameters
1938N/A!insertmacro MUI_PAGE_WELCOME
3477N/A; !define MUI_LICENSEPAGE_RADIOBUTTONS
181N/A!define MUI_LICENSEPAGE_BUTTON $(lng_LICENSE_BUTTON)
131N/A!define MUI_LICENSEPAGE_TEXT_BOTTOM $(lng_LICENSE_BOTTOM_TEXT)
181N/A!insertmacro MUI_PAGE_LICENSE "..\..\Copying"
131N/A!insertmacro MUI_PAGE_COMPONENTS
131N/A; InstType $(lng_Optimal)
131N/A; InstType $(lng_Minimal)
131N/A!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
; #######################################
; #######################################
; Thanks to Adib Taraben and Luca Bruno for getting this started
; Add your translation here! :-)
; I had wanted to list the languages alphabetically, but apparently
; the first is the default. So putting English first is just being
; practical. It is not chauvinism or hubris, I swear! ;-)
!insertmacro MUI_RESERVEFILE_LANGDLL
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
; #######################################
; #######################################
BrandingText "$(lng_Caption)"
OutFile "Inkscape-${PRODUCT_VERSION}.exe"
OutFile "Inkscape-${PRODUCT_VERSION}-${PRODUCT_REVISION}.exe"
InstallDir "$PROGRAMFILES\Inkscape"
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
VIProductVersion "${PRODUCT_VERSION_4}"
VIAddVersionKey ProductName "${PRODUCT_NAME}"
VIAddVersionKey Comments "Licensed under the GNU GPL"
VIAddVersionKey LegalCopyright "� 2009 Inkscape"
VIAddVersionKey FileDescription "${PRODUCT_NAME}"
VIAddVersionKey FileVersion "${PRODUCT_VERSION_4}"
VIAddVersionKey ProductVersion "${PRODUCT_VERSION_4}"
VIAddVersionKey InternalName "${PRODUCT_NAME}"
; #######################################
; I N S T A L L E R S E C T I O N S
; #######################################
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;
; code originally taken from the vlc project
;;;;;;;;;;;;;;;;;;;;;;;;;;
DetailPrint "Deleting personal preferences..."
DetailPrint "Finding all users..."
; this will loop through all the logged users and "virtual" windows users
; (it looks like users are only present in HKEY_USERS when they are logged in)
${IfThen} $1 == "" ${|} ${ExitDo} ${|}
ReadRegStr $2 HKU "$1\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" AppData
${IfThen} $2 == "" ${|} ${Continue} ${|}
DetailPrint "Removing $2\Inkscape"
;--------------------------------
;remove the old Inkscape shortcuts from the startmenu
;just in case they are still there
SetShellVarContext current
RMDir "$SMPROGRAMS\Inkscape"
RMDir "$SMPROGRAMS\Inkscape"
Section $(lng_Core) SecCore
DetailPrint "Installing Inkscape core files..."
File /a "..\..\inkscape\ink*.exe"
File /a "..\..\inkscape\AUTHORS"
File /a "..\..\inkscape\COPYING"
File /a "..\..\inkscape\NEWS"
File /a "..\..\inkscape\README"
File /a "..\..\inkscape\TRANSLATORS"
File /nonfatal /a /r "..\..\inkscape\data"
File /nonfatal /a /r "..\..\inkscape\doc"
File /nonfatal /a /r "..\..\inkscape\plugins"
File /nonfatal /a /r /x *.??*.???* /x "examples" /x "tutorials" "..\..\inkscape\share"
; this files are added because it slips through the filter
SetOutPath $INSTDIR\share\clipart
SetOutPath $INSTDIR\share\icons
SetOutPath $INSTDIR\modules
File /nonfatal /a /r "..\..\inkscape\modules\*.*"
SetOutPath $INSTDIR\python
File /nonfatal /a /r "..\..\inkscape\python\*.*"
Section $(lng_GTKFiles) SecGTK
DetailPrint "Installing GTK files..."
File /a /r "..\..\inkscape\*.dll"
File /a /r /x "locale" "..\..\inkscape\lib"
File /a /r "..\..\inkscape\etc"
Section -SetCurrentUserOnly
SetShellVarContext current
Section $(lng_Alluser) SecAlluser
DetailPrint "Installing in administrator mode (registry root will be HKLM)"
SectionGroup $(lng_Shortcuts) SecShortcuts
Section $(lng_Desktop) SecDesktop
Section $(lng_Quicklaunch) SecQuicklaunch
Section $(lng_SVGWriter) SecSVGWriter
DetailPrint "Associating SVG files with Inkscape"
ReadRegStr $0 HKCR ".svg" ""
WriteRegStr HKCR ".svg" "" $0
WriteRegStr HKCR "svgfile" "" "Scalable Vector Graphics file"
WriteRegStr HKCR "$0\shell\edit\command" "" `"$INSTDIR\
Inkscape.exe" "%1"`
ReadRegStr $0 HKCR ".svgz" ""
WriteRegStr HKCR ".svgz" "" $0
WriteRegStr HKCR "svgfile" "" "Scalable Vector Graphics file"
WriteRegStr HKCR "$0\shell\edit\command" "" `"$INSTDIR\
Inkscape.exe" "%1"`
Section $(lng_ContextMenu) SecContextMenu
DetailPrint "Adding Inkscape to SVG file context menu"
ReadRegStr $0 HKCR ".svg" ""
WriteRegStr HKCR ".svg" "" $0
WriteRegStr HKCR "svgfile" "" "Scalable Vector Graphics file"
WriteRegStr HKCR "$0\shell\${PRODUCT_NAME}\command" "" `"$INSTDIR\
Inkscape.exe" "%1"`
ReadRegStr $0 HKCR ".svgz" ""
WriteRegStr HKCR ".svgz" "" $0
WriteRegStr HKCR "svgfile" "" "Scalable Vector Graphics file"
WriteRegStr HKCR "$0\shell\${PRODUCT_NAME}\command" "" `"$INSTDIR\
Inkscape.exe" "%1"`
Section /o $(lng_DeletePrefs) SecPrefs
SectionGroup $(lng_Addfiles) SecAddfiles
Section $(lng_Examples) SecExamples
SetOutPath $INSTDIR\share
File /nonfatal /a /r /x "*.??*.???*" "..\..\inkscape\share\examples"
Section $(lng_Tutorials) SecTutorials
SetOutPath $INSTDIR\share
File /nonfatal /a /r /x "*.??*.???*" "..\..\inkscape\share\tutorials"
SectionGroup $(lng_Languages) SecLanguages
!macro Language SecName lng
Section /o $(lng_${lng}) Sec${SecName}
File /nonfatal /a "..\..\inkscape\*.${lng}.txt" ; FIXME: remove this? No such files.
SetOutPath $INSTDIR\locale
File /nonfatal /a /r "..\..\inkscape\locale\${lng}"
SetOutPath $INSTDIR\lib\locale
File /nonfatal /a /r "..\..\inkscape\lib\locale\${lng}"
SetOutPath $INSTDIR\share\clipart
File /nonfatal /a /r "..\..\inkscape\share\clipart\*.${lng}.svg"
SetOutPath $INSTDIR\share\screens
File /nonfatal /a /r "..\..\inkscape\share\screens\*.${lng}.svg"
SetOutPath $INSTDIR\share\templates
File /nonfatal /a /r "..\..\inkscape\share\templates\*.${lng}.svg"
File /nonfatal /a /r "..\..\inkscape\doc\keys.${lng}.xml"
File /nonfatal /a /r "..\..\inkscape\doc\keys.${lng}.html"
SectionGetFlags ${SecTutorials} $R1
IntOp $R1 $R1 & ${SF_SELECTED}
${If} $R1 >= ${SF_SELECTED}
SetOutPath $INSTDIR\share\tutorials
File /nonfatal /a "..\..\inkscape\share\tutorials\*.${lng}.*"
!insertmacro Language Amharic am
!insertmacro Language Arabic ar
!insertmacro Language Azerbaijani az
!insertmacro Language Byelorussian be
!insertmacro Language Bulgarian bg
!insertmacro Language Bengali bn
!insertmacro Language Breton br
!insertmacro Language Catalan ca
!insertmacro Language CatalanValencia ca@valencia
!insertmacro Language Czech cs
!insertmacro Language Danish da
!insertmacro Language German de
!insertmacro Language Dzongkha dz
!insertmacro Language Greek el
!insertmacro Language EnglishAustralian en_AU
!insertmacro Language EnglishCanadian en_CA
!insertmacro Language EnglishBritain en_GB
!insertmacro Language EnglishPiglatin en_US@piglatin
!insertmacro Language Esperanto eo
!insertmacro Language Spanish es
!insertmacro Language SpanishMexico es_MX
!insertmacro Language Estonian et
!insertmacro Language Basque eu
!insertmacro Language French fr
!insertmacro Language Finnish fi
!insertmacro Language Irish ga
!insertmacro Language Gallegan gl
!insertmacro Language Hebrew he
!insertmacro Language Croatian hr
!insertmacro Language Hungarian hu
!insertmacro Language Indonesian id
!insertmacro Language Italian it
!insertmacro Language Japanese ja
!insertmacro Language Khmer km
!insertmacro Language Korean ko
!insertmacro Language Lithuanian lt
!insertmacro Language Mongolian mn
!insertmacro Language Macedonian mk
!insertmacro Language NorwegianBokmal nb
!insertmacro Language Nepali ne
!insertmacro Language Dutch nl
!insertmacro Language NorwegianNynorsk nn
!insertmacro Language Panjabi pa
!insertmacro Language Polish pl
!insertmacro Language Portuguese pt
!insertmacro Language PortugueseBrazil pt_BR
!insertmacro Language Romanian ro
!insertmacro Language Russian ru
!insertmacro Language Kinyarwanda rw
!insertmacro Language Slovak sk
!insertmacro Language Slovenian sl
!insertmacro Language Albanian sq
!insertmacro Language Serbian sr
!insertmacro Language SerbianLatin sr@latin
!insertmacro Language Swedish sv
!insertmacro Language Thai th
!insertmacro Language Turkish tr
!insertmacro Language Ukrainian uk
!insertmacro Language Vietnamese vi
!insertmacro Language ChineseSimplified zh_CN
!insertmacro Language ChineseTaiwan zh_TW
Section -FinalizeInstallation
DetailPrint "Finalizing installation"
${IfThen} $MultiUser = 1 ${|} SetShellVarContext all ${|}
${IfThen} $MultiUser != 1 ${|} SetShellVarContext current ${|}
WriteRegStr SHCTX "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\
inkscape.exe"
WriteRegStr SHCTX "${PRODUCT_DIR_REGKEY}" "MultiUser" $MultiUser
WriteRegStr SHCTX "${PRODUCT_DIR_REGKEY}" "askMultiUser" $askMultiUser
WriteRegStr SHCTX "${PRODUCT_DIR_REGKEY}" "User" $User
WriteRegExpandStr SHCTX "${PRODUCT_UNINST_KEY}" "UninstallString" "${UNINST_EXE}"
WriteRegExpandStr SHCTX "${PRODUCT_UNINST_KEY}" "InstallDir" $INSTDIR
WriteRegExpandStr SHCTX "${PRODUCT_UNINST_KEY}" "InstallLocation" $INSTDIR
WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "DisplayName" "${PRODUCT_NAME} ${PRODUCT_VERSION}"
WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\
Inkscape.exe,0"
WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
WriteRegDWORD SHCTX "${PRODUCT_UNINST_KEY}" "NoModify" 1
WriteRegDWORD SHCTX "${PRODUCT_UNINST_KEY}" "NoRepair" 1
DetailPrint "Creating MD5 checksums"
${IfThen} ${Errors} ${|} ${ExitDo} ${|}
md5dll::GetMD5File /NOUNLOAD $1
${IfThen} $2 != "" ${|} FileWrite $9 "$2 $1$\r$\n" ${|}
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SecCore} $(lng_CoreDesc)
!insertmacro MUI_DESCRIPTION_TEXT ${SecGTK} $(lng_GTKFilesDesc)
!insertmacro MUI_DESCRIPTION_TEXT ${SecShortcuts} $(lng_ShortcutsDesc)
!insertmacro MUI_DESCRIPTION_TEXT ${SecAlluser} $(lng_AlluserDesc)
!insertmacro MUI_DESCRIPTION_TEXT ${SecDesktop} $(lng_DesktopDesc)
!insertmacro MUI_DESCRIPTION_TEXT ${SecQuicklaunch} $(lng_QuicklaunchDesc)
!insertmacro MUI_DESCRIPTION_TEXT ${SecSVGWriter} $(lng_SVGWriterDesc)
!insertmacro MUI_DESCRIPTION_TEXT ${SecContextMenu} $(lng_ContextMenuDesc)
!insertmacro MUI_DESCRIPTION_TEXT ${SecPrefs} $(lng_DeletePrefsDesc)
!insertmacro MUI_DESCRIPTION_TEXT ${SecAddfiles} $(lng_AddfilesDesc)
!insertmacro MUI_DESCRIPTION_TEXT ${SecExamples} $(lng_ExamplesDesc)
!insertmacro MUI_DESCRIPTION_TEXT ${SecTutorials} $(lng_TutorialsDesc)
!insertmacro MUI_DESCRIPTION_TEXT ${SecLanguages} $(lng_LanguagesDesc)
!insertmacro MUI_FUNCTION_DESCRIPTION_END
!macro Parameter key Section
${GetOptions} $CMDARGS "/${key}=" $1
SectionGetFlags ${Section} $0
IntOp $2 ${SF_SELECTED} ~
SectionSetFlags ${Section} $0
SectionGetFlags ${Section} $0
IntOp $0 $0 | ${SF_SELECTED}
SectionSetFlags ${Section} $0
!insertmacro MUI_LANGDLL_DISPLAY
!macro LanguageAutoSelect SecName LocaleID
${If} $LANGUAGE = ${LocaleID}
SectionGetFlags ${Sec${SecName}} $0
IntOp $0 $0 | ${SF_SELECTED}
SectionSetFlags ${Sec${SecName}} $0
;!insertmacro LanguageAutoSelect English 1033
!insertmacro LanguageAutoSelect Breton 1150
!insertmacro LanguageAutoSelect Catalan 1027
!insertmacro LanguageAutoSelect Czech 1029
!insertmacro LanguageAutoSelect Finnish 1035
!insertmacro LanguageAutoSelect French 1036
!insertmacro LanguageAutoSelect Gallegan 1110 ; Galician, but section is called Gallegan
!insertmacro LanguageAutoSelect German 1031
!insertmacro LanguageAutoSelect Italian 1040
!insertmacro LanguageAutoSelect Japanese 1041
!insertmacro LanguageAutoSelect Polish 1045
!insertmacro LanguageAutoSelect Russian 1049
!insertmacro LanguageAutoSelect Slovak 1051
!insertmacro LanguageAutoSelect Slovenian 1060
!insertmacro LanguageAutoSelect Spanish 1034
!insertmacro LanguageAutoSelect ChineseTaiwan 1028 ; TradChinese, but section is called ChineseTaiwan
${GetParameters} $CMDARGS
;prepare log always within .onInit function
;Extract InstallOptions INI files
; this resets AskMultiUser if Win95/98/ME
ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion" VersionNumber
${IfThen} $R0 = 4 ${|} StrCpy $AskMultiUser 0 ${|}
; hide all user section if ME/9x
${IfThen} $AskMultiUser != 1 ${|} SectionSetText ${SecAlluser} "" ${|}
; hide if quick launch if not available
${IfThen} $QUICKLAUNCH == $TEMP ${|} SectionSetText ${SecQuicklaunch} "" ${|}
; This one means you don't need to care about admin or
; not admin because Windows 9x doesn't either
${IfCmd} MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "$(lng_NOT_SUPPORTED)$(lng_OK_CANCEL_DESC)" /SD IDOK IDCANCEL ${||} Quit ${|}
${AndIf} ${Cmd} ${|} MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "$(lng_NO_ADMIN)$(lng_OK_CANCEL_DESC)" /SD IDOK IDCANCEL ${|}
;check for previous installation
ReadRegStr $0 HKLM "${PRODUCT_DIR_REGKEY}" "User"
${IfThen} $0 == "" ${|} ReadRegStr $0 HKCU "${PRODUCT_DIR_REGKEY}" "User" ${|}
;check user if applicable
${AndIf} ${Cmd} ${|} MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "$(lng_DIFFERENT_USER)$(lng_OK_CANCEL_DESC)" /SD IDOK IDCANCEL ${|}
; code taken from the vlc project
ReadRegStr $R0 HKLM ${PRODUCT_UNINST_KEY} "UninstallString"
ReadRegStr $R1 HKLM ${PRODUCT_UNINST_KEY} "DisplayName"
ReadRegStr $R0 HKCU ${PRODUCT_UNINST_KEY} "UninstallString"
ReadRegStr $R1 HKCU ${PRODUCT_UNINST_KEY} "DisplayName"
${AndIf} ${Cmd} ${|} MessageBox MB_YESNO|MB_ICONEXCLAMATION $(lng_WANT_UNINSTALL_BEFORE) /SD IDNO IDYES ${|}
ExecWait $R0 ;Was '$R0 _?=$INSTDIR' but we do NOT want it leaving the uninstaller behind.
; proccess command line parameter
!insertmacro Parameter "GTK" ${SecGTK}
!insertmacro Parameter "SHORTCUTS" ${secShortcuts}
!insertmacro Parameter "ALLUSER" ${SecAlluser}
!insertmacro Parameter "DESKTOP" ${SecDesktop}
!insertmacro Parameter "QUICKLAUNCH" ${SecQUICKlaunch}
!insertmacro Parameter "SVGEDITOR" ${SecSVGWriter}
!insertmacro Parameter "CONTEXTMENUE" ${SecContextMenu}
!insertmacro Parameter "PREFERENCES" ${SecPrefs}
!insertmacro Parameter "ADDFILES" ${SecAddfiles}
!insertmacro Parameter "EXAMPLES" ${SecExamples}
!insertmacro Parameter "TUTORIALS" ${SecTutorials}
!insertmacro Parameter "LANGUAGES" ${SecLanguages}
!insertmacro Parameter "am" ${SecAmharic}
!insertmacro Parameter "ar" ${SecArabic}
!insertmacro Parameter "az" ${SecAzerbaijani}
!insertmacro Parameter "be" ${SecByelorussian}
!insertmacro Parameter "bg" ${SecBulgarian}
!insertmacro Parameter "bn" ${SecBengali}
!insertmacro Parameter "br" ${SecBreton}
!insertmacro Parameter "ca" ${SecCatalan}
!insertmacro Parameter "ca@valencia" ${SecCatalanValencia}
!insertmacro Parameter "cs" ${SecCzech}
!insertmacro Parameter "da" ${SecDanish}
!insertmacro Parameter "de" ${SecGerman}
!insertmacro Parameter "dz" ${SecDzongkha}
!insertmacro Parameter "el" ${SecGreek}
!insertmacro Parameter "en_AU" ${SecEnglishAustralian}
!insertmacro Parameter "en_CA" ${SecEnglishCanadian}
!insertmacro Parameter "en_GB" ${SecEnglishBritain}
!insertmacro Parameter "en_US@piglatin" ${SecEnglishPiglatin}
!insertmacro Parameter "eo" ${SecEsperanto}
!insertmacro Parameter "es" ${SecSpanish}
!insertmacro Parameter "es_MX" ${SecSpanishMexico}
!insertmacro Parameter "et" ${SecEstonian}
!insertmacro Parameter "eu" ${SecBasque}
!insertmacro Parameter "fi" ${SecFinnish}
!insertmacro Parameter "fr" ${SecFrench}
!insertmacro Parameter "ga" ${SecIrish}
!insertmacro Parameter "gl" ${SecGallegan}
!insertmacro Parameter "he" ${SecHebrew}
!insertmacro Parameter "hr" ${SecCroatian}
!insertmacro Parameter "hu" ${SecHungarian}
!insertmacro Parameter "id" ${SecIndonesian}
!insertmacro Parameter "it" ${SecItalian}
!insertmacro Parameter "ja" ${SecJapanese}
!insertmacro Parameter "km" ${SecKhmer}
!insertmacro Parameter "ko" ${SecKorean}
!insertmacro Parameter "lt" ${SecLithuanian}
!insertmacro Parameter "mk" ${SecMacedonian}
!insertmacro Parameter "mn" ${SecMongolian}
!insertmacro Parameter "nb" ${SecNorwegianBokmal}
!insertmacro Parameter "ne" ${SecNepali}
!insertmacro Parameter "nl" ${SecDutch}
!insertmacro Parameter "nn" ${SecNorwegianNynorsk}
!insertmacro Parameter "pa" ${SecPanjabi}
!insertmacro Parameter "pl" ${SecPolish}
!insertmacro Parameter "pt" ${SecPortuguese}
!insertmacro Parameter "pt_BR" ${SecPortugueseBrazil}
!insertmacro Parameter "ro" ${SecRomanian}
!insertmacro Parameter "ru" ${SecRussian}
!insertmacro Parameter "rw" ${SecKinyarwanda}
!insertmacro Parameter "sk" ${SecSlovak}
!insertmacro Parameter "sl" ${SecSlovenian}
!insertmacro Parameter "sq" ${SecAlbanian}
!insertmacro Parameter "sr" ${SecSerbian}
!insertmacro Parameter "sr@latin" ${SecSerbianLatin}
!insertmacro Parameter "sv" ${SecSwedish}
!insertmacro Parameter "th" ${SecThai}
!insertmacro Parameter "tr" ${SecTurkish}
!insertmacro Parameter "uk" ${SecUkrainian}
!insertmacro Parameter "vi" ${SecVietnamese}
!insertmacro Parameter "zh_CN" ${SecChineseSimplified}
!insertmacro Parameter "zh_TW" ${SecChineseTaiwan}
${GetOptions} $CMDARGS "/?" $1
MessageBox MB_OK "Possible parameters for installer:$\r$\n \
/?: this help screen$\r$\n \
/D=(directory): where to install Inkscape$\r$\n \
/GTK=(
OFF/ON): GTK+ Runtime environment$\r$\n \
/SHORTCUTS=(
OFF/ON): shortcuts to start Inkscape$\r$\n \
/ALLUSER=(
OFF/ON): for all users on the computer$\r$\n \
/DESKTOP=(
OFF/ON): Desktop icon$\r$\n \
/QUICKLAUNCH=(
OFF/ON): quick launch icon$\r$\n \
/SVGEDITOR=(
OFF/ON): default SVG editor$\r$\n \
/CONTEXTMENUE=(
OFF/ON): context menue integration$\r$\n \
/PREFERENCES=(
OFF/ON): delete users preference files$\r$\n \
/ADDFILES=(
OFF/ON): additional files$\r$\n \
/EXAMPLES=(
OFF/ON): examples$\r$\n \
/TUTORIALS=(
OFF/ON): tutorials$\r$\n \
/LANGUAGES=(
OFF/ON): translated menues, examples, etc.$\r$\n \
/[locale code]=(
OFF/ON):
e.g am, es, es_MX as in Inkscape supported"
; --------------------------------------------------
!insertmacro MUI_HEADER_TEXT "$(lng_UInstOpt)" "$(lng_UInstOpt1)"
;begin uninstall, could be added on top of uninstall section instead
MessageBox MB_OK|MB_ICONEXCLAMATION "$(lng_UninstallLogNotFound)" /SD IDOK
; Test if this was a multiuser installation
ReadRegStr $0 HKLM "${PRODUCT_DIR_REGKEY}" ""
ReadRegStr $MultiUser HKLM "${PRODUCT_DIR_REGKEY}" "MultiUser"
ReadRegStr $askMultiUser HKLM "${PRODUCT_DIR_REGKEY}" "askMultiUser"
ReadRegStr $0 HKLM "${PRODUCT_DIR_REGKEY}" "User"
ReadRegStr $MultiUser HKCU "${PRODUCT_DIR_REGKEY}" "MultiUser"
ReadRegStr $askMultiUser HKCU "${PRODUCT_DIR_REGKEY}" "askMultiUser"
ReadRegStr $0 HKCU "${PRODUCT_DIR_REGKEY}" "User"
;check user if applicable
${AndIf} ${Cmd} ${|} MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "$(lng_DIFFERENT_USER)$(lng_OK_CANCEL_DESC)" /SD IDOK IDCANCEL ${|}
${IfThen} $MultiUser = 0 ${|} SetShellVarContext current ${|}
; remove personal settings
DetailPrint "Purging personal settings in $APPDATA\Inkscape"
;RMDir /r "$APPDATA\Inkscape"
; Remove file associations for svg editor
${IfThen} $2 = 1 ${|} StrCpy $3 $3z ${|}
DetailPrint "Removing file associations for $3 editor"
ReadRegStr $0 HKCR ".$3" ""
ReadRegStr $1 HKCR "$0\shell\edit\command" ""
DeleteRegKey HKCR "$0\shell\edit\command"
ReadRegStr $1 HKCR "$0\shell\open\command" ""
DeleteRegKey HKCR "$0\shell\open\command"
DeleteRegKey HKCR "$0\shell\${PRODUCT_NAME}"
DeleteRegKey /ifempty HKCR "$0\shell\edit"
DeleteRegKey /ifempty HKCR "$0\shell\open"
DeleteRegKey /ifempty HKCR "$0\shell"
DeleteRegKey /ifempty HKCR "$0"
DeleteRegKey /ifempty HKCR ".$3"
DeleteRegKey SHCTX "${PRODUCT_DIR_REGKEY}"
DeleteRegKey SHCTX "${PRODUCT_UNINST_KEY}"
;just in case they are still there
RMDir "$SMPROGRAMS\Inkscape"
SetShellVarContext current
DeleteRegKey SHCTX "${PRODUCT_DIR_REGKEY}"
DeleteRegKey SHCTX "${PRODUCT_UNINST_KEY}"
;just in case they are still there
RMDir "$SMPROGRAMS\Inkscape"
${If} ${Errors} ;else uninstallnotfound
MessageBox MB_OK|MB_ICONEXCLAMATION "$(lng_UninstallLogNotFound)" /SD IDOK
${IfThen} ${Errors} ${|} ${ExitDo} ${|}
; cat the line into md5 and filename
${IfThen} $2 <= 35 ${|} ${Continue} ${|}
StrCpy $filename $1 $2-36 34 ;remove trailing
CR/LF StrCpy $filename $filename -2
; $3 = MD5 when installed, then deletion choice
; $6 = "always"/"never" remove files touched by user
${If} ${FileExists} $filename
md5dll::GetMD5File /NOUNLOAD $filename
; the md5 sums does not match so we ask
messagebox::show MB_DEFBUTTON3|MB_TOPMOST "" "0,103" \
"$(lng_FileChanged)" "$(lng_Yes)" "$(lng_AlwaysYes)" "$(lng_No)" "$(lng_AlwaysNo)"
${IfThen} $3 = 2 ${|} StrCpy $6 "always" ${|}
${IfThen} $3 = 4 ${|} StrCpy $6 "never" ${|}
;now recursivly remove the path
${IfThen} ${Errors} ${|} ${ExitDo} ${|}
${IfThen} ${Errors} ${|} ${ExitDo} ${|}
; remove empty directories