杉宫竹苑工作室

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

PPTV网络电视V2.4.3.0012

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

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

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

x
  1. SetCompressor lzma
  2. SetCompressorDictSize 32

  3. !AddIncludeDir "."

  4. ;!define Project PPTV
  5. ;!include "Assoc.nsh"   ;Ansifa的文件关联头文件
  6. !include "MyUI.nsh"
  7. !define PRODUCT_NAME "PPTV网络电视"
  8. !define PRODUCT_VERSION "V2.4.3.0012"
  9. !define PAGE_BGCOLOR 0xFFFFFF

  10. Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
  11. Caption "$(^Name) 安装 - by gfm688"
  12. OutFile "PPTV_Test.exe"
  13. Icon ".\Resource\Icon.ico"
  14. LoadLanguageFile "${NSISDIR}\Contrib\Language files\SimpChinese.nlf"
  15. ReserveFile "${NSISDIR}\Plugins\ButtonEvent.dll"
  16. BrandingText "WWW.PPTV.COM"
  17. CheckBitmap ".\Resource\check.bmp"
  18. ComponentText "${PRODUCT_NAME}将与您的本地媒体文件建立关联,以便您用PPTV客户端打开本地文件" "勾选需要关联的文件格式:"
  19. ShowInstDetails nevershow
  20. InstallDir "$PROGRAMFILES\PPTV"
  21. DirText "“安装向导”将安装 $(^Name) 在下列文件夹。$\n$\n要安装到不同文件夹,单击 [浏览(B)] 并选择其他的文件夹。$\n$\n单击 [下一步(N)] 继续。"
  22. LicenseBkColor ${PAGE_BGCOLOR}

  23. !define WELCOMEPAGE_TEXT_TOP "${PRODUCT_NAME}是PPLive旗下全球最大的网络电视平台。$\n$\n\
  24. 本向导将引导你完成${PRODUCT_NAME}客户端的安装。$\n\
  25. 安装进程开始前,建议先关闭其他所有应用程序。这将允许“安装向导”更新相应的系统文件,而无需重新启动你的计算机。$\n$\n\
  26. 单击 [下一步(N)] 继续。"

  27. !define WELCOMEPAGE_TEXT_BOTTOM "新版本特性:$\n\
  28. 1.会员用户免广告、看专享频道,充值即享VIP尊贵体验$\n\
  29. 2.关联本地文件,支持播放电脑中的视频文件$\n\
  30. 3.广告策略调整,避免重复弹出,音量可以控制$\n\
  31. 4.新增PPTV$"一起看新鲜$"屏保"

  32. !insertmacro MyWelcomePage

  33. PageEx license
  34.     LicenseData ".\Resource\License.rtf"
  35.     LicenseText "如果你接受协议中的条款,单击 [我接受(I)] 继续安装。如果你选定 [取消(C)] ,安装程序将会关闭。必须接受协议才能安装“$(^Name)”。"
  36.         PageCallbacks "" LicenseShow
  37. PageExEnd

  38. Page directory "" DirShow
  39. Page instfiles "" InstShow
  40. Page components AssocPre AssocShow AssocLeave

  41. !define FINISHPAGE_TEXT_TOP "${PRODUCT_NAME} 已成功安装到你的计算机。"
  42. ;....这里定义6个函数,是在完成页面的离开函数判断CheckBox是否选中而执行的
  43. !define FINISH_OPTION1 RunPPTVNow   ;我只写了第1个测试一下,其它5个省略不写了
  44. ;!define FINISH_OPTION2 XXXXXX
  45. ;.............................
  46. !insertmacro MyFinishPage

  47. Section
  48. ;ReserveFile /r /x ".\Resource\check.bmp" ".\Resource\*.bmp"
  49. DetailPrint "正在安装 ${PRODUCT_NAME} ..."
  50. Sleep 10
  51. Sleep 100
  52. Sleep 1000
  53. SectionEnd

  54. InstType "全选"
  55. InstType "全不选"
  56. InstType "恢复默认"

  57. !macro InsertSection SEC
  58.         Section "${SEC}" SEC${SEC}
  59.             SectionIn 1
  60.         SectionEnd
  61. !macroend

  62. !macro DefaultSection SEC
  63.         Section "${SEC}" SEC${SEC}
  64.             SectionIn 1 3
  65.         SectionEnd
  66. !macroend

  67. SectionGroup /e "全部媒体文件格式"
  68.         SectionGroup "Windows媒体文件"
  69.         !insertmacro DefaultSection ".asf"
  70.         !insertmacro DefaultSection ".wmv"
  71.         !insertmacro InsertSection ".wma"
  72.         SectionGroupEnd

  73.         SectionGroup "Real媒体文件"
  74.         !insertmacro InsertSection ".rm"
  75.         !insertmacro InsertSection ".rmvb"
  76.         !insertmacro InsertSection ".ra"
  77.         SectionGroupEnd

  78.         SectionGroup "MEEG4媒体文件"
  79.         !insertmacro DefaultSection ".mp4"
  80.         !insertmacro InsertSection ".m4v"
  81.         !insertmacro InsertSection ".mpeg4"
  82.         SectionGroupEnd
  83. SectionGroupEnd


  84. Function LicenseShow
  85.         !insertmacro PAGEINIT_BASIC
  86.     !insertmacro SET_PAGECTL_TEXT 1040 "按 [PgDn] 阅读“授权协议”的其余部分。"
  87.            !insertmacro SET_PAGECTL_COLOR 1040 ${PAGE_TEXTCOLOR} ${PAGE_BGCOLOR}
  88.            !insertmacro SET_HEADER_IMAGE "license_header.bmp" ".\Resource\license_header.bmp"
  89.            !insertmacro SET_PAGECTL_COLOR 1006 0x0d839d ${PAGE_BGCOLOR}
  90. FunctionEnd


  91. Function DirShow
  92.         !insertmacro PAGEINIT_BASIC
  93.         !insertmacro SET_PAGECTL_COLOR 1020 ${PAGE_TEXTCOLOR} ${PAGE_BGCOLOR}
  94.         !insertmacro SET_PAGECTL_COLOR 1023 ${PAGE_TEXTCOLOR} ${PAGE_BGCOLOR}
  95.         !insertmacro SET_PAGECTL_COLOR 1024 ${PAGE_TEXTCOLOR} ${PAGE_BGCOLOR}
  96.         !insertmacro SET_HEADER_IMAGE "directory_header.bmp" ".\Resource\directory_header.bmp"
  97. FunctionEnd

  98. Function InstShow
  99.     !insertmacro PAGEINIT_BASIC
  100.     !insertmacro SET_HEADER_IMAGE "instfiles_header.bmp" ".\Resource\instfiles_header.bmp"
  101.         !insertmacro SET_INSTPAGE_IMAGE ".\Resource\newfeather.bmp"
  102. FunctionEnd

  103. Function AssocPre
  104.     ${EnableSysMenuItem} ${SC_CLOSE} ${MF_DISABLED}
  105.     GetDlgItem $0 $HWNDPARENT 2
  106.     EnableWindow $0 0
  107.     SetCurInstType 2
  108. FunctionEnd

  109. Function AssocShow
  110.     !insertmacro PAGEINIT_BASIC
  111.         !insertmacro SET_PAGECTL_COLOR 1021 ${PAGE_TEXTCOLOR} ${PAGE_BGCOLOR}
  112.         !insertmacro SET_HEADER_IMAGE "FileOption.bmp" ".\Resource\FileOption.bmp"
  113.         !insertmacro SetButton 16002 SelectALL
  114.         !insertmacro SetButton 16003 SelectNone
  115.         !insertmacro SetButton 16004 SetDefault
  116.         !insertmacro SET_PAGECTL_FONT 1006 "Tahoma" "9" "520"   ;设置控件字体
  117.         !insertmacro SET_PAGECTL_FONT 1021 "Tahoma" "9" "520"
  118.         !insertmacro SET_PAGECTL_FONT 1032 "Tahoma" "9" "520"
  119. FunctionEnd

  120. ;!define CBN_SELCHANGE       1
  121. !macro CB_SETCURSEL item_index  ;item_index: Specifies the zero-based index of the string to select.
  122.         Push $R0
  123.         Push $R1
  124.         FindWindow $R0 "#32770" "" $HWNDPARENT
  125.     GetDlgItem $R1 $R0 1017
  126.     SendMessage $R1 ${CB_SETCURSEL} ${item_index} 0
  127.     SendMessage $HWNDPARENT ${WM_COMMAND} 66553 $R1
  128.         ;66553 即低位是1017, 高位是CBN_SELCHANGE
  129.         Pop $R1
  130.         Pop $R0
  131. !macroend

  132. Function SelectALL
  133.     !insertmacro CB_SETCURSEL 0
  134. FunctionEnd

  135. Function SelectNone
  136.     !insertmacro CB_SETCURSEL 1
  137. FunctionEnd

  138. Function SetDefault
  139.     !insertmacro CB_SETCURSEL 2
  140. FunctionEnd

  141. !macro ExecSection_Assoc SEC_IDX EXT DESC ICO CONTENTTYPE CLSID
  142.         Push $R0
  143.         SectionGetFlags ${SEC_IDX} $R0
  144.         IntOp $R0 $R0 & 1   ;第一位不变,其它位 置0
  145.         StrCmp $R0 0 +2
  146.         ;!insertmacro Assoc_Media ${ext} ${ext} ${desc} "$INSTDIR\pptv.exe" ${ico} ${ContentType} ${CLSID}
  147.         MessageBox MB_ICONINFORMATION|MB_OK "${ext}" ;MessageBox测试用,实际不要的
  148.         Pop $R0
  149. !macroend

  150. Function AssocLeave
  151.         !insertmacro ExecSection_Assoc ${SEC.asf} "asf" "ASF 媒体文件" "懒得写了" "video/x-ms-asf" "{cd3afa8f-b84f-48f0-9393-7edc34128127}"
  152.         !insertmacro ExecSection_Assoc ${SEC.wmv} "wmv" "懒得写了" "懒得写了" "懒得写了" "懒得写了"
  153.         ;....这里放更多的ExecSection_Assoc
  154.        
  155.         ;System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)'
  156.         !insertmacro UnsetButton 16002
  157.         !insertmacro UnsetButton 16003
  158.         !insertmacro UnsetButton 16004
  159. FunctionEnd

  160. Function RunPPTVNow
  161.         ${MessageBox2} "立即运行 PPTV网络电视......" "测试用的MsgBox" MB_ICONINFORMATION|MB_OK
  162.         ;这里放运行PPTV网络电视的代码
  163. FunctionEnd

  164. Function .onGUIInit
  165.         ;InitPluginsDir
  166.         SetCtlColors $HWNDPARENT "" 0xF3F8FC
  167.         GetDlgItem $0 $HWNDPARENT 1044
  168.         SetCtlColors $0 "" ${PAGE_BGCOLOR}
  169.         !insertmacro SHOW_PARENT_CTL 16002 0
  170.         !insertmacro SHOW_PARENT_CTL 16003 0
  171.         !insertmacro SHOW_PARENT_CTL 16004 0
  172.         GetDlgItem $0 $HWNDPARENT 1028
  173.         SetCtlColors $0 "" transparent
  174.         BrandingURL::Set /NOUNLOAD "0" "114" "255" "http://www.pptv.com/"
  175.         ;ButtonLinker::CreateLinker /NOUNLOAD $0 "http://www.pptv.com/" ;晕,Linker创建的链接改不了颜色
  176. FunctionEnd

  177. Function .onGUIEnd
  178.         ButtonEvent::Unload
  179.         BrandingURL::Unload
  180. FunctionEnd

  181. Function .onUserAbort
  182.     MessageBox MB_YESNO|MB_ICONEXCLAMATION "你确实要退出 “$(^Name)” 安装程序?" IDYES +2
  183.           Abort
  184. FunctionEnd
复制代码


回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-20 05:39 , Processed in 0.108618 second(s), 21 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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