Всё не успокоюсь насчет The KMPlayer. Кто поможет с оптимизацией?
Скрипт
Код:
!define PRODUCT_NAME "The KMPlayer"
!define PRODUCT_VERSION "2.9.3.1428"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
!define BRANDING "Created by My, 2009"
!define Publisher "http://www.Site.ru/"
!define Contact "Комсомолец"
!define HelpLink "http://www.kmplayer.com/forums/index.php/"
!define URLInfoAbout "http://www.kmplayer.com/forums/index.php/"
!define URLUpdateInfo "http://www.kmplayer.com/forums/index.php/"
!define Comments "Отличный корейский мультимедийный плеер!"
; MUI 1.67 compatible ------
!include "MUI.nsh"
!include "FileFunc.nsh"
SetCompressor /SOLID lzma
; MUI Settings
!define MUI_ABORTWARNING
!define MUI_ICON "E:\NSIS\KMP player\kmp.ico"
!define MUI_UNICON "E:\NSIS\KMP player\kmp.ico"
!define MUI_COMPONENTSPAGE_NODESC
; Welcome page
!insertmacro MUI_PAGE_WELCOME
; Directory page
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_COMPONENTS
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!insertmacro MUI_PAGE_FINISH
; Uninstaller pages
!insertmacro MUI_UNPAGE_INSTFILES
; Language files
!insertmacro MUI_LANGUAGE "Russian"
!insertmacro RefreshShellIcons
BrandingText "${BRANDING}"
Name "${PRODUCT_NAME}"
Caption "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "${PRODUCT_NAME}_${PRODUCT_VERSION}.exe"
InstallDir "$PROGRAMFILES\${PRODUCT_NAME}"
ShowInstDetails show
ShowUnInstDetails show
InstType "Полная"
InstType "Сокращенная"
Section "!${PRODUCT_NAME}" idx0
SectionIn 1 2 RO
SetOutPath "$INSTDIR"
File /r "E:\NSIS\KMP player\kmp-setup-silent\*.*"
;======================================================================================================
WriteUninstaller "$OUTDIR\Удалить.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$OUTDIR\KMPlayer.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$OUTDIR\Удалить.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${Publisher}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Contact" "${Contact}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "HelpLink" "${HelpLink}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${URLInfoAbout}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLUpdateInfo" "${URLUpdateInfo}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Comments" "${Comments}"
SetShellVarContext current
SectionEnd
;======================================================================================================
SectionGroup /e "Ярлыки"
Section "Ярлыки в меню Пуск" idx1
SectionIn 1 2
SetShellVarContext all
CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}"
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME}.lnk" "$INSTDIR\KMPlayer.exe"
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Удалить ${PRODUCT_NAME}.lnk" "$INSTDIR\Удалить.exe"
SectionEnd
Section "Ярлыки в панели быстрого запуска" idx2
SectionIn 1 2
SetShellVarContext all
CreateShortCut "$QUICKLAUNCH\${PRODUCT_NAME}.lnk" "$INSTDIR\KMPlayer.exe"
SectionEnd
Section "Ярлык на рабочем столе" idx3
SectionIn 1
IfSilent +3
SetShellVarContext all
CreateShortCut "$DESKTOP\${PRODUCT_NAME}.lnk" "$INSTDIR\KMPlayer.exe"
SectionEnd
SectionGroupEnd
;======================================================================================================
Section "Скины" idx4
SectionIn 1
SetOutPath "$INSTDIR\Skins"
File /r "E:\NSIS\KMP player\Skins\*.*"
SectionEnd
;======================================================================================================
Section "Мастер настройки" idx5
SectionIn 1
SetOutPath "$INSTDIR\"
File "E:\NSIS\KMP player\wizard\KMPSetup.exe"
SetShellVarContext all
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Мастер настройки.lnk" "$INSTDIR\KMPSetup.exe"
SectionEnd
;======================================================================================================
Section "Ассоциировать" idx6
SectionIn 1 2
SetOutPath "$INSTDIR\"
File "E:\NSIS\KMP player\Assoc.exe"
ExecWait '$INSTDIR\Assoc.exe'
Delete '$INSTDIR\Assoc.exe'
; заготовка на будущее-доделаю файл ассоциаций
;!include "assoc.nsh"
${RefreshShellIcons}
SectionEnd
;======================================================================================================
Function un.onUninstSuccess
HideWindow
MessageBox MB_ICONINFORMATION|MB_OK "Удаление программы $(^Name) было успешно завершено."
FunctionEnd
Function un.onInit
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Вы уверены в том, что желаете удалить $(^Name) и все компоненты программы?" IDYES +2
Abort
FunctionEnd
Section Uninstall
!include "unregassoc.nsh"
${RefreshShellIcons}
RMDir /r "$INSTDIR\"
SetShellVarContext all
RMDir /r "$SMPROGRAMS\${PRODUCT_NAME}"
Delete "$DESKTOP\${PRODUCT_NAME}.LNK"
Delete "$QUICKLAUNCH\${PRODUCT_NAME}.LNK"
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
SetAutoClose true
SectionEnd
unregassoc.nsh во вложении
Для ассоциациий взял пример с темы плеера на inno. Там sfx-архив рапаковывается в темп и добавляет записи в реестр (которые unregassoc.nsh как раз и удаляет). Архив во вложении (.exe форум не разрешает, поэтому упаковал). Начал переводить его в формат nsis, но пока нет времени продолжать.
вот что успел перевести:
Код:
WriteRegStr HKCR "DVD\shell" "" "The KMPlayer"
WriteRegStr HKCR "DVD\shell\The KMPlayer\command" "" "\$\"$INSTDIR\KMPlayer.exe\$\" \$\"%1\$\"" /dvd"
WriteRegStr HKCR "AudioCD\shell" "" "The KMPlayer"
WriteRegStr HKCR "AudioCD\shell\The KMPlayer\command" "" "\$\"$INSTDIR\KMPlayer.exe\$\" \$\"%1\$\"" /cd"
WriteRegStr HKCU "Software\KMPlayer\KMP2.0\OptionArea" "InstallPath" "$INSTDIR\KMPlayer.exe"
WriteRegStr HKCU "Software\KMPlayer\KMP2.0\OptionArea" "SkinFolder" "Vista-Blue.ksf"
WriteRegStr HKCU "Software\KMPlayer\KMP2.0\OptionArea" "LanguageIniName" "Russian.ini"
WriteRegStr HKCR ".3gp" "" "KMPlayer.3gp"
WriteRegStr HKCR ".3gp\DefaultIcon" "" "$INSTDIR\KIconLib.dll,48"
WriteRegStr HKCR ".3gp" "KMPlayer.3gp" "KMP - Видеофайл 3GP"
WriteRegStr HKCR ".3gp\shell\open" "" "&Open"
WriteRegStr HKCR ".3gp\shell\open\command" "" "\$\"$INSTDIR\KMPlayer.exe\$\" \$\"%1\$\""
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.3GP" "Progid" "KMPlayer.3gp"
WriteRegStr HKCR ".asf" "" "KMPlayer.asf"
WriteRegStr HKCR ".asf\DefaultIcon" "" "$INSTDIR\KIconLib.dll,0"
WriteRegStr HKCR ".asf" "KMPlayer.asf" "KMP - Видеофайл asf"
WriteRegStr HKCR ".asf\shell\open" "" "&Open"
WriteRegStr HKCR ".asf\shell\open\command" "" "\$\"$INSTDIR\KMPlayer.exe\$\" \$\"%1\$\""
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.asf" "Progid" "KMPlayer.asf"
Мусору в скрипте достаточно. Буду рад помощи...