杉宫竹苑工作室

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 1763|回复: 0

NSIS 暴风影音脚本

[复制链接]
发表于 2017-2-26 13:09:10 | 显示全部楼层 |阅读模式

正式会员享受无限制浏览网站功能和高速网盘下载,赶快加入本站吧!

您需要 登录 才可以下载或查看,没有账号?立即注册

x
  1. ;暴风影音2去广告补丁
  2. ;编写:寒星

  3. !define HAVE_UPX
  4. !ifdef HAVE_UPX
  5. !packhdr tmp.dat "upx -9 tmp.dat"
  6. !endif

  7. !define PRODUCT_NAME "暴风影音去广告补丁"
  8. !define PRODUCT_VERSION "v1.6版"
  9. !define PRODUCT_PUBLISHER "寒星工作室"
  10. !define PRODUCT_WEB_SITE "http://www.hxlive.cn"
  11. SetCompressor /solid lzma
  12. SetCompressorDictSize 32

  13. ;----------------基础信息--------------------------------------
  14. Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
  15. SetDatablockOptimize on
  16. outfile "Storm3 NoAD v1.6.exe"
  17. Caption  "暴风影音3去广告补丁 v1.6"
  18. BrandingText " 寒星工作室 ${__DATE__} "

  19. ;---------------------安装代码使用-------------------------------
  20. !include "MUI.nsh"
  21. !include "UsefulLib.nsh"
  22. !define MUI_ICON "Storm.ico"
  23. Page custom Storm2
  24. Page custom do
  25. !insertmacro MUI_LANGUAGE "SimpChinese"
  26. ChangeUI all default.exe
  27. MiscButtonText "" "执行" "" "完成"

  28. ;---------------------版本信息--------------------------------
  29. VIProductVersion "1.6.0.0314"
  30. VIAddVersionKey /LANG=${LANG_SimpChinese} "FileVersion" "1.6.0.0314"
  31. VIAddVersionKey /LANG=${LANG_SimpChinese} "ProductName" "${PRODUCT_NAME} ${PRODUCT_VERSION}"
  32. VIAddVersionKey /LANG=${LANG_SimpChinese} "Comments" "${PRODUCT_NAME}"
  33. VIAddVersionKey /LANG=${LANG_SimpChinese} "CompanyName" "寒星工作室"
  34. VIAddVersionKey /LANG=${LANG_SimpChinese} "LegalCopyright" "版权所有 (C) 寒星工作室"
  35. VIAddVersionKey /LANG=${LANG_SimpChinese} "FileDescription" "${PRODUCT_NAME} ${PRODUCT_VERSION}"
  36. ;---------------------------------------------------------

  37. Section
  38. SectionEnd

  39. ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll"
  40. ReserveFile "Storm216.ini"
  41. ReserveFile "TOP.bmp"

  42. Function Storm2
  43.   !addplugindir E:\安装制作\NSIS\Plugins
  44.    FindProcDLL::FindProc "Storm.exe"
  45.     StrCmp $R0 1 +3 +1
  46.    FindProcDLL::FindProc "Storm2.exe"
  47.     StrCmp $R0 1 +1 +4
  48.      MessageBox MB_ICONINFORMATION|MB_RETRYCANCEL "安装程序检测到 暴风影音 正在运行!请退出程序重试或取消本次安装!"   IDRetry retry IDCANCEL Cancel
  49.      Retry:
  50.       Goto -5
  51.      Cancel:
  52.       Quit
  53.       
  54.   InitPluginsDir
  55.    File /oname=$PLUGINSDIR\Storm216.ini "Storm216.ini"
  56.    File /oname=$PLUGINSDIR\top.bmp "top.bmp"
  57.    WriteINIStr "$PLUGINSDIR\Storm216.ini" "Field 1" "Text" $PLUGINSDIR\top.bmp
  58.    ReadRegStr $R1 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\storm2" "DisplayIcon"
  59.    StrCpy $R2 $R1 -9
  60.    WriteINIStr "$PLUGINSDIR\Storm216.ini" "Field 5" "State" $R2

  61.   InstallOptions::initDialog /NOUNLOAD "$PLUGINSDIR\Storm216.ini"
  62.   Pop $0
  63.   InstallOptions::show
  64.   Pop $0

  65. FunctionEnd


  66. Function Do
  67.   ReadINIStr $R3 "$PLUGINSDIR\Storm216.ini" "Field 5" "State"
  68.   IfFileExists "$R3\Storm.exe" +3 +1
  69.   MessageBox MB_ICONINFORMATION|MB_OK " 我很确定您没有安装暴风影音!点击 确定 后退出!"
  70.    Quit
  71.   SetOutPath "$R3\Media"
  72.    IfFileExists "$R3\stcon.ini" +1 +3
  73.     File /a stcon.ini
  74.     File /a video_style_list.xml
  75.   SetOutPath "$R3"
  76.    IfFileExists "$R3\Media2.dll" +1 +2
  77.     Delete "$R3\Media2.dll"
  78.     CreateDirectory "$R3\Media2.dll"

  79.   ReadINIStr $R4 "$PLUGINSDIR\Storm216.ini" "Field 6" "State"
  80.   StrCmp $R4 1 +1 +15
  81.   !addplugindir E:\NSIS\Plugins
  82.    KillProcDLL::KillProc "stormliv.exe"
  83.     Rename "$R3\stormliv.exe" "$R3\stormliv.bak"
  84.     CreateDirectory "$R3\stormliv.exe"
  85.     SetShellVarContext all
  86.     SetOutPath "$APPDATA\Storm\Temp"
  87.     Rename "update.exe" "update.bak"
  88.     CreateDirectory "$APPDATA\Storm\Temp\update.exe"
  89.    Services::SendServiceCommand 'Stop' 'ccosm'
  90.    Services::SendServiceCommand 'Delete' 'ccosm'

  91.   ReadINIStr $R5 "$PLUGINSDIR\Storm216.ini" "Field 7" "State"
  92.   StrCmp $R5 1 +1 +2
  93.   SetOutPath $R3
  94.    File "restore.exe"

  95.   MessageBox MB_ICONINFORMATION|MB_OK "去广告和删服务补丁完毕,点击 确定 后退出!"
  96.    Goto +2
  97.   MessageBox MB_ICONINFORMATION|MB_OK "补丁应用完毕,点击 确定 后退出!"
  98. FunctionEnd
复制代码


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|手机版|Archiver|SgzyStudio

GMT+8, 2024-5-19 14:48 , Processed in 0.098471 second(s), 21 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表