X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=packaging%2Fwin32%2Finkscape.nsi;h=ebd80cbd51f087dd646062d283ccf6ea7f3733a7;hb=aec7a0781472450c98c74c107a9a36528dbb9872;hp=11368bc94d5dd70000756eb295cc8b868f003964;hpb=91e3e6e230eddb96b3fe5d2b9a5c547d03dd9649;p=inkscape.git diff --git a/packaging/win32/inkscape.nsi b/packaging/win32/inkscape.nsi index 11368bc94..ebd80cbd5 100644 --- a/packaging/win32/inkscape.nsi +++ b/packaging/win32/inkscape.nsi @@ -7,7 +7,7 @@ ; DEFINES ; ####################################### !define PRODUCT_NAME "Inkscape" -!define PRODUCT_VERSION "0.43+0.44pre4" +!define PRODUCT_VERSION "0.45+devel" !define PRODUCT_PUBLISHER "Inkscape Organization" !define PRODUCT_WEB_SITE "http://www.inkscape.org" !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\inkscape.exe" @@ -29,6 +29,25 @@ SetCompressor /SOLID lzma !define MUI_HEADERIMAGE_BITMAP "header.bmp" !define MUI_COMPONENTSPAGE_SMALLDESC +;.................................................................................................. +;Following two definitions required. Uninstall log will use these definitions. +;You may use these definitions also, when you want to set up the InstallDirRagKey, +;store the language selection, store Start Menu folder etc. +;Enter the windows uninstall reg sub key to add uninstall information to Add/Remove Programs also. + +!define INSTDIR_REG_ROOT "HKLM" +!define INSTDIR_REG_KEY PRODUCT_UNINST_KEY + +;include the Uninstall log header +!include AdvUninstLog.nsh + +;Specify the preferred uninstaller operation mode, either unattended or interactive. +;You have to type either !insertmacro UNATTENDED_UNINSTALL, or !insertmacro INTERACTIVE_UNINSTALL. +;Be aware only one of the following two macros has to be inserted, neither both, neither none. + +;!insertmacro UNATTENDED_UNINSTALL +!insertmacro INTERACTIVE_UNINSTALL + ; Welcome page !insertmacro MUI_PAGE_WELCOME @@ -69,12 +88,17 @@ ShowUninstDetails hide ; Language files !include "english.nsh" -!include "catalan.nsh" +; !include "catalan.nsh" the catalan support has been abandoned by NSIS as of version 2.28 !include "czech.nsh" +!include "finnish.nsh" !include "french.nsh" !include "german.nsh" !include "italian.nsh" -;!include "polish.nsh" +!include "japanese.nsh" +!include "polish.nsh" +!include "russian.nsh" +!include "slovak.nsh" +!include "slovenian.nsh" !include "spanish.nsh" ReserveFile "inkscape.nsi.uninstall" @@ -396,35 +420,75 @@ FunctionEnd !macro Language polng lng SectionIn 1 2 3 SetOutPath $INSTDIR + !insertmacro UNINSTALL.LOG_OPEN_INSTALL File /nonfatal /a "..\..\inkscape\*.${lng}.txt" + !insertmacro UNINSTALL.LOG_CLOSE_INSTALL SetOutPath $INSTDIR\locale + !insertmacro UNINSTALL.LOG_OPEN_INSTALL File /nonfatal /a /r "..\..\inkscape\locale\${polng}" + !insertmacro UNINSTALL.LOG_CLOSE_INSTALL SetOutPath $INSTDIR\lib\locale + !insertmacro UNINSTALL.LOG_OPEN_INSTALL File /nonfatal /a /r "..\..\inkscape\lib\locale\${polng}" + !insertmacro UNINSTALL.LOG_CLOSE_INSTALL + SetOutPath $INSTDIR\share\clipart + !insertmacro UNINSTALL.LOG_OPEN_INSTALL + File /nonfatal /a /r "..\..\inkscape\share\clipart\*.${polng}.svg" + !insertmacro UNINSTALL.LOG_CLOSE_INSTALL ; the keyboard tables SetOutPath $INSTDIR\share\screens - File /nonfatal /a /r "..\..\inkscape\share\screens\keys.${polng}.svg" + !insertmacro UNINSTALL.LOG_OPEN_INSTALL + File /nonfatal /a /r "..\..\inkscape\share\screens\*.${polng}.svg" + !insertmacro UNINSTALL.LOG_CLOSE_INSTALL SetOutPath $INSTDIR\share\templates - File /nonfatal /a /r "..\..\inkscape\share\templates\default.${polng}.svg" + !insertmacro UNINSTALL.LOG_OPEN_INSTALL + File /nonfatal /a /r "..\..\inkscape\share\templates\*.${polng}.svg" + !insertmacro UNINSTALL.LOG_CLOSE_INSTALL SetOutPath $INSTDIR\doc + !insertmacro UNINSTALL.LOG_OPEN_INSTALL File /nonfatal /a /r "..\..\inkscape\doc\keys.${polng}.xml" File /nonfatal /a /r "..\..\inkscape\doc\keys.${polng}.html" + !insertmacro UNINSTALL.LOG_CLOSE_INSTALL SectionGetFlags ${SecTutorials} $R1 IntOp $R1 $R1 & ${SF_SELECTED} IntCmp $R1 ${SF_SELECTED} 0 skip_tutorials SetOutPath $INSTDIR\share\tutorials + !insertmacro UNINSTALL.LOG_OPEN_INSTALL File /nonfatal /a "..\..\inkscape\share\tutorials\*.${polng}.*" + !insertmacro UNINSTALL.LOG_CLOSE_INSTALL skip_tutorials: !macroend ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - +;;;;;;;;;;;;;;;;;;;;;;;;;; +; Delete prefs +; code taken from the vlc project +;;;;;;;;;;;;;;;;;;;;;;;;;; +!macro delprefs + StrCpy $0 0 + DetailPrint "Delete personal preferences ..." + DetailPrint "try to find all users ..." + delprefs-Loop: + ; FIXME + ; 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) + ClearErrors + EnumRegKey $1 HKU "" $0 + StrCmp $1 "" delprefs-End + IntOp $0 $0 + 1 + ReadRegStr $2 HKU "$1\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" AppData + StrCmp $2 "" delprefs-Loop + DetailPrint "$2\Inkscape will be removed" + RMDir /r "$2\Inkscape" + Goto delprefs-Loop + delprefs-End: +!macroend ;-------------------------------- ; Installer Sections - +; @todo better idea is to call the original uninstaller first Section -removeInkscape ; check for an old installation and clean that dlls and stuff ClearErrors @@ -470,6 +534,20 @@ Section -removeInkscape FindNext $0 $1 Goto FindNextLoop FindNextDone: + + ;remove the old inkscape shortcuts from the startmenu + ;just in case they are still there + SetShellVarContext current + Delete "$SMPROGRAMS\Inkscape\Uninstall Inkscape.lnk" + Delete "$SMPROGRAMS\Inkscape\Inkscape.lnk" + RMDir "$SMPROGRAMS\Inkscape" + Delete "$SMPROGRAMS\Inkscape.lnk" + SetShellVarContext all + Delete "$SMPROGRAMS\Inkscape\Uninstall Inkscape.lnk" + Delete "$SMPROGRAMS\Inkscape\Inkscape.lnk" + RMDir "$SMPROGRAMS\Inkscape" + Delete "$SMPROGRAMS\Inkscape.lnk" + SectionEnd Section $(lng_Core) SecCore @@ -478,6 +556,7 @@ Section $(lng_Core) SecCore SectionIn 1 2 3 RO SetOutPath $INSTDIR + !insertmacro UNINSTALL.LOG_OPEN_INSTALL SetOverwrite on SetAutoClose false @@ -486,27 +565,39 @@ Section $(lng_Core) SecCore File /a "..\..\inkscape\COPYING" File /a "..\..\inkscape\COPYING.LIB" File /a "..\..\inkscape\NEWS" - File /a "..\..\inkscape\HACKING.txt" + File /nonfatal /a "..\..\inkscape\HACKING.txt" File /a "..\..\inkscape\README" - File /a "..\..\inkscape\README.txt" + File /nonfatal /a "..\..\inkscape\README.txt" 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" + !insertmacro UNINSTALL.LOG_CLOSE_INSTALL ; this files are added because it slips through the filter SetOutPath $INSTDIR\share\clipart + !insertmacro UNINSTALL.LOG_OPEN_INSTALL File /a "..\..\inkscape\share\clipart\inkscape.logo.svg" ;File /a "..\..\inkscape\share\clipart\inkscape.logo.classic.svg" + !insertmacro UNINSTALL.LOG_CLOSE_INSTALL SetOutPath $INSTDIR\share\extensions + !insertmacro UNINSTALL.LOG_OPEN_INSTALL File /a "..\..\inkscape\share\extensions\pdf_output.inx.txt" File /a "..\..\inkscape\share\extensions\pdf_output_via_gs_on_win32.inx.txt" + !insertmacro UNINSTALL.LOG_CLOSE_INSTALL + SetOutPath $INSTDIR\share\icons + !insertmacro UNINSTALL.LOG_OPEN_INSTALL + File /a "..\..\inkscape\share\icons\inkscape.file.png" + File /a "..\..\inkscape\share\icons\inkscape.file.svg" + !insertmacro UNINSTALL.LOG_CLOSE_INSTALL SetOutPath $INSTDIR\modules + !insertmacro UNINSTALL.LOG_OPEN_INSTALL File /nonfatal /a /r "..\..\inkscape\modules\*.*" + !insertmacro UNINSTALL.LOG_CLOSE_INSTALL SetOutPath $INSTDIR\python - File /nonfatal /a /r "..\..\inkscape\python\*.*" - - + !insertmacro UNINSTALL.LOG_OPEN_INSTALL + File /nonfatal /a /r "..\..\inkscape\python\*.*" + !insertmacro UNINSTALL.LOG_CLOSE_INSTALL SectionEnd Section $(lng_GTKFiles) SecGTK @@ -515,30 +606,38 @@ Section $(lng_GTKFiles) SecGTK SectionIn 1 2 3 RO SetOutPath $INSTDIR + !insertmacro UNINSTALL.LOG_OPEN_INSTALL SetOverwrite on File /a /r "..\..\inkscape\*.dll" File /a /r /x "locale" "..\..\inkscape\lib" File /a /r "..\..\inkscape\etc" + !insertmacro UNINSTALL.LOG_CLOSE_INSTALL SectionEnd Section $(lng_Alluser) SecAlluser ; disable this option in Win95/Win98/WinME SectionIn 1 2 3 StrCpy $MultiUser "1" + StrCmp $MultiUser "1" "" SingleUser + DetailPrint "admin mode, registry root will be HKLM" + SetShellVarContext all + Goto endSingleUser + SingleUser: + DetailPrint "single user mode, registry root will be HKCU" + SetShellVarContext current + endSingleUser: SectionEnd SectionGroup $(lng_Shortcuts) SecShortcuts -Section $(lng_Desktop) SecDesktop - SectionIn 1 2 3 +Section /o $(lng_Desktop) SecDesktop ClearErrors CreateShortCut "$DESKTOP\Inkscape.lnk" "$INSTDIR\inkscape.exe" IfErrors 0 +2 DetailPrint "Uups! Problems creating desktop shortcuts" SectionEnd -Section $(lng_Quicklaunch) SecQuicklaunch - SectionIn 1 2 3 +Section /o $(lng_Quicklaunch) SecQuicklaunch ClearErrors StrCmp $QUICKLAUNCH $TEMP +2 CreateShortCut "$QUICKLAUNCH\Inkscape.lnk" "$INSTDIR\inkscape.exe" @@ -601,18 +700,26 @@ SectionEnd SectionGroupEnd +Section /o $(lng_DeletePrefs) SecPrefs + !insertmacro delprefs +SectionEnd + SectionGroup $(lng_Addfiles) SecAddfiles Section $(lng_Examples) SecExamples SectionIn 1 2 SetOutPath $INSTDIR\share + !insertmacro UNINSTALL.LOG_OPEN_INSTALL File /nonfatal /a /r /x "*.??*.???*" "..\..\inkscape\share\examples" + !insertmacro UNINSTALL.LOG_CLOSE_INSTALL SectionEnd Section $(lng_Tutorials) SecTutorials SectionIn 1 2 SetOutPath $INSTDIR\share + !insertmacro UNINSTALL.LOG_OPEN_INSTALL File /nonfatal /a /r /x "*.??*.???*" "..\..\inkscape\share\tutorials" + !insertmacro UNINSTALL.LOG_CLOSE_INSTALL SectionEnd SectionGroupEnd @@ -631,6 +738,14 @@ Section $(lng_be) SecByelorussian !insertmacro Language be be SectionEnd +Section $(lng_bg) SecBulgarian + !insertmacro Language bg bg +SectionEnd + +Section $(lng_bn) SecBengali + !insertmacro Language bn bn +SectionEnd + Section $(lng_ca) SecCatalan !insertmacro Language ca ca SectionEnd @@ -647,6 +762,10 @@ Section $(lng_de) SecGerman !insertmacro Language 'de' 'de' SectionEnd +Section $(lng_dz) SecDzongkha + !insertmacro Language dz dz +SectionEnd + Section $(lng_el) SecGreek !insertmacro Language el el SectionEnd @@ -655,6 +774,26 @@ Section $(lng_en) SecEnglish SectionIn 1 2 3 RO SectionEnd +Section $(lng_en_AU) SecEnglishAustralian + !insertmacro Language en_AU en_AU +SectionEnd + +Section $(lng_en_CA) SecEnglishCanadian + !insertmacro Language en_CA en_CA +SectionEnd + +Section $(lng_en_GB) SecEnglishBritain + !insertmacro Language en_GB en_GB +SectionEnd + +Section $(lng_en_US@piglatin) SecEnglishPiglatin + !insertmacro Language en_US@piglatin en_US@Piglatin +SectionEnd + +Section $(lng_eo) SecEsperanto + !insertmacro Language eo eo +SectionEnd + Section $(lng_es) SecSpanish !insertmacro Language 'es' 'es' SectionEnd @@ -667,10 +806,18 @@ Section $(lng_et) SecEstonian !insertmacro Language et et SectionEnd +Section $(lng_eu) SecBasque + !insertmacro Language eu eu +SectionEnd + Section $(lng_fr) SecFrench !insertmacro Language 'fr' 'fr' SectionEnd +Section $(lng_fi) SecFinnish + !insertmacro Language 'fi' 'fi' +SectionEnd + Section $(lng_ga) SecIrish !insertmacro Language ga ga SectionEnd @@ -680,11 +827,26 @@ Section $(lng_gl) SecGallegan SectionIn 1 2 3 SectionEnd +Section $(lng_he) SecHebrew + !insertmacro Language he he + SectionIn 1 2 3 +SectionEnd + +Section $(lng_hr) SecCroatian + !insertmacro Language hr hr + SectionIn 1 2 3 +SectionEnd + Section $(lng_hu) SecHungarian !insertmacro Language hu hu SectionIn 1 2 3 SectionEnd +Section $(lng_id) SecIndonesian + !insertmacro Language id id + SectionIn 1 2 3 +SectionEnd + Section $(lng_it) SecItalian !insertmacro Language it it SectionIn 1 2 3 @@ -694,6 +856,10 @@ Section $(lng_ja) SecJapanese !insertmacro Language 'ja' 'jp' SectionEnd +Section $(lng_km) SecKhmer + !insertmacro Language km km +SectionEnd + Section $(lng_ko) SecKorean !insertmacro Language 'ko' 'ko' SectionEnd @@ -702,6 +868,10 @@ Section $(lng_lt) SecLithuanian !insertmacro Language 'lt' 'lt' SectionEnd +Section $(lng_mn) SecMongolian + !insertmacro Language mn mn +SectionEnd + Section $(lng_mk) SecMacedonian !insertmacro Language mk mk SectionEnd @@ -710,6 +880,10 @@ Section $(lng_nb) SecNorwegianBokmal !insertmacro Language nb nb SectionEnd +Section $(lng_ne) SecNepali + !insertmacro Language ne ne +SectionEnd + Section $(lng_nl) SecDutch !insertmacro Language nl nl SectionEnd @@ -734,10 +908,18 @@ Section $(lng_pt_BR) SecPortugueseBrazil !insertmacro Language pt_BR pt_BR SectionEnd +Section $(lng_ro) SecRomanian + !insertmacro Language ro ro +SectionEnd + Section $(lng_ru) SecRussian !insertmacro Language ru ru SectionEnd +Section $(lng_rw) SecKinyarwanda + !insertmacro Language rw rw +SectionEnd + Section $(lng_sk) SecSlovak !insertmacro Language sk sk SectionEnd @@ -746,6 +928,10 @@ Section $(lng_sl) SecSlovenian !insertmacro Language sl sl SectionEnd +Section $(lng_sq) SecAlbanian + !insertmacro Language sq sq +SectionEnd + Section $(lng_sr) SecSerbian !insertmacro Language sr sr SectionEnd @@ -758,6 +944,10 @@ Section $(lng_sv) SecSwedish !insertmacro Language sv sv SectionEnd +Section $(lng_th) SecThai + !insertmacro Language th th +SectionEnd + Section $(lng_tr) SecTurkish !insertmacro Language tr tr SectionEnd @@ -766,6 +956,10 @@ Section $(lng_uk) SecUkrainian !insertmacro Language uk uk SectionEnd +Section $(lng_vi) SecVietnamese + !insertmacro Language vi vi +SectionEnd + Section $(lng_zh_CN) SecChineseSimplified !insertmacro Language zh_CN zh_CN SectionEnd @@ -802,16 +996,15 @@ Section -FinalizeInstallation ; start menu entries ClearErrors - CreateDirectory "$SMPROGRAMS\Inkscape" - CreateShortCut "$SMPROGRAMS\Inkscape\Inkscape.lnk" "$INSTDIR\inkscape.exe" - CreateShortCut "$SMPROGRAMS\Inkscape\Uninstall Inkscape.lnk" "$INSTDIR\uninst.exe" + CreateShortCut "$SMPROGRAMS\Inkscape.lnk" "$INSTDIR\inkscape.exe" IfErrors 0 +2 DetailPrint "fatal: failed to write to start menu info" ; uninstall settings ClearErrors - WriteUninstaller "$INSTDIR\uninst.exe" - WriteRegExpandStr SHCTX "${PRODUCT_UNINST_KEY}" "UninstallString" '"$INSTDIR\uninst.exe"' + ; WriteUninstaller "$INSTDIR\uninst.exe" + WriteRegExpandStr SHCTX "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\${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" @@ -832,6 +1025,7 @@ SectionEnd !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) @@ -855,6 +1049,9 @@ SectionEnd !macroend Function .onInit + ;prepare log always within .onInit function + !insertmacro UNINSTALL.LOG_PREPARE_INSTALL + ;Extract InstallOptions INI files StrCpy $AskMultiUser "1" StrCpy $MultiUser "0" @@ -882,15 +1079,17 @@ Function .onInit Pop $1 StrCmp $1 "Admin" info_done - MessageBox MB_OK|MB_ICONEXCLAMATION "$(lng_NO_ADMIN)" - + MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "$(lng_NO_ADMIN)$(lng_OK_CANCEL_DESC)" /SD IDOK IDOK info_done IDCANCEL +1 + Quit + Goto info_done info_Win9x: # This one means you don't need to care about admin or # not admin because Windows 9x doesn't either - MessageBox MB_OK|MB_ICONEXCLAMATION $(lng_NOT_SUPPORTED) - + MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "$(lng_NOT_SUPPORTED)$(lng_OK_CANCEL_DESC)" /SD IDOK IDOK info_done IDCANCEL +1 + Quit + info_done: ;check for previous installation @@ -898,10 +1097,28 @@ Function .onInit StrCmp $0 "" +1 +2 ReadRegStr $0 HKCU "${PRODUCT_DIR_REGKEY}" "User" ;check user if applicable - StrCmp $0 "" +3 - StrCmp $0 $User +2 - MessageBox MB_OK|MB_ICONEXCLAMATION "$(lng_DIFFERENT_USER)" - + StrCmp $0 "" diff_user_install_done + StrCmp $0 $User diff_user_install_done + MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "$(lng_DIFFERENT_USER)$(lng_OK_CANCEL_DESC)" /SD IDOK IDOK diff_user_install_done IDCANCEL +1 + Quit + diff_user_install_done: + + ; call uninstall first + ; code taken from the vlc project + ReadRegStr $R0 HKLM ${PRODUCT_UNINST_KEY} "UninstallString" + ReadRegStr $R1 HKLM ${PRODUCT_UNINST_KEY} "DisplayName" + StrCmp $R0 "" +1 +3 + ReadRegStr $R0 HKCU ${PRODUCT_UNINST_KEY} "UninstallString" + ReadRegStr $R1 HKCU ${PRODUCT_UNINST_KEY} "DisplayName" + StrCmp $R0 "" uninstall_before_done + + MessageBox MB_YESNO|MB_ICONEXCLAMATION $(lng_WANT_UNINSTALL_BEFORE) /SD IDNO IDYES +1 IDNO uninstall_before_done + ;Run the uninstaller + ;uninst: + ClearErrors + ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file + uninstall_before_done: + ; proccess command line parameter !insertmacro Parameter "GTK" ${SecGTK} !insertmacro Parameter "SHORTCUTS" ${secShortcuts} @@ -910,6 +1127,7 @@ Function .onInit !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} @@ -917,37 +1135,59 @@ Function .onInit !insertmacro Parameter "am" ${SecAmharic} !insertmacro Parameter "az" ${SecAzerbaijani} !insertmacro Parameter "be" ${SecByelorussian} + !insertmacro Parameter "bg" ${SecBulgarian} + !insertmacro Parameter "bn" ${SecBengali} !insertmacro Parameter "ca" ${SecCatalan} !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@Latn" ${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} @@ -967,6 +1207,7 @@ Function .onInit /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 \ @@ -978,11 +1219,17 @@ FunctionEnd Function .onSelChange FunctionEnd + +Function .onInstSuccess + ;create/update log always within .onInstSuccess function + !insertmacro UNINSTALL.LOG_UPDATE_INSTALL +FunctionEnd + ; -------------------------------------------------- Function un.CustomPageUninstall !insertmacro MUI_HEADER_TEXT "$(lng_UInstOpt)" "$(lng_UInstOpt1)" - !insertmacro MUI_INSTALLOPTIONS_WRITE "inkscape.nsi.uninstall" "Field 1" "Text" "$APPDATA\Inkscape\preferences.xml" + !insertmacro MUI_INSTALLOPTIONS_WRITE "inkscape.nsi.uninstall" "Field 1" "Text" "$APPDATA\Inkscape\" !insertmacro MUI_INSTALLOPTIONS_WRITE "inkscape.nsi.uninstall" "Field 2" "Text" "$(lng_PurgePrefs)" !insertmacro MUI_INSTALLOPTIONS_DISPLAY "inkscape.nsi.uninstall" @@ -994,6 +1241,8 @@ FunctionEnd Function un.onInit + ;begin uninstall, could be added on top of uninstall section instead + !insertmacro UNINSTALL.LOG_BEGIN_UNINSTALL ClearErrors StrCpy $User "" @@ -1007,18 +1256,22 @@ Function un.onInit ; Test if this was a multiuser installation ReadRegStr $0 HKLM "${PRODUCT_DIR_REGKEY}" "" - StrCmp $0 "$INSTDIR\inkscape.exe" 0 +5 + StrCmp $0 "$INSTDIR\inkscape.exe" 0 hkcu_user_uninstall ReadRegStr $MultiUser HKLM "${PRODUCT_DIR_REGKEY}" "MultiUser" ReadRegStr $askMultiUser HKLM "${PRODUCT_DIR_REGKEY}" "askMultiUser" ReadRegStr $0 HKLM "${PRODUCT_DIR_REGKEY}" "User" - Goto +4 + Goto check_user_uninstall + hkcu_user_uninstall: 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 - StrCmp $0 "" +3 - StrCmp $0 $User +2 - MessageBox MB_OK|MB_ICONEXCLAMATION "$(lng_DIFFERENT_USER)" + check_user_uninstall: + StrCmp $0 "" diff_user_uninstall_done + StrCmp $0 $User diff_user_uninstall_done + MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "$(lng_DIFFERENT_USER)$(lng_OK_CANCEL_DESC)" /SD IDOK IDOK diff_user_uninstall_done IDCANCEL +1 + Quit + diff_user_uninstall_done: !insertmacro MUI_INSTALLOPTIONS_EXTRACT "inkscape.nsi.uninstall" @@ -1036,7 +1289,8 @@ Section Uninstall Delete "$APPDATA\Inkscape\extension-errors.log" StrCmp $MultiUser "0" 0 endPurge ; multiuser assigned in dialog DetailPrint "purge personal settings in $APPDATA\Inkscape" - RMDir /r "$APPDATA\Inkscape" + ;RMDir /r "$APPDATA\Inkscape" + !insertmacro delprefs endPurge: ; Remove file associations for svg editor @@ -1140,6 +1394,8 @@ Section Uninstall DetailPrint "removing shortcuts" Delete "$DESKTOP\Inkscape.lnk" Delete "$QUICKLAUNCH\Inkscape.lnk" + Delete "$SMPROGRAMS\Inkscape.lnk" + ;just in case they are still there Delete "$SMPROGRAMS\Inkscape\Uninstall Inkscape.lnk" Delete "$SMPROGRAMS\Inkscape\Inkscape.lnk" RMDir "$SMPROGRAMS\Inkscape" @@ -1152,12 +1408,33 @@ Section Uninstall DetailPrint "removing shortcuts" Delete "$DESKTOP\Inkscape.lnk" Delete "$QUICKLAUNCH\Inkscape.lnk" + Delete "$SMPROGRAMS\Inkscape.lnk" + ;just in case they are still there Delete "$SMPROGRAMS\Inkscape\Uninstall Inkscape.lnk" Delete "$SMPROGRAMS\Inkscape\Inkscape.lnk" RMDir "$SMPROGRAMS\Inkscape" DetailPrint "removing uninstall info" - RMDir /r "$INSTDIR" + + ;uninstall from path, must be repeated for every install logged path individual + !insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\lib\locale" + !insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\locale" + !insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\doc" + !insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\share\tutorials" + !insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\share\templates" + !insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\share\screens" + !insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\share\clipart" + !insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\share\extensions" + !insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\share\icons" + !insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\share" + !insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\modules" + !insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\python" + !insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR" + + ;end uninstall, after uninstall from all logged paths has been performed + !insertmacro UNINSTALL.LOG_END_UNINSTALL + + ;RMDir /r "$INSTDIR" SetAutoClose false