📄 pidgin-installer.nsi
字号:
Delete "$TEMP\gtk-runtime.exe"SectionEnd ; end of GTK+ section!endif;--------------------------------;Pidgin Install SectionSection $(PIDGIN_SECTION_TITLE) SecPidgin SectionIn 1 RO ; Check install rights.. Call CheckUserInstallRights Pop $R0 ; Get GTK+ lib dir if we have it.. StrCmp $R0 "NONE" pidgin_none StrCmp $R0 "HKLM" pidgin_hklm pidgin_hkcu pidgin_hklm: ReadRegStr $R1 HKLM ${GTK_REG_KEY} "Path" WriteRegStr HKLM "${HKLM_APP_PATHS_KEY}" "" "$INSTDIR\pidgin.exe" WriteRegStr HKLM "${HKLM_APP_PATHS_KEY}" "Path" "$R1\bin" WriteRegStr HKLM ${PIDGIN_REG_KEY} "" "$INSTDIR" WriteRegStr HKLM ${PIDGIN_REG_KEY} "Version" "${PIDGIN_VERSION}" WriteRegStr HKLM "${PIDGIN_UNINSTALL_KEY}" "DisplayName" "Pidgin" WriteRegStr HKLM "${PIDGIN_UNINSTALL_KEY}" "DisplayVersion" "${PIDGIN_VERSION}" WriteRegStr HKLM "${PIDGIN_UNINSTALL_KEY}" "HelpLink" "http://developer.pidgin.im/wiki/Using Pidgin" WriteRegDWORD HKLM "${PIDGIN_UNINSTALL_KEY}" "NoModify" 1 WriteRegDWORD HKLM "${PIDGIN_UNINSTALL_KEY}" "NoRepair" 1 WriteRegStr HKLM "${PIDGIN_UNINSTALL_KEY}" "UninstallString" "$INSTDIR\${PIDGIN_UNINST_EXE}" ; Sets scope of the desktop and Start Menu entries for all users. SetShellVarContext "all" Goto pidgin_install_files pidgin_hkcu: ReadRegStr $R1 HKCU ${GTK_REG_KEY} "Path" StrCmp $R1 "" 0 +2 ReadRegStr $R1 HKLM ${GTK_REG_KEY} "Path" WriteRegStr HKCU ${PIDGIN_REG_KEY} "" "$INSTDIR" WriteRegStr HKCU ${PIDGIN_REG_KEY} "Version" "${PIDGIN_VERSION}" WriteRegStr HKCU "${PIDGIN_UNINSTALL_KEY}" "DisplayName" "Pidgin" WriteRegStr HKCU "${PIDGIN_UNINSTALL_KEY}" "DisplayVersion" "${PIDGIN_VERSION}" WriteRegStr HKCU "${PIDGIN_UNINSTALL_KEY}" "HelpLink" "http://developer.pidgin.im/wiki/Using Pidgin" WriteRegDWORD HKCU "${PIDGIN_UNINSTALL_KEY}" "NoModify" 1 WriteRegDWORD HKCU "${PIDGIN_UNINSTALL_KEY}" "NoRepair" 1 WriteRegStr HKCU "${PIDGIN_UNINSTALL_KEY}" "UninstallString" "$INSTDIR\${PIDGIN_UNINST_EXE}" Goto pidgin_install_files pidgin_none: ReadRegStr $R1 HKLM ${GTK_REG_KEY} "Path" pidgin_install_files: SetOutPath "$INSTDIR" ; Pidgin files SetOverwrite on ;Delete old liboscar and libjabber since they tend to be problematic Delete "$INSTDIR\plugins\liboscar.dll" Delete "$INSTDIR\plugins\libjabber.dll" File /r ..\..\..\${PIDGIN_INSTALL_DIR}\*.* !ifdef DEBUG File "${PIDGIN_INSTALLER_DEPS}\exchndl.dll" !endif ; Install shfolder.dll if need be.. SearchPath $R4 "shfolder.dll" StrCmp $R4 "" 0 got_shfolder SetOutPath "$SYSDIR" File "${PIDGIN_INSTALLER_DEPS}\shfolder.dll" SetOutPath "$INSTDIR" got_shfolder: ; Check if Perl is installed, if so add it to the AppPaths ReadRegStr $R2 HKLM ${PERL_REG_KEY} "" StrCmp $R2 "" 0 perl_exists ReadRegStr $R2 HKCU ${PERL_REG_KEY} "" StrCmp $R2 "" perl_done perl_exists perl_exists: IfFileExists "$R2\bin\${PERL_DLL}" 0 perl_done StrCmp $R0 "HKLM" 0 perl_done ReadRegStr $R3 HKLM "${HKLM_APP_PATHS_KEY}" "Path" WriteRegStr HKLM "${HKLM_APP_PATHS_KEY}" "Path" "$R3;$R2\bin" perl_done: ; If this is under NT4, delete the SILC support stuff ; there is a bug that will prevent any account from connecting ; See https://lists.silcnet.org/pipermail/silc-devel/2005-January/001588.html ${If} ${IsNT} ${AndIf} ${IsWinNT4} Delete "$INSTDIR\plugins\libsilc.dll" Delete "$INSTDIR\silcclient.dll" Delete "$INSTDIR\silc.dll" ${EndIf} SetOutPath "$INSTDIR" ; If we don't have install rights we're done StrCmp $R0 "NONE" done SetOverwrite off ; write out uninstaller SetOverwrite on WriteUninstaller "$INSTDIR\${PIDGIN_UNINST_EXE}" SetOverwrite off ; If we previously had pidgin set up to run on startup, make it do so again StrCmp $STARTUP_RUN_KEY "HKCU" +1 +2 WriteRegStr HKCU "${STARTUP_RUN_KEY}" "Pidgin" "$INSTDIR\pidgin.exe" StrCmp $STARTUP_RUN_KEY "HKLM" +1 +2 WriteRegStr HKLM "${STARTUP_RUN_KEY}" "Pidgin" "$INSTDIR\pidgin.exe" done:SectionEnd ; end of default Pidgin section;--------------------------------;ShortcutsSectionGroup /e $(PIDGIN_SHORTCUTS_SECTION_TITLE) SecShortcuts Section /o $(PIDGIN_DESKTOP_SHORTCUT_SECTION_TITLE) SecDesktopShortcut SetOverwrite on CreateShortCut "$DESKTOP\Pidgin.lnk" "$INSTDIR\pidgin.exe" SetOverwrite off SectionEnd Section $(PIDGIN_STARTMENU_SHORTCUT_SECTION_TITLE) SecStartMenuShortcut SetOverwrite on CreateShortCut "$SMPROGRAMS\Pidgin.lnk" "$INSTDIR\pidgin.exe" SetOverwrite off SectionEndSectionGroupEnd;--------------------------------;URI HandlingSectionGroup /e $(URI_HANDLERS_SECTION_TITLE) SecURIHandlers Section /o "aim:" SecURI_AIM Push "aim" Call RegisterURIHandler SectionEnd Section /o "msnim:" SecURI_MSNIM Push "msnim" Call RegisterURIHandler SectionEnd Section /o "ymsgr:" SecURI_YMSGR Push "ymsgr" Call RegisterURIHandler SectionEndSectionGroupEnd;--------------------------------;Spell CheckingSectionGroup /e $(PIDGIN_SPELLCHECK_SECTION_TITLE) SecSpellCheck Section /o $(PIDGIN_SPELLCHECK_BRETON) SecSpellCheckBreton Push ${SecSpellCheckBreton} Call InstallAspellAndDict SectionEnd Section /o $(PIDGIN_SPELLCHECK_CATALAN) SecSpellCheckCatalan Push ${SecSpellCheckCatalan} Call InstallAspellAndDict SectionEnd Section /o $(PIDGIN_SPELLCHECK_CZECH) SecSpellCheckCzech Push ${SecSpellCheckCzech} Call InstallAspellAndDict SectionEnd Section /o $(PIDGIN_SPELLCHECK_WELSH) SecSpellCheckWelsh Push ${SecSpellCheckWelsh} Call InstallAspellAndDict SectionEnd Section /o $(PIDGIN_SPELLCHECK_DANISH) SecSpellCheckDanish Push ${SecSpellCheckDanish} Call InstallAspellAndDict SectionEnd Section /o $(PIDGIN_SPELLCHECK_GERMAN) SecSpellCheckGerman Push ${SecSpellCheckGerman} Call InstallAspellAndDict SectionEnd Section /o $(PIDGIN_SPELLCHECK_GREEK) SecSpellCheckGreek Push ${SecSpellCheckGreek} Call InstallAspellAndDict SectionEnd Section /o $(PIDGIN_SPELLCHECK_ENGLISH) SecSpellCheckEnglish Push ${SecSpellCheckEnglish} Call InstallAspellAndDict SectionEnd Section /o $(PIDGIN_SPELLCHECK_ESPERANTO) SecSpellCheckEsperanto Push ${SecSpellCheckEsperanto} Call InstallAspellAndDict SectionEnd Section /o $(PIDGIN_SPELLCHECK_SPANISH) SecSpellCheckSpanish Push ${SecSpellCheckSpanish} Call InstallAspellAndDict SectionEnd Section /o $(PIDGIN_SPELLCHECK_FAROESE) SecSpellCheckFaroese Push ${SecSpellCheckFaroese} Call InstallAspellAndDict SectionEnd Section /o $(PIDGIN_SPELLCHECK_FRENCH) SecSpellCheckFrench Push ${SecSpellCheckFrench} Call InstallAspellAndDict SectionEnd Section /o $(PIDGIN_SPELLCHECK_ITALIAN) SecSpellCheckItalian Push ${SecSpellCheckItalian} Call InstallAspellAndDict SectionEnd Section /o $(PIDGIN_SPELLCHECK_DUTCH) SecSpellCheckDutch Push ${SecSpellCheckDutch} Call InstallAspellAndDict SectionEnd Section /o $(PIDGIN_SPELLCHECK_NORWEGIAN) SecSpellCheckNorwegian Push ${SecSpellCheckNorwegian} Call InstallAspellAndDict SectionEnd Section /o $(PIDGIN_SPELLCHECK_POLISH) SecSpellCheckPolish Push ${SecSpellCheckPolish} Call InstallAspellAndDict SectionEnd Section /o $(PIDGIN_SPELLCHECK_PORTUGUESE) SecSpellCheckPortuguese Push ${SecSpellCheckPortuguese} Call InstallAspellAndDict SectionEnd Section /o $(PIDGIN_SPELLCHECK_ROMANIAN) SecSpellCheckRomanian Push ${SecSpellCheckRomanian} Call InstallAspellAndDict SectionEnd Section /o $(PIDGIN_SPELLCHECK_RUSSIAN) SecSpellCheckRussian Push ${SecSpellCheckRussian} Call InstallAspellAndDict SectionEnd Section /o $(PIDGIN_SPELLCHECK_SLOVAK) SecSpellCheckSlovak Push ${SecSpellCheckSlovak} Call InstallAspellAndDict SectionEnd Section /o $(PIDGIN_SPELLCHECK_SWEDISH) SecSpellCheckSwedish Push ${SecSpellCheckSwedish} Call InstallAspellAndDict SectionEnd Section /o $(PIDGIN_SPELLCHECK_UKRAINIAN) SecSpellCheckUkrainian Push ${SecSpellCheckUkrainian} Call InstallAspellAndDict SectionEndSectionGroupEnd;--------------------------------;Uninstaller SectionSection Uninstall Call un.CheckUserInstallRights Pop $R0 StrCmp $R0 "NONE" no_rights StrCmp $R0 "HKCU" try_hkcu try_hklm try_hkcu: ReadRegStr $R0 HKCU ${PIDGIN_REG_KEY} "" StrCmp $R0 $INSTDIR 0 cant_uninstall ; HKCU install path matches our INSTDIR so uninstall DeleteRegKey HKCU ${PIDGIN_REG_KEY} DeleteRegKey HKCU "${PIDGIN_UNINSTALL_KEY}" Goto cont_uninstall try_hklm: ReadRegStr $R0 HKLM ${PIDGIN_REG_KEY} "" StrCmp $R0 $INSTDIR 0 try_hkcu ; HKLM install path matches our INSTDIR so uninstall DeleteRegKey HKLM ${PIDGIN_REG_KEY} DeleteRegKey HKLM "${PIDGIN_UNINSTALL_KEY}" DeleteRegKey HKLM "${HKLM_APP_PATHS_KEY}" ; Sets start menu and desktop scope to all users.. SetShellVarContext "all" cont_uninstall: ; The WinPrefs plugin may have left this behind.. DeleteRegValue HKCU "${STARTUP_RUN_KEY}" "Pidgin" DeleteRegValue HKLM "${STARTUP_RUN_KEY}" "Pidgin" ; Remove Language preference info (TODO: check if NSIS removes this) RMDir /r "$INSTDIR\locale" RMDir /r "$INSTDIR\pixmaps" RMDir /r "$INSTDIR\perlmod" Delete "$INSTDIR\plugins\autoaccept.dll" Delete "$INSTDIR\plugins\buddynote.dll" Delete "$INSTDIR\plugins\convcolors.dll" Delete "$INSTDIR\plugins\extplacement.dll" Delete "$INSTDIR\plugins\pidginrc.dll" Delete "$INSTDIR\plugins\history.dll" Delete "$INSTDIR\plugins\iconaway.dll" Delete "$INSTDIR\plugins\idle.dll" Delete "$INSTDIR\plugins\joinpart.dll" Delete "$INSTDIR\plugins\libaim.dll" Delete "$INSTDIR\plugins\libbonjour.dll" Delete "$INSTDIR\plugins\libgg.dll" Delete "$INSTDIR\plugins\libicq.dll" Delete "$INSTDIR\plugins\libirc.dll" Delete "$INSTDIR\plugins\libmsn.dll" Delete "$INSTDIR\plugins\libnapster.dll" Delete "$INSTDIR\plugins\libnovell.dll" Delete "$INSTDIR\plugins\libqq.dll" Delete "$INSTDIR\plugins\libsametime.dll" Delete "$INSTDIR\plugins\libsilc.dll" Delete "$INSTDIR\plugins\libsimple.dll" Delete "$INSTDIR\plugins\libtoc.dll" Delete "$INSTDIR\plugins\libyahoo.dll" Delete "$INSTDIR\plugins\libxmpp.dll" Delete "$INSTDIR\plugins\log_reader.dll" Delete "$INSTDIR\plugins\markerline.dll" Delete "$INSTDIR\plugins\newline.dll" Delete "$INSTDIR\plugins\notify.dll" Delete "$INSTDIR\plugins\offlinemsg.dll" Delete "$INSTDIR\plugins\perl.dll" Delete "$INSTDIR\plugins\psychic.dll" Delete "$INSTDIR\plugins\relnot.dll" Delete "$INSTDIR\plugins\spellchk.dll" Delete "$INSTDIR\plugins\ssl-nss.dll" Delete "$INSTDIR\plugins\ssl.dll" Delete "$INSTDIR\plugins\statenotify.dll" Delete "$INSTDIR\plugins\tcl.dll" Delete "$INSTDIR\plugins\ticker.dll" Delete "$INSTDIR\plugins\timestamp.dll" Delete "$INSTDIR\plugins\timestamp_format.dll" Delete "$INSTDIR\plugins\win2ktrans.dll" Delete "$INSTDIR\plugins\winprefs.dll" RMDir "$INSTDIR\plugins" Delete "$INSTDIR\sounds\pidgin\alert.wav" Delete "$INSTDIR\sounds\pidgin\login.wav" Delete "$INSTDIR\sounds\pidgin\logout.wav" Delete "$INSTDIR\sounds\pidgin\receive.wav" Delete "$INSTDIR\sounds\pidgin\send.wav" RMDir "$INSTDIR\sounds\pidgin" RMDir "$INSTDIR\sounds" Delete "$INSTDIR\freebl3.dll" Delete "$INSTDIR\idletrack.dll" Delete "$INSTDIR\libgtkspell.dll" Delete "$INSTDIR\libjabber.dll" Delete "$INSTDIR\liboscar.dll" Delete "$INSTDIR\libpurple.dll" Delete "$INSTDIR\libmeanwhile-1.dll" Delete "$INSTDIR\libxml2.dll" Delete "$INSTDIR\nspr4.dll" Delete "$INSTDIR\nss3.dll" Delete "$INSTDIR\nssckbi.dll" Delete "$INSTDIR\pidgin.exe" Delete "$INSTDIR\pidgin.dll" Delete "$INSTDIR\plc4.dll" Delete "$INSTDIR\plds4.dll" Delete "$INSTDIR\silc.dll" Delete "$INSTDIR\silcclient.dll" Delete "$INSTDIR\softokn3.dll" Delete "$INSTDIR\ssl3.dll" Delete "$INSTDIR\${PIDGIN_UNINST_EXE}" !ifdef DEBUG Delete "$INSTDIR\exchndl.dll" !endif Delete "$INSTDIR\install.log" ;Try to remove Pidgin install dir (only if empty) RMDir "$INSTDIR" ; Shortcuts.. Delete "$DESKTOP\Pidgin.lnk" Goto done cant_uninstall: MessageBox MB_OK $(un.PIDGIN_UNINSTALL_ERROR_1) /SD IDOK Quit no_rights: MessageBox MB_OK $(un.PIDGIN_UNINSTALL_ERROR_2) /SD IDOK Quit done:SectionEnd ; end of uninstall section;--------------------------------;Descriptions!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_DESCRIPTION_TEXT ${SecPidgin} \ $(PIDGIN_SECTION_DESCRIPTION)!ifdef WITH_GTK !insertmacro MUI_DESCRIPTION_TEXT ${SecGtk} \ $(GTK_SECTION_DESCRIPTION)!endif !insertmacro MUI_DESCRIPTION_TEXT ${SecShortcuts} \ $(PIDGIN_SHORTCUTS_SECTION_DESCRIPTION) !insertmacro MUI_DESCRIPTION_TEXT ${SecDesktopShortcut} \ $(PIDGIN_DESKTOP_SHORTCUT_DESC) !insertmacro MUI_DESCRIPTION_TEXT ${SecStartMenuShortcut} \ $(PIDGIN_STARTMENU_SHORTCUT_DESC) !insertmacro MUI_DESCRIPTION_TEXT ${SecSpellCheck} \ $(PIDGIN_SPELLCHECK_SECTION_DESCRIPTION) !insertmacro MUI_DESCRIPTION_TEXT ${SecSpellCheckBreton} \ "$(PIDGIN_SPELLCHECK_BRETON) (862kb)" !insertmacro MUI_DESCRIPTION_TEXT ${SecSpellCheckCatalan} \ "$(PIDGIN_SPELLCHECK_CATALAN) (3.9Mb)" !insertmacro MUI_DESCRIPTION_TEXT ${SecSpellCheckCzech} \ "$(PIDGIN_SPELLCHECK_CZECH) (17Mb)" !insertmacro MUI_DESCRIPTION_TEXT ${SecSpellCheckWelsh} \ "$(PIDGIN_SPELLCHECK_WELSH) (4.2Mb)" !insertmacro MUI_DESCRIPTION_TEXT ${SecSpellCheckDanish} \ "$(PIDGIN_SPELLCHECK_DANISH) (6.9Mb)" !insertmacro MUI_DESCRIPTION_TEXT ${SecSpellCheckGerman} \ "$(PIDGIN_SPELLCHECK_GERMAN) (5.4Mb)"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -