]> granicus.if.org Git - libx264/commitdiff
vfw installer nsis script.
authorLoren Merritt <pengvado@videolan.org>
Sat, 11 Jun 2005 19:15:35 +0000 (19:15 +0000)
committerLoren Merritt <pengvado@videolan.org>
Sat, 11 Jun 2005 19:15:35 +0000 (19:15 +0000)
patch by Francesco Corriga.

git-svn-id: svn://svn.videolan.org/x264/trunk@257 df754926-b1dd-0310-bc7b-ec298dee348c

vfw/build/cygwin/Makefile
vfw/driverproc.def
vfw/installer/win.bmp [new file with mode: 0644]
vfw/installer/x264-conf.nsi [new file with mode: 0644]
vfw/installer/x264vfw.ico [new file with mode: 0644]

index 3119314092ba1b7b8edbf41a9b6e471c717706ab..719f2f4b2ec2eb98c7eb0f89cef6a3a0301c2c44 100644 (file)
@@ -16,6 +16,9 @@ include config.mak
 # Dll to build
 DLL=x264vfw.dll
 
+# Installer executable
+INST_EXE=x264vfw.exe
+
 # Current dir
 DIR_CUR=$(shell pwd)
 
@@ -112,3 +115,13 @@ uninstall:
        @rundll32.exe setupapi,InstallHinfSection Remove_x264 132 $(DIR_CUR)/x264vfw.inf
        @rm x264vfw.inf
 
+##############################################################################
+# Builds the NSIS installer script for Windows.
+# NSIS 2.x is required and makensis.exe should be in the path
+##############################################################################
+
+build-installer: $(DLL)
+       @cp $(DIR_BUILD)/$(DLL) $(DIR_SRC)/installer
+       @makensis $(DIR_SRC)/installer/x264-conf.nsi
+       @mv $(DIR_SRC)/installer/$(INST_EXE) $(DIR_BUILD)
+       @rm $(DIR_SRC)/installer/$(DLL)
index 422cb29f63ddc5733a968dc0461297e038c36040..9fd6676bf74b41d25a86823370d98e9c0fe482c6 100644 (file)
@@ -4,5 +4,5 @@ DESCRIPTION  'X264 H.264/AVC Video Codec'
 
 EXPORTS
        DriverProc
-       ;Configure
+       Configure
 
diff --git a/vfw/installer/win.bmp b/vfw/installer/win.bmp
new file mode 100644 (file)
index 0000000..5524eef
Binary files /dev/null and b/vfw/installer/win.bmp differ
diff --git a/vfw/installer/x264-conf.nsi b/vfw/installer/x264-conf.nsi
new file mode 100644 (file)
index 0000000..55d6eab
--- /dev/null
@@ -0,0 +1,114 @@
+; !packhdr "x264.dat" "upx.exe --best x264.dat"
+; ---------------------------------------------------------------------------
+; ---------------------------------------------------------------------------
+
+!define NAME "x264 H.264/AVC Video Codec"
+!define OUTFILE "x264vfw.exe"
+!define INPUT_PATH ""
+!define VFW_FILE1 "x264vfw.dll"
+!define VFW_FILE2 "x264vfw.ico"
+!define UNINST_NAME "x264-uninstall.exe"
+!define MUI_WELCOMEFINISHPAGE_BITMAP win.bmp
+!define MUI_UNWELCOMEFINISHPAGE_BITMAP win.bmp
+!define MUI_COMPONENTSPAGE_SMALLDESC
+!include "MUI.nsh"
+!include "Sections.nsh"
+!include "LogicLib.nsh"
+
+; ---------------------------------------------------------------------------
+; NOTE: this .NSI script is designed for NSIS v1.8+
+; ---------------------------------------------------------------------------
+
+Name "${NAME}"
+OutFile "${OUTFILE}"
+SetCompressor lzma
+
+SetOverwrite ifnewer
+SetDatablockOptimize on ; (can be off)
+CRCCheck on ; (can be off)
+AutoCloseWindow false ; (can be true for the window go away automatically at end)
+ShowInstDetails hide ; (can be show to have them shown, or nevershow to disable)
+SetDateSave off ; (can be on to have files restored to their orginal date)
+
+!insertmacro MUI_PAGE_WELCOME
+!insertmacro MUI_PAGE_INSTFILES
+
+!insertmacro MUI_UNPAGE_CONFIRM
+!insertmacro MUI_UNPAGE_INSTFILES
+!insertmacro MUI_UNPAGE_FINISH
+!insertmacro MUI_LANGUAGE "English"
+
+; ---------------------------------------------------------------------------
+
+;Section ""
+;  MessageBox MB_YESNO "This will install ${NAME}. Do you wish to continue?" IDYES gogogo
+;    Abort
+;  gogogo:
+;SectionEnd
+
+Section "-hidden section"
+;Section "" ; (default section)
+       SetOutPath "$SYSDIR"
+       ; add files / whatever that need to be installed here.
+       File "${INPUT_PATH}${VFW_FILE1}"
+       File "${INPUT_PATH}${VFW_FILE2}"
+
+       CreateDirectory $SMPROGRAMS\x264
+       CreateShortcut "$SMPROGRAMS\x264\x264 configuration.lnk" $SYSDIR\rundll32.exe x264vfw.dll,Configure x264vfw.ico
+       CreateShortcut "$SMPROGRAMS\x264\x264 Uninstall.lnk" $SYSDIR\x264-uninstall.exe
+
+       ; write out uninstaller
+       WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" "DisplayName" "${NAME} (remove only)"
+       WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" "UninstallString" '"$SYSDIR\${UNINST_NAME}"'
+       WriteUninstaller "$SYSDIR\${UNINST_NAME}"
+
+       DeleteRegKey HKCU "Software\GNU\x264"
+
+       WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows NT\CurrentVersion\Drivers32" "vidc.X264" "x264vfw.dll"
+       WriteINIStr system.ini drivers32 "vidc.X264" "x264vfw.dll"
+       WriteRegStr HKEY_LOCAL_MACHINE "SYSTEM\CurrentControlSet\Control\MediaResources\icm\vidc.X264" "Description" "x264 H.264 Video Codec"
+       WriteRegStr HKEY_LOCAL_MACHINE "SYSTEM\CurrentControlSet\Control\MediaResources\icm\vidc.X264" "Driver" "x264vfw.dll"
+       WriteRegStr HKEY_LOCAL_MACHINE "SYSTEM\CurrentControlSet\Control\MediaResources\icm\vidc.X264" "FriendlyName" "x264"
+
+
+
+SectionEnd ; end of default section
+
+  
+
+; ---------------------------------------------------------------------------
+
+; begin uninstall settings/section
+UninstallText "This will uninstall ${NAME} from your system"
+
+Section Uninstall
+       
+       ; add delete commands to delete whatever files/registry keys/etc you installed here.
+       Delete /REBOOTOK "$SYSDIR\${VFW_FILE1}"
+       Delete /REBOOTOK "$SYSDIR\${VFW_FILE2}"
+       Delete "$SYSDIR\${UNINST_NAME}"
+   
+       DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}"
+       DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows NT\CurrentVersion\Drivers32\vidc.X264"
+       DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Drivers32\vidc.X264"
+       DeleteRegKey HKEY_LOCAL_MACHINE "SYSTEM\CurrentControlSet\Control\MediaResources\icm\vidc.X264"
+       DeleteINIStr system.ini drivers32 "vidc.X264"
+       Delete "$SMPROGRAMS\x264\x264 configuration.lnk"
+       Delete "$SMPROGRAMS\x264\x264 Uninstall.lnk"
+       RMDir  "$SMPROGRAMS\x264"
+
+
+SectionEnd ; end of uninstall section
+
+; ---------------------------------------------------------------------------
+
+Function un.onUninstSuccess
+       IfRebootFlag 0 NoReboot
+               MessageBox MB_OK \ 
+                       "A file couldn't be deleted. It will be deleted at next reboot."
+       NoReboot:
+FunctionEnd
+
+; ---------------------------------------------------------------------------
+; eof
+; ---------------------------------------------------------------------------
diff --git a/vfw/installer/x264vfw.ico b/vfw/installer/x264vfw.ico
new file mode 100644 (file)
index 0000000..f273377
Binary files /dev/null and b/vfw/installer/x264vfw.ico differ