Commit de96e9ec authored by Gildas Bazin's avatar Gildas Bazin

* vlc.win32.nsi: brand new NSIS auto-installer script.

* Makefile.am: use vlc icon in the NSIS installer.
parent b9e6db04
...@@ -21,13 +21,13 @@ EXTRA_DIST = \ ...@@ -21,13 +21,13 @@ EXTRA_DIST = \
MAINTAINERS \ MAINTAINERS \
README.MacOSX.rtf \ README.MacOSX.rtf \
bootstrap \ bootstrap \
install-win32 \
src/extras/COPYING \ src/extras/COPYING \
toolbox \ toolbox \
vlc-config.in.in \ vlc-config.in.in \
vlc.ebuild \ vlc.ebuild \
vlc.spec \ vlc.spec \
vlc.spec.mdk \ vlc.spec.mdk \
vlc.win32.nsi \
$(NULL) $(NULL)
BUILT_SOURCES = BUILT_SOURCES =
...@@ -566,19 +566,19 @@ remove_distdir_woody = \ ...@@ -566,19 +566,19 @@ remove_distdir_woody = \
# XXX: this rule is probably only useful to you if you have exactly # XXX: this rule is probably only useful to you if you have exactly
# the same setup as me. Contact sam@zoy.org if you need to use it. # the same setup as me. Contact sam@zoy.org if you need to use it.
# #
# Check that tmp isn't in the way
package-win32-base: package-win32-base:
# Check that tmp isn't in the way
@if test -e "$(srcdir)/vlc-${VERSION}"; then \ @if test -e "$(srcdir)/vlc-${VERSION}"; then \
echo "Error: please remove $(srcdir)/vlc-${VERSION}, it is in the way"; \ echo "Error: please remove $(srcdir)/vlc-${VERSION}, it is in the way"; \
false; \ false; \
else \ else \
echo "OK."; mkdir -p "$(srcdir)/vlc-${VERSION}"; \ echo "OK."; mkdir -p "$(srcdir)/vlc-${VERSION}"; \
fi fi
# Create installation script
cp "$(srcdir)/install-win32" "$(srcdir)/vlc-${VERSION}/nsi"
# Copy relevant files # Copy relevant files
cp "$(srcdir)/vlc.win32.nsi" "$(srcdir)/vlc-${VERSION}/"
cp "$(top_builddir)/vlc$(EXEEXT)" "$(srcdir)/vlc-${VERSION}/" cp "$(top_builddir)/vlc$(EXEEXT)" "$(srcdir)/vlc-${VERSION}/"
cp "$(top_builddir)/vlc$(EXEEXT).manifest" "$(srcdir)/vlc-${VERSION}/" cp "$(top_builddir)/vlc.exe.manifest" "$(srcdir)/vlc-${VERSION}/"
$(STRIP) "$(srcdir)/vlc-${VERSION}/vlc$(EXEEXT)" $(STRIP) "$(srcdir)/vlc-${VERSION}/vlc$(EXEEXT)"
@if test -n "$(UPX)"; then \ @if test -n "$(UPX)"; then \
$(UPX) -9 "$(srcdir)/vlc-${VERSION}/vlc$(EXEEXT)"; fi ; $(UPX) -9 "$(srcdir)/vlc-${VERSION}/vlc$(EXEEXT)"; fi ;
...@@ -637,6 +637,8 @@ package-win32-base: ...@@ -637,6 +637,8 @@ package-win32-base:
cp $(srcdir)/share/http/vlm/*.html \ cp $(srcdir)/share/http/vlm/*.html \
$(srcdir)/vlc-${VERSION}/http/vlm/ ; $(srcdir)/vlc-${VERSION}/http/vlm/ ;
cp $(srcdir)/share/vlc48x48.ico $(srcdir)/vlc-${VERSION}/ ;
mkdir -p "$(srcdir)/vlc-${VERSION}/mozilla" mkdir -p "$(srcdir)/vlc-${VERSION}/mozilla"
if BUILD_MOZILLA if BUILD_MOZILLA
cp $(srcdir)/mozilla/*$(LIBEXT) $(srcdir)/vlc-${VERSION}/mozilla/ ; cp $(srcdir)/mozilla/*$(LIBEXT) $(srcdir)/vlc-${VERSION}/mozilla/ ;
...@@ -649,7 +651,7 @@ endif ...@@ -649,7 +651,7 @@ endif
package-win32-base-exe: package-win32-base-exe:
# Create package # Create package
wine ~/.wine/fake_windows/Program\ Files/NSIS/makensis.exe \ wine ~/.wine/fake_windows/Program\ Files/NSIS/makensis.exe \
-- /DVERSION=${VERSION} $(srcdir)/vlc-${VERSION}/nsi -- /DVERSION=${VERSION} $(srcdir)/vlc-${VERSION}/vlc.win32.nsi
package-win32-base-zip: package-win32-base-zip:
# Create package # Create package
......
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; NSIS installer script for vlc ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;
; CHANGELOG ;
;;;;;;;;;;;;;
; modifications by Gildas Bazin <gbazin@netcourrier.com> 6 Jul 2003
; . Start menu shortcuts now created in the "All Users" section.
; modifications by Gildas Bazin <gbazin@netcourrier.com> 6 Apr 2003
; . added shortcut to the skins interface, added the default skin.
; modifications by Gildas Bazin <gbazin@netcourrier.com> 26 Feb 2003
; . added the locale directory.
; modifications by Samuel Hocevar <sam@zoy.org> 05 Apr 2002
; . no need for @VERSION@ anymore
; . updated script for NSIS 1.96.
; modifications by Samuel Hocevar <sam@zoy.org> 12 Nov 2001
; . removed version information.
; written by Pierre Baillet <oct@zoy.org> 29 Jul 2001 v0.2
; . lists all installed files so as to prevent installer.nsi to be included
; in the release.
; . really remove the shortcuts.
; . added an exec command to display the program file folder. (grOovy)
;;;;;;;;;;;;;;;;;;;;;;;;;
; General configuration ;
;;;;;;;;;;;;;;;;;;;;;;;;;
OutFile ..\vlc-${VERSION}-win32.exe
SetCompressor bzip2
Name "VLC media player"
Caption "VLC '${VERSION}' for Win32 Setup"
;Icon ../share/gvlc32x32.ico
CRCCheck on
InstallDir "$PROGRAMFILES\VideoLAN\VLC"
; check if the program has already been installed, if so, take this dir
; as install dir
InstallDirRegKey HKLM SOFTWARE\VideoLAN\VLC "Install_Dir"
DirText "Choose a directory to install in to:"
AutoCloseWindow false
ShowInstDetails show
SetOverwrite ifnewer
SetDatablockOptimize on
SetDateSave off
SetCompress auto
UninstallText "This will uninstall the VLC media player."
;;;;;;;;;;;;;;;;;;;;
; Install settings ;
;;;;;;;;;;;;;;;;;;;;
Section "Install"
SetOutPath $INSTDIR
File vlc.exe
File vlc.exe.manifest
File *.txt
File /r plugins
File /r locale
File /r skins
File /r skins2
File /r http
File /r mozilla
SetShellVarContext all
CreateDirectory "$SMPROGRAMS\VideoLAN"
CreateShortCut "$SMPROGRAMS\VideoLAN\vlc.lnk" \
"$INSTDIR\vlc.exe" "--intf wxwin"
CreateShortCut "$SMPROGRAMS\VideoLAN\vlc (skins).lnk" \
"$INSTDIR\vlc.exe" "--intf skins"
WriteRegStr HKLM \
SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\VideoLAN \
"DisplayName" "VideoLAN VLC media player ${VERSION}"
WriteRegStr HKLM \
SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\VideoLAN \
"UninstallString" '"$INSTDIR\uninstall.exe"'
WriteUninstaller "uninstall.exe"
WriteRegStr HKLM SOFTWARE\VideoLAN\VLC "InstallDir" $INSTDIR
WriteRegStr HKLM SOFTWARE\VideoLAN\VLC "Version" "${VERSION}"
WriteRegStr HKLM \
SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION} \
"Path" '"$INSTDIR\mozilla\npvlc.dll"'
Exec "explorer $SMPROGRAMS\VideoLAN\"
SectionEnd
;;;;;;;;;;;;;;;;;;;;;;
; Uninstall settings ;
;;;;;;;;;;;;;;;;;;;;;;
Section "Uninstall"
SetShellVarContext all
RMDir /r $SMPROGRAMS\VideoLAN
RMDir /r $INSTDIR
DeleteRegKey HKLM SOFTWARE\VideoLAN
DeleteRegKey HKLM \
SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}
DeleteRegKey HKLM \
Software\Microsoft\Windows\CurrentVersion\Uninstall\VideoLAN
SectionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; NSIS installer script for vlc ;
; (http://nsis.sourceforge.net) ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
!define PRODUCT_NAME "VLC media player"
!define PRODUCT_VERSION '${VERSION}'
!define PRODUCT_GROUP "VideoLAN"
!define PRODUCT_PUBLISHER "VideoLAN Team"
!define PRODUCT_WEB_SITE "http://www.videolan.org"
!define PRODUCT_DIR_REGKEY "Software\VideoLAN\VLC"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; NSIS Modern User Interface configuration ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; MUI 1.67 compatible ------
!include "MUI.nsh"
; MUI Settings
!define MUI_ABORTWARNING
!define MUI_ICON "vlc48x48.ico"
!define MUI_UNICON "vlc48x48.ico"
!define MUI_COMPONENTSPAGE_SMALLDESC
; Welcome page
!insertmacro MUI_PAGE_WELCOME
; License page
!insertmacro MUI_PAGE_LICENSE "COPYING.txt"
; Components page
!insertmacro MUI_PAGE_COMPONENTS
; Directory page
!insertmacro MUI_PAGE_DIRECTORY
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!define MUI_FINISHPAGE_RUN "$INSTDIR\vlc.exe"
!insertmacro MUI_PAGE_FINISH
; Uninstaller pages
!insertmacro MUI_UNPAGE_INSTFILES
; Language files
!insertmacro MUI_LANGUAGE "English"
; Reserve files
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
; MUI end ------
;;;;;;;;;;;;;;;;;;;;;;;;;;
; File type associations ;
;;;;;;;;;;;;;;;;;;;;;;;;;;
Function RegisterExtension
; back up old value for extension $R0 (eg. ".opt")
ReadRegStr $1 HKCR "$R0" ""
StrCmp $1 "" NoBackup
StrCmp $1 "VLC$R0" "NoBackup"
WriteRegStr HKCR "$R0" "VLC.backup" $1
NoBackup:
WriteRegStr HKCR "$R0" "" "VLC$R0"
ReadRegStr $0 HKCR "VLC$R0" ""
WriteRegStr HKCR "VLC$R0" "" "VLC media file"
WriteRegStr HKCR "VLC$R0\shell" "" "Play"
WriteRegStr HKCR "VLC$R0\shell\Play\command" "" '$INSTDIR\vlc.exe "%1"'
WriteRegStr HKCR "VLC$R0\DefaultIcon" "" "$INSTDIR\vlc.exe,0"
FunctionEnd
Function un.RegisterExtension
;start of restore script
ReadRegStr $1 HKCR "$R0" ""
StrCmp $1 "VLC$R0" 0 NoOwn ; only do this if we own it
ReadRegStr $1 HKCR "$R0" "VLC.backup"
StrCmp $1 "" 0 Restore ; if backup="" then delete the whole key
DeleteRegKey HKCR "$R0"
Goto NoOwn
Restore:
WriteRegStr HKCR "$R0" "" $1
DeleteRegValue HKCR "$R0" "VLC.backup"
NoOwn:
DeleteRegKey HKCR "VLC$R0" ;Delete key with association settings
FunctionEnd
!macro RegisterExtensionSection EXT
Section /o ${EXT}
Push $R0
StrCpy $R0 ${EXT}
Call RegisterExtension
Pop $R0
SectionEnd
!macroend
!macro UnRegisterExtensionSection EXT
Push $R0
StrCpy $R0 ${EXT}
Call un.RegisterExtension
Pop $R0
!macroend
;;;;;;;;;;;;;;;;;;;;;;;;;
; General configuration ;
;;;;;;;;;;;;;;;;;;;;;;;;;
Name "${PRODUCT_GROUP} ${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile ..\vlc-${VERSION}-win32.exe
InstallDir "$PROGRAMFILES\VideoLAN\VLC"
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" "Install_Dir"
SetCompressor lzma
ShowInstDetails show
ShowUnInstDetails show
SetOverwrite ifnewer
CRCCheck on
InstType "Normal"
InstType "Full"
Section "Media player (required)" SEC01
SectionIn 1 2 3 RO
SetShellVarContext all
SetOutPath "$INSTDIR"
File vlc.exe
File vlc.exe.manifest
File *.txt
File /r plugins
File /r locale
File /r skins
File /r skins2
File /r http
WriteRegStr HKCR Applications\vlc.exe "" ""
WriteRegStr HKCR Applications\vlc.exe\shell "" "Play"
WriteRegStr HKCR Applications\vlc.exe\shell\Play\command "" \
'$INSTDIR\vlc.exe "%1"'
SectionEnd
Section "Start Menu + Desktop Shortcut" SEC02
SectionIn 1 2 3
CreateDirectory "$SMPROGRAMS\VideoLAN"
CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player.lnk" \
"$INSTDIR\vlc.exe" "--intf wxwin"
CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player (skins).lnk" \
"$INSTDIR\vlc.exe" "--intf skins"
CreateShortCut "$DESKTOP\VLC media player.lnk" "$INSTDIR\vlc.exe"
WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" \
"${PRODUCT_WEB_SITE}"
CreateShortCut "$SMPROGRAMS\VideoLAN\Website.lnk" \
"$INSTDIR\${PRODUCT_NAME}.url"
SectionEnd
Section /o "Mozilla plugin" SEC03
SectionIn 2 3
File /r mozilla
WriteRegStr HKLM \
SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION} \
"Path" '"$INSTDIR\mozilla\npvlc.dll"'
SectionEnd
SubSection "File type associations" SEC04
; Make sure we have the same list in uninstall
!insertmacro RegisterExtensionSection ".a52"
!insertmacro RegisterExtensionSection ".aac"
!insertmacro RegisterExtensionSection ".ac3"
!insertmacro RegisterExtensionSection ".asf"
!insertmacro RegisterExtensionSection ".asx"
!insertmacro RegisterExtensionSection ".avi"
!insertmacro RegisterExtensionSection ".bin"
!insertmacro RegisterExtensionSection ".cue"
!insertmacro RegisterExtensionSection ".dat"
!insertmacro RegisterExtensionSection ".divx"
!insertmacro RegisterExtensionSection ".dts"
!insertmacro RegisterExtensionSection ".dv"
!insertmacro RegisterExtensionSection ".flac"
!insertmacro RegisterExtensionSection ".m1v"
!insertmacro RegisterExtensionSection ".m2v"
!insertmacro RegisterExtensionSection ".m3u"
!insertmacro RegisterExtensionSection ".mka"
!insertmacro RegisterExtensionSection ".mkv"
!insertmacro RegisterExtensionSection ".mov"
!insertmacro RegisterExtensionSection ".mp1"
!insertmacro RegisterExtensionSection ".mp2"
!insertmacro RegisterExtensionSection ".mp3"
!insertmacro RegisterExtensionSection ".mp4"
!insertmacro RegisterExtensionSection ".mpeg"
!insertmacro RegisterExtensionSection ".mpeg1"
!insertmacro RegisterExtensionSection ".mpeg2"
!insertmacro RegisterExtensionSection ".mpeg4"
!insertmacro RegisterExtensionSection ".mpg"
!insertmacro RegisterExtensionSection ".ogg"
!insertmacro RegisterExtensionSection ".ogm"
!insertmacro RegisterExtensionSection ".pls"
!insertmacro RegisterExtensionSection ".spx"
!insertmacro RegisterExtensionSection ".vob"
!insertmacro RegisterExtensionSection ".wav"
!insertmacro RegisterExtensionSection ".wma"
!insertmacro RegisterExtensionSection ".wmv"
SubSectionEnd
Section -Post
WriteUninstaller "$INSTDIR\uninstall.exe"
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "InstallDir" $INSTDIR
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "Version" "${VERSION}"
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\vlc.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
"DisplayName" "$(^Name)"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
"UninstallString" "$INSTDIR\uninstall.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
"DisplayIcon" "$INSTDIR\vlc.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
"DisplayVersion" "${PRODUCT_VERSION}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
"URLInfoAbout" "${PRODUCT_WEB_SITE}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
"Publisher" "${PRODUCT_PUBLISHER}"
SectionEnd
; Section descriptions
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SEC01} \
"The media player itself"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC02} \
"Adds icons to your start menu and your desktop for easy access"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC03} \
"The VLC mozilla plugin"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC04} \
"Sets VLC media player as the default application for the specified file type"
!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
FunctionEnd
Section Uninstall
SetShellVarContext all
; Make sure we have the same list in install
!insertmacro UnRegisterExtensionSection ".a52"
!insertmacro UnRegisterExtensionSection ".aac"
!insertmacro UnRegisterExtensionSection ".ac3"
!insertmacro UnRegisterExtensionSection ".asf"
!insertmacro UnRegisterExtensionSection ".asx"
!insertmacro UnRegisterExtensionSection ".avi"
!insertmacro UnRegisterExtensionSection ".bin"
!insertmacro UnRegisterExtensionSection ".cue"
!insertmacro UnRegisterExtensionSection ".dat"
!insertmacro UnRegisterExtensionSection ".divx"
!insertmacro UnRegisterExtensionSection ".dts"
!insertmacro UnRegisterExtensionSection ".dv"
!insertmacro UnRegisterExtensionSection ".flac"
!insertmacro UnRegisterExtensionSection ".m1v"
!insertmacro UnRegisterExtensionSection ".m2v"
!insertmacro UnRegisterExtensionSection ".m3u"
!insertmacro UnRegisterExtensionSection ".mka"
!insertmacro UnRegisterExtensionSection ".mkv"
!insertmacro UnRegisterExtensionSection ".mov"
!insertmacro UnRegisterExtensionSection ".mp1"
!insertmacro UnRegisterExtensionSection ".mp2"
!insertmacro UnRegisterExtensionSection ".mp3"
!insertmacro UnRegisterExtensionSection ".mp4"
!insertmacro UnRegisterExtensionSection ".mpeg"
!insertmacro UnRegisterExtensionSection ".mpeg1"
!insertmacro UnRegisterExtensionSection ".mpeg2"
!insertmacro UnRegisterExtensionSection ".mpeg4"
!insertmacro UnRegisterExtensionSection ".mpg"
!insertmacro UnRegisterExtensionSection ".ogg"
!insertmacro UnRegisterExtensionSection ".ogm"
!insertmacro UnRegisterExtensionSection ".pls"
!insertmacro UnRegisterExtensionSection ".spx"
!insertmacro UnRegisterExtensionSection ".vob"
!insertmacro UnRegisterExtensionSection ".wav"
!insertmacro UnRegisterExtensionSection ".wma"
!insertmacro UnRegisterExtensionSection ".wmv"
RMDir "$SMPROGRAMS\VideoLAN"
RMDir /r $SMPROGRAMS\VideoLAN
RMDir /r $INSTDIR
DeleteRegKey HKLM Software\VideoLAN
DeleteRegKey HKCR Applications\vlc.exe
DeleteRegKey HKLM \
SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}
DeleteRegKey HKLM \
Software\Microsoft\Windows\CurrentVersion\Uninstall\VideoLAN
Delete "$DESKTOP\VLC media player.lnk"
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
SetAutoClose true
SectionEnd
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment