x264-conf.nsi
上传用户:hjq518
上传日期:2021-12-09
资源大小:5084k
文件大小:4k
源码类别:

Audio

开发平台:

Visual C++

  1. ; !packhdr "x264.dat" "upx.exe --best x264.dat"
  2. ; ---------------------------------------------------------------------------
  3. ; ---------------------------------------------------------------------------
  4. !define NAME "x264 H.264/AVC Video Codec"
  5. !define OUTFILE "x264vfw.exe"
  6. !define INPUT_PATH ""
  7. !define VFW_FILE1 "x264vfw.dll"
  8. !define VFW_FILE2 "x264vfw.ico"
  9. !define UNINST_NAME "x264-uninstall.exe"
  10. !define MUI_WELCOMEFINISHPAGE_BITMAP win.bmp
  11. !define MUI_UNWELCOMEFINISHPAGE_BITMAP win.bmp
  12. !define MUI_COMPONENTSPAGE_SMALLDESC
  13. !include "MUI.nsh"
  14. !include "Sections.nsh"
  15. !include "LogicLib.nsh"
  16. ; ---------------------------------------------------------------------------
  17. ; NOTE: this .NSI script is designed for NSIS v1.8+
  18. ; ---------------------------------------------------------------------------
  19. Name "${NAME}"
  20. OutFile "${OUTFILE}"
  21. SetCompressor lzma
  22. SetOverwrite ifnewer
  23. SetDatablockOptimize on ; (can be off)
  24. CRCCheck on ; (can be off)
  25. AutoCloseWindow false ; (can be true for the window go away automatically at end)
  26. ShowInstDetails hide ; (can be show to have them shown, or nevershow to disable)
  27. SetDateSave off ; (can be on to have files restored to their orginal date)
  28. !insertmacro MUI_PAGE_WELCOME
  29. !insertmacro MUI_PAGE_INSTFILES
  30. !insertmacro MUI_UNPAGE_CONFIRM
  31. !insertmacro MUI_UNPAGE_INSTFILES
  32. !insertmacro MUI_UNPAGE_FINISH
  33. !insertmacro MUI_LANGUAGE "English"
  34. ; ---------------------------------------------------------------------------
  35. ;Section ""
  36. ;  MessageBox MB_YESNO "This will install ${NAME}. Do you wish to continue?" IDYES gogogo
  37. ;    Abort
  38. ;  gogogo:
  39. ;SectionEnd
  40. Section "-hidden section"
  41. ;Section "" ; (default section)
  42. SetOutPath "$SYSDIR"
  43. ; add files / whatever that need to be installed here.
  44. File "${INPUT_PATH}${VFW_FILE1}"
  45. File "${INPUT_PATH}${VFW_FILE2}"
  46. CreateDirectory $SMPROGRAMSx264
  47.    CreateShortcut "$SMPROGRAMSx264x264 configuration.lnk" $SYSDIRrundll32.exe x264vfw.dll,Configure x264vfw.ico
  48. CreateShortcut "$SMPROGRAMSx264x264 Uninstall.lnk" $SYSDIRx264-uninstall.exe
  49. ; write out uninstaller
  50. WriteRegStr HKEY_LOCAL_MACHINE "SoftwareMicrosoftWindowsCurrentVersionUninstall${NAME}" "DisplayName" "${NAME} (remove only)"
  51. WriteRegStr HKEY_LOCAL_MACHINE "SoftwareMicrosoftWindowsCurrentVersionUninstall${NAME}" "UninstallString" '"$SYSDIR${UNINST_NAME}"'
  52. WriteUninstaller "$SYSDIR${UNINST_NAME}"
  53. DeleteRegKey HKCU "SoftwareGNUx264"
  54. WriteRegStr HKEY_LOCAL_MACHINE "SoftwareMicrosoftWindows NTCurrentVersionDrivers32" "vidc.X264" "x264vfw.dll"
  55. WriteINIStr system.ini drivers32 "vidc.X264" "x264vfw.dll"
  56. WriteRegStr HKEY_LOCAL_MACHINE "SYSTEMCurrentControlSetControlMediaResourcesicmvidc.X264" "Description" "x264 H.264 Video Codec"
  57. WriteRegStr HKEY_LOCAL_MACHINE "SYSTEMCurrentControlSetControlMediaResourcesicmvidc.X264" "Driver" "x264vfw.dll"
  58. WriteRegStr HKEY_LOCAL_MACHINE "SYSTEMCurrentControlSetControlMediaResourcesicmvidc.X264" "FriendlyName" "x264"
  59. SectionEnd ; end of default section
  60.   
  61. ; ---------------------------------------------------------------------------
  62. ; begin uninstall settings/section
  63. UninstallText "This will uninstall ${NAME} from your system"
  64. Section Uninstall
  65. ; add delete commands to delete whatever files/registry keys/etc you installed here.
  66. Delete /REBOOTOK "$SYSDIR${VFW_FILE1}"
  67. Delete /REBOOTOK "$SYSDIR${VFW_FILE2}"
  68. Delete "$SYSDIR${UNINST_NAME}"
  69.    
  70. DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWAREMicrosoftWindowsCurrentVersionUninstall${NAME}"
  71. DeleteRegKey HKEY_LOCAL_MACHINE "SoftwareMicrosoftWindows NTCurrentVersionDrivers32vidc.X264"
  72. DeleteRegKey HKEY_LOCAL_MACHINE "SoftwareMicrosoftWindowsCurrentVersionDrivers32vidc.X264"
  73. DeleteRegKey HKEY_LOCAL_MACHINE "SYSTEMCurrentControlSetControlMediaResourcesicmvidc.X264"
  74. DeleteINIStr system.ini drivers32 "vidc.X264"
  75.   Delete "$SMPROGRAMSx264x264 configuration.lnk"
  76.    Delete "$SMPROGRAMSx264x264 Uninstall.lnk"
  77. RMDir  "$SMPROGRAMSx264"
  78. SectionEnd ; end of uninstall section
  79. ; ---------------------------------------------------------------------------
  80. Function un.onUninstSuccess
  81. IfRebootFlag 0 NoReboot
  82. MessageBox MB_OK  
  83. "A file couldn't be deleted. It will be deleted at next reboot."
  84. NoReboot:
  85. FunctionEnd
  86. ; ---------------------------------------------------------------------------
  87. ; eof
  88. ; ---------------------------------------------------------------------------