Мой новый скрипт для создания своей сборки этого плеера.
После компиляции получаем сборку, которая тихо ставится с ключом /S
В неё можно включить дополнительнные скины, русифицировать программу и т.п.
"Громкая" установка позволит выбрать форматы файлов, с которыми будет работать плеер по умолчанию, указать, где создавать ярлыки и выбрать папку установки.
В режиме тихой установки плеер ставит себя плеером по умолчанию для всех перечисленных в инсталяторе типов файлов и НЕ создает ярлыков в панели быстрого запуска и на рабочем столе.
В меню пуск создаются два интернет-ярлыка - на сайт производителя и на сайт русского сообщества
Скрипт:
Код:
;Text/Registry definitions
!define PRODUCT_NAME "GOM Player"
!define PRODUCT_VERSION "2.1.9.3754"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
!define BRANDING "By Happy Bulldozer860"
; MUI 1.67 compatible ------
!include "MUI.nsh"
!include "LogicLib.nsh"
!include "FileFunc.nsh"
SetCompressor /SOLID lzma
; MUI Settings
!define MUI_ABORTWARNING
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.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_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
; Language files
!insertmacro MUI_LANGUAGE "Russian"
;service macroses
;!insertmacro GetOptions
!insertmacro RefreshShellIcons
;Common directives
BrandingText "${BRANDING}"
Name "${PRODUCT_NAME}"
Caption "Установка ${PRODUCT_NAME} ${PRODUCT_VERSION} (Русская версия)"
UninstallCaption "Удаление ${PRODUCT_NAME} ${PRODUCT_VERSION} (Русская версия)"
OutFile "${PRODUCT_NAME}-${PRODUCT_VERSION}.exe"
InstallDir "$PROGRAMFILES\GRETECH\GomPlayer"
ShowInstDetails show
ShowUninstDetails show
;installation types
InstType "Полная"
InstType "Сокращенная"
InstType "Минимальная"
;variables section
Var OpenCommand
Var QueneCommand
Var IconFile
Var IconID
Var Description
;custom filetype registration function
!macro RegisterExtension extenstion
${Switch} ${extenstion}
${Case} "gom"
StrCpy $IconID 1
StrCpy $Description "GOM Player online movie file"
${Break}
${Case} "avi"
StrCpy $IconID 2
StrCpy $Description "Video (movie) file"
${Break}
${Case} "divx"
StrCpy $Description "Video (movie) file"
StrCpy $IconID 3
${Break}
${Case} "asx"
StrCpy $IconID 4
StrCpy $Description "Windows media file"
${Break}
${Case} "asf"
StrCpy $Description "Windows media file"
StrCpy $IconID 5
${Break}
${Case} "wmx"
StrCpy $Description "Windows media file"
StrCpy $IconID 6
${Break}
${Case} "wmv"
StrCpy $Description "Windows media file"
StrCpy $IconID 7
${Break}
${Case} "wma"
StrCpy $IconID 8
StrCpy $Description "Windows media file"
${Break}
${Case} "wvx"
StrCpy $IconID 9
StrCpy $Description "Windows media file"
${Break}
${Case} "mpg"
StrCpy $Description "MPEG video file"
StrCpy $IconID 11
${Break}
${Case} "mpe"
StrCpy $Description "MPEG video file"
StrCpy $IconID 11
${Break}
${Case} "mpeg"
StrCpy $Description "MPEG video file"
StrCpy $IconID 11
${Break}
${Case} "dat"
StrCpy $IconID 12
StrCpy $Description "MPEG video file"
${Break}
${Case} "ifo"
StrCpy $Description "MPEG video file"
StrCpy $IconID 13
${Break}
${Case} "vob"
StrCpy $Description "MPEG video file"
StrCpy $IconID 14
${Break}
${Case} "m1v"
StrCpy $Description "MPEG video file"
StrCpy $IconID 15
${Break}
${Case} "m2v"
StrCpy $IconID 16
StrCpy $Description "MPEG video file"
${Break}
${Case} "ts"
StrCpy $IconID 17
StrCpy $Description "MPEG video file"
${Break}
${Case} "tp"
StrCpy $IconID 18
StrCpy $Description "MPEG video file"
${Break}
${Case} "dmb"
StrCpy $IconID 19
StrCpy $Description "DMB-TS Files"
${Break}
${Case} "mp4"
StrCpy $IconID 20
StrCpy $Description "MPEG-4 video file"
${Break}
${Case} "m4v"
StrCpy $IconID 31
StrCpy $Description "MPEG-4 video file"
${Break}
${Case} "k3g"
StrCpy $IconID 21
StrCpy $Description "Mobile phone video clip"
${Break}
${Case} "3gp"
StrCpy $IconID 22
StrCpy $Description "Mobile phone video clip"
${Break}
${Case} "skm"
StrCpy $IconID 23
StrCpy $Description "Mobile phone video clip"
${Break}
${Case} "dmskm"
StrCpy $IconID 23
StrCpy $Description "Mobile phone video clip"
${Break}
${Case} "lmp4"
StrCpy $IconID 25
StrCpy $Description "Mobile phone video clip"
${Break}
${Case} "rm"
StrCpy $IconID 26
StrCpy $Description "RealMedia video file"
${Break}
${Case} "rmvb"
StrCpy $IconID 26
StrCpy $Description "RealMedia video file"
${Break}
${Case} "mkv"
StrCpy $IconID 28
StrCpy $Description "Matroska movie file"
${Break}
${Case} "ogm"
StrCpy $IconID 29
StrCpy $Description "OGM video file"
${Break}
${Case} "swf"
StrCpy $IconID 32
StrCpy $Description "FLASH file"
${Break}
${Case} "flv"
StrCpy $IconID 33
StrCpy $Description "FLASH video file"
${Break}
${Case} "mqv"
StrCpy $IconID 34
StrCpy $Description "MQV video file"
${Break}
${Case} "mov"
StrCpy $IconID 35
StrCpy $Description "MOV video file"
${Break}
${Default}
StrCpy $IconID 0
StrCpy $Description "GOM Player file"
${Break}
${EndSwitch}
WriteRegStr HKCR ".${extenstion}" "" "GomPlayer.${extenstion}"
WriteRegStr HKCR "GomPlayer.${extenstion}" "" "$Description"
WriteRegStr HKCR "GomPlayer.${extenstion}\DefaultIcon" "" "$IconFile,$IconID"
WriteRegStr HKLM "GomPlayer.${extenstion}\shell" "" "open"
WriteRegStr HKLM "GomPlayer.${extenstion}\shell\open" "" "Открыть в GomPLayer"
WriteRegStr HKCR "GomPlayer.${extenstion}\shell\open\command" "" "$OpenCommand"
WriteRegStr HKLM "GomPlayer.${extenstion}\shell\Enqueue" "" "В очередь GomPLayer"
WriteRegStr HKCR "GomPlayer.${extenstion}\shell\Enqueue\command" "" "$QueneCommand"
!macroend
;sections
Section "!${PRODUCT_NAME}"
SectionIn 1 2 3 RO
SetOutPath "$INSTDIR\"
File /r "d:\gom\Player\*.*"
StrCpy $OpenCommand "$\"$OUTDIR\GOM.exe$\" /open $\"%1$\""
StrCpy $QueneCommand "$\"$OUTDIR\GOM.exe$\" /add $\"%1$\""
StrCpy $IconFile "$OUTDIR\icon.dll"
WriteUninstaller "$OUTDIR\uninst.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$OUTDIR\GOM.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$OUTDIR\uninst.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
WriteRegStr HKCU "Software\Gretech\Gomplayer" "Programfolder" "$OUTDIR"
WriteRegStr HKCU "Software\Gretech\Gomplayer" "ProgramPath" "$OUTDIR\GOM.exe"
WriteRegStr HKLM "Software\Gretech\Gomplayer" "Programfolder" "$OUTDIR"
WriteRegStr HKLM "Software\Gretech\Gomplayer" "ProgramPath" "$OUTDIR\GOM.exe"
WriteRegStr HKCU "Software\Gretech\Gomplayer\Option" "sSkinFileName" "Basic"
SectionEnd
;=========================================================================================================================
Section "Скины"
SectionIn 1
SetOutPath "$INSTDIR\Skins"
File "d:\GOM\Skins\*.*"
SectionEnd
;=========================================================================================================================
SectionGroup /e "Ярлыки"
Section "В меню Пуск"
SectionIn 1 2
SetShellVarContext all
CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}"
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME}.lnk" "$INSTDIR\GOM.exe"
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Мастер настройки ${PRODUCT_NAME}.lnk" "$INSTDIR\GomWiz.exe"
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Сайт ${PRODUCT_NAME}.lnk" "http://www.gomlab.com/"
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Русский сайт ${PRODUCT_NAME}.lnk" "http://gom.ucoz.ru/"
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Удалить ${PRODUCT_NAME}.lnk" "$INSTDIR\uninst.exe"
SectionEnd
Section "На рабочем столе"
SectionIn 1
IfSilent +3
SetShellVarContext all
CreateShortCut "$DESKTOP\${PRODUCT_NAME}.lnk" "$INSTDIR\GOM.exe"
SectionEnd
Section "В панели быстрого запуска"
SectionIn 1
IfSilent +3
SetShellVarContext all
CreateShortCut "$QUICKLAUNCH\${PRODUCT_NAME}.lnk" "$INSTDIR\GOM.exe"
SectionEnd
SectionGroupEnd
;=========================================================================================================================
SectionGroup /e "Ассоциации файлов"
Section "gom"
SectionIn 1 2 3
!insertmacro RegisterExtension "gom"
SectionEnd
Section "avi"
SectionIn 1 2 3
!insertmacro RegisterExtension "avi"
SectionEnd
Section "svi"
SectionIn 1 2 3
!insertmacro RegisterExtension "svi"
SectionEnd
Section "divx"
SectionIn 1 2 3
!insertmacro RegisterExtension "divx"
SectionEnd
Section "asx"
SectionIn 1 2 3
!insertmacro RegisterExtension "asx"
SectionEnd
Section "asf"
SectionIn 1 2 3
!insertmacro RegisterExtension "asf"
SectionEnd
Section "wmx"
SectionIn 1 2 3
!insertmacro RegisterExtension "wmx"
SectionEnd
Section "wmv"
SectionIn 1 2 3
!insertmacro RegisterExtension "wmv"
SectionEnd
Section "wvx"
SectionIn 1 2 3
!insertmacro RegisterExtension "wvx"
SectionEnd
Section "wm"
SectionIn 1 2 3
!insertmacro RegisterExtension "wm"
SectionEnd
Section "wmp"
SectionIn 1 2 3
!insertmacro RegisterExtension "wmp"
SectionEnd
Section "mpg"
SectionIn 1 2 3
!insertmacro RegisterExtension "mpg"
SectionEnd
Section "mpe"
SectionIn 1 2 3
!insertmacro RegisterExtension "mpe"
SectionEnd
Section "mpeg"
SectionIn 1 2 3
!insertmacro RegisterExtension "mpeg"
SectionEnd
Section "dat"
SectionIn 1 2 3
!insertmacro RegisterExtension "dat"
SectionEnd
Section "ifo"
SectionIn 1 2 3
!insertmacro RegisterExtension "ifo"
SectionEnd
Section "vob"
SectionIn 1 2 3
!insertmacro RegisterExtension "vob"
SectionEnd
Section "m1v"
SectionIn 1 2 3
!insertmacro RegisterExtension "m1v"
SectionEnd
Section "m2v"
SectionIn 1 2 3
!insertmacro RegisterExtension "m2v"
SectionEnd
Section "tp"
SectionIn 1 2 3
!insertmacro RegisterExtension "tp"
SectionEnd
Section "ts"
SectionIn 1 2 3
!insertmacro RegisterExtension "ts"
SectionEnd
Section "trp"
SectionIn 1 2 3
!insertmacro RegisterExtension "trp"
SectionEnd
Section "dmb"
SectionIn 1 2 3
!insertmacro RegisterExtension "dmb"
SectionEnd
Section "mp4"
SectionIn 1 2 3
!insertmacro RegisterExtension "mp4"
SectionEnd
Section "m4v"
SectionIn 1 2 3
!insertmacro RegisterExtension "m4v"
SectionEnd
Section "k3g"
SectionIn 1 2 3
!insertmacro RegisterExtension "k3g"
SectionEnd
Section "3gp"
SectionIn 1 2 3
!insertmacro RegisterExtension "3gp"
SectionEnd
Section "skm"
SectionIn 1 2 3
!insertmacro RegisterExtension "skm"
SectionEnd
Section "dmskm"
SectionIn 1 2 3
!insertmacro RegisterExtension "dmskm"
SectionEnd
Section "lmp4"
SectionIn 1 2 3
!insertmacro RegisterExtension "lmp4"
SectionEnd
Section "rm"
SectionIn 1 2 3
!insertmacro RegisterExtension "rm"
SectionEnd
Section "rmvb"
SectionIn 1 2 3
!insertmacro RegisterExtension "rmvb"
SectionEnd
Section "mkv"
SectionIn 1 2 3
!insertmacro RegisterExtension "mkv"
SectionEnd
Section "ogm"
SectionIn 1 2 3
!insertmacro RegisterExtension "ogm"
SectionEnd
Section "swf"
SectionIn 1 2 3
!insertmacro RegisterExtension "swf"
SectionEnd
Section "flv"
SectionIn 1 2 3
!insertmacro RegisterExtension "flv"
SectionEnd
Section "mqv"
SectionIn 1 2 3
!insertmacro RegisterExtension "mqv"
SectionEnd
Section "mov"
SectionIn 1 2 3
!insertmacro RegisterExtension "mov"
SectionEnd
SectionGroupEnd
;=========================================================================================================================
Section "-PostinstallProfileProcessing"
SectionIn 1 2 3
${RefreshShellIcons}
ExecWait "$INSTDIR\KillGom.exe GOM.exe"
ExecWait "$INSTDIR\ShellRegister.exe"
RegDLL "$INSTDIR\GomWeb3.dll"
RegDLL "$INSTDIR\gomx.dll"
RegDLL "$INSTDIR\VSUtil.dll"
RegDLL "$INSTDIR\GAF.ax"
RegDLL "$INSTDIR\GNF.ax"
RegDLL "$INSTDIR\GSFU.ax"
RegDLL "$INSTDIR\GVF.ax"
ExecWait "$INSTDIR\GOM.exe /RegServer"
ExecWait "$INSTDIR\GOM.exe /regassocdef"
ExecWait "$INSTDIR\GOM.exe /regassoc"
SectionEnd
Section Uninstall
ExecWait "$INSTDIR\KillGom.exe GOM.exe"
UnRegDLL "$INSTDIR\GomWeb3.dll"
UnRegDLL "$INSTDIR\gomx.dll"
UnRegDLL "$INSTDIR\VSUtil.dll"
UnRegDLL "$INSTDIR\GAF.ax"
UnRegDLL "$INSTDIR\GNF.ax"
UnRegDLL "$INSTDIR\GSFU.ax"
UnRegDLL "$INSTDIR\GVF.ax"
ExecWait "$INSTDIR\GOM.exe /UnRegServer"
ExecWait "$INSTDIR\GOM.exe /unregassoc"
DeleteRegKey HKCU "Software\Gretech\Gomplayer"
DeleteRegKey HKLM "Software\Gretech\Gomplayer"
SetShellVarContext all
Delete "$QUICKLAUNCH\${PRODUCT_NAME}.lnk"
Delete "$DESKTOP\${PRODUCT_NAME}.lnk"
RMDir /r "$SMPROGRAMS\${PRODUCT_NAME}"
RMDir /r "$INSTDIR"
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
SectionEnd
Сборка версии 2.1.9.3754, русифицирована и укомплетована РУССКИМИ скинами(aqua.gps, Inspirat 11.gps, moviework.gps, Office2000.gps, Wmp-Gom_0.6.gps, zoomplayer.gps):
Ссылка 1 Ссылка 2 Ссылка 3
Проверялось: Windows XP sp3 x86. Теоретически работает во всех NT6.x при запуске исталятора с повышенными привелегиями.