bsplayer nsis
here is my nsis for last bsplayer. But shortcut are not created and associations dont work. do you know how to improve it
;NSIS SETUP SCRIPT FOR BSPLAYER by scarface:
!define PRODUCT_NAME "BSPlayer"
!define PRODUCT_VERSION "2.34.980"
!define PRODUCT_PUBLISHER "BST"
!define PRODUCT_WEB_SITE "http://www.bsplayer.org"
SetCompressor bzip2
!include "MUI.nsh"
!define MUI_ABORTWARNING
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\bplay-install.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\bplay-install.ico"
!define MUI_COMPONENTSPAGE_SMALLDESC
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
Name "Bsplayer"
Caption "Bsplayer 2.34 Setup"
OutFile "BSPlay_setup.exe"
InstallDir "$PROGRAMFILES\BSPlayer"
InstallDirRegKey HKCU "Software\bsplayer" "AppPath"
AutoCloseWindow false
ShowInstDetails hide
ShowUnInstDetails hide
Section "BSPlayer (required)" SEC01
SectionIn RO
SetOutPath "$INSTDIR"
SetOverwrite on
File "bsplayer.exe"
File "bsrendv2.dll"
File "bplay.exe"
SetOutPath "$INSTDIR\plugins\"
File "oldskin.dll"
SetOutPath "$INSTDIR\skins\"
File "BSplayer.bsz"
SetOutPath "$APPDATA\Bsplayer\"
File "BSplayer.xml"
SectionEnd
Section "Start Menu" SEC02
CreateShortCut "$SMPROGRAMS\BSPLAYER\BSPlayer.lnk" "$INSTDIR\bsplayer.exe"
CreateShortCut "$SMPROGRAMS\BSPLAYER\Uninst.lnk" "$INSTDIR\uninst.exe"
SectionEnd
Section "file associations (required)" SEC03
SectionIn RO
WriteUninstaller "$INSTDIR\uninst.exe"
UNRegDLL "$INSTDIR\bsrendv2.dll"
WriteRegStr HKLM "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".mpg" "BSPlayerFile.MPG"
WriteRegStr HKLM "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".mpe" "BSPlayerFile.MPE"
WriteRegStr HKLM "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".mpeg" "BSPlayerFile.MPEG"
WriteRegStr HKLM "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".asx" "BSPlayerFile.ASX"
WriteRegStr HKLM "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".avi" "BSPlayerFile.AVI"
WriteRegStr HKLM "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".asf" "BSPlayerFile.ASF"
WriteRegStr HKLM "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".vob" "BSPlayerFile.VOB"
WriteRegStr HKLM "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".mpg" "BSPlayerFile.MPG"
WriteRegStr HKLM "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".mp4" "BSPlayerFile.MP4"
WriteRegStr HKLM "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".flv" "BSPlayerFile.FLV"
WriteRegStr HKLM "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".ape" "BSPlayerFile.APE"
WriteRegStr HKLM "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".flac" "BSPlayerFile.FLAC"
WriteRegStr HKLM "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".m3u" "BSPlayerFile.M3U"
WriteRegStr HKLM "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".m2v" "BSPlayerFile.M2V"
WriteRegStr HKLM "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".m2ts" "BSPlayerFile.M2TS"
WriteRegStr HKLM "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".mkv" "BSPlayerFile.MKV"
WriteRegStr HKLM "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".divx" "BSPlayerFile.DIVX"
WriteRegStr HKLM "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".ogg" "BSPlayerFile.OGG"
WriteRegStr HKLM "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".ogm" "BSPlayerFile.OGM"
WriteRegStr HKLM "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".bsb" "BSPlayerFile.BSB"
WriteRegStr HKLM "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".pls" "BSPlayerFile.PLS"
WriteRegStr HKCR "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".mpg" "BSPlayerFile.MPG"
WriteRegStr HKCR "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".mpe" "BSPlayerFile.MPE"
WriteRegStr HKCR "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".mpeg" "BSPlayerFile.MPEG"
WriteRegStr HKCR "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".asx" "BSPlayerFile.ASX"
WriteRegStr HKCR "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".avi" "BSPlayerFile.AVI"
WriteRegStr HKCR "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".asf" "BSPlayerFile.ASF"
WriteRegStr HKCR "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".vob" "BSPlayerFile.VOB"
WriteRegStr HKCR "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".mpg" "BSPlayerFile.MPG"
WriteRegStr HKCR "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".mp4" "BSPlayerFile.MP4"
WriteRegStr HKCR "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".flv" "BSPlayerFile.FLV"
WriteRegStr HKCR "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".ape" "BSPlayerFile.APE"
WriteRegStr HKCR "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".flac" "BSPlayerFile.FLAC"
WriteRegStr HKCR "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".m3u" "BSPlayerFile.M3U"
WriteRegStr HKCR "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".m2v" "BSPlayerFile.M2V"
WriteRegStr HKCR "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".m2ts" "BSPlayerFile.M2TS"
WriteRegStr HKCR "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".mkv" "BSPlayerFile.MKV"
WriteRegStr HKCR "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".divx" "BSPlayerFile.DIVX"
WriteRegStr HKCR "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".ogg" "BSPlayerFile.OGG"
WriteRegStr HKCR "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".ogm" "BSPlayerFile.OGM"
WriteRegStr HKCR "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".bsb" "BSPlayerFile.BSB"
WriteRegStr HKCR "SOFTWARE\BSplayer\Capabilities\FileAssociatio ns" ".pls" "BSPlayerFile.PLS"
WriteRegStr HKCR ".avi" "" "BSPlayerFile.AVI"
WriteRegStr HKCR ".mpg" "" "BSPlayerFile.MPG"
WriteRegStr HKCR ".mkv" "" "BSPlayerFile.MPG"
WriteRegStr HKU HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Explorer\FileExts\.flv" "Application" "bsplayer.exe"
WriteRegStr HKLM "Software\RegisteredApplications" "BSPlayer" "SOFTWARE\BSplayer\Capabilities"
WriteRegStr HKCR "BSPlayerFile\DefaultIcon" "" '"$INSTDIR\BSplayer.exe",1'
WriteRegStr HKCR "BSPlayerFile\shell\enqueue" "" "Enqueue in BSplayer"
WriteRegStr HKCR "BSPlayerFile\shell\enqueue\command" "" '"$INSTDIR\BSplayer.exe" -add-to-playlist "%1"'
WriteRegStr HKCR "BSPlayerFile\shell\open" "FriendlyAppName" "BSplayer"
WriteRegStr HKCR "BSPlayerFile\shell\open\command" "" '"$INSTDIR\BSplayer.exe" "%1"'
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\bsplayer.exe" "" "$INSTDIR\bsplayer.exe"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninsta ll\${PRODUCT_NAME}" "DisplayName" "$(^Name)"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninsta ll\${PRODUCT_NAME}" "UninstallString" "$INSTDIR\uninst.exe"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninsta ll\${PRODUCT_NAME}" "DisplayIcon" "$INSTDIR\bplay.exe"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninsta ll\${PRODUCT_NAME}" "DisplayVersion" "${PRODUCT_VERSION}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninsta ll\${PRODUCT_NAME}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninsta ll\${PRODUCT_NAME}" "Publisher" "${PRODUCT_PUBLISHER}"
SectionEnd
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SEC01} "Install BSPlayer on your computer."
!insertmacro MUI_DESCRIPTION_TEXT ${SEC02} "Create Start Menu and Desktop Items."
!insertmacro MUI_FUNCTION_DESCRIPTION_END
Function un.onUninstSuccess
HideWindow
MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
FunctionEnd
Function un.onInit
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
Abort
Push $0
loop:
FindWindow $0 "BSPlayer"
IntCmp $0 0 done
SendMessage $0 16 0 0
Sleep 100
Goto loop
done:
Pop $0
FunctionEnd
Section Uninstall
UNRegDLL "$INSTDIR\bsrendv2.dll"
Delete "$INSTDIR\uninst.exe"
Delete "$INSTDIR\bplay.exe"
Delete "$INSTDIR\bsrendv2.dll"
Delete "$INSTDIR\bsplayer.exe"
Delete "$INSTDIR\plugins\oldskin.dll"
Delete "$INSTDIR\skins\BSplayer.bsz"
Delete "$SMPROGRAMS\Bsplayer\BSPlayer.lnk"
RMDir "$APPDATA\Bsplayer\"
RMDir "$INSTDIR\skins\"
RMDir "$INSTDIR"
DeleteRegKey HKCR "Applications\bsplayer.exe\"
DeleteRegKey HKCU "Software\BST\bsplayer\"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninsta ll\${PRODUCT_NAME}"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\bsplayer.exe"
SetAutoClose false
SectionEnd
Last edited by scarface; 22nd February 2009 at 07:15 AM.
|