杉宫竹苑工作室

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

组件单项选择功能

[复制链接]
发表于 2016-6-22 19:29:26 | 显示全部楼层 |阅读模式

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

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

x
  1. ; 该文件是演示NSIS组件单项选择功能!!!

  2. ; 安装程序初始定义常量
  3. !define PRODUCT_NAME "组件单项选择"
  4. !define PRODUCT_VERSION "1.0"

  5. SetCompressor lzma

  6. InstType "完全安装"
  7. InstType "推荐安装"
  8. InstType "精简安装"

  9. ; ------ MUI 现代界面定义 (1.67 版本以上兼容) ------
  10. !include "MUI.nsh"
  11. ;在此加入包含文件!!!!!!!<第一步> 添加包含文件!!!
  12. !include "Sections.nsh"

  13. ; MUI 预定义常量
  14. !define MUI_ABORTWARNING
  15. !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"

  16. ; 欢迎页面
  17. !insertmacro MUI_PAGE_WELCOME
  18. ;需要在此加入一个组件选择页面!!!!!!! <第二步>添加组件选择页面!
  19. !insertmacro MUI_PAGE_COMPONENTS
  20. ; 安装目录选择页面
  21. !insertmacro MUI_PAGE_DIRECTORY
  22. ; 安装过程页面
  23. !insertmacro MUI_PAGE_INSTFILES
  24. ; 安装完成页面
  25. !insertmacro MUI_PAGE_FINISH

  26. ; 安装界面包含的语言设置
  27. !insertmacro MUI_LANGUAGE "SimpChinese"

  28. ; 安装预释放文件
  29. !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
  30. ; ------ MUI 现代界面定义结束 ------

  31. Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
  32. OutFile "D:\My Documents\组件单项选择功能.exe"
  33. InstallDir "$PROGRAMFILES\组件单项选择功能"
  34. InstallDirRegKey HKLM "${PRODUCT_UNINST_KEY}" "UninstallString"
  35. ShowInstDetails show

  36. ;加入程序!!!!!<第三步>添加程序 !
  37. SectionGroup "声音" sound
  38. Section "千千静听美化1" 1 ;程序区段名为"1"
  39. SetOutPath "$INSTDIR"
  40. SetOverwrite ifnewer
  41. File /r "D:\My Documents\QQDIY\QQRes.dll"
  42. SectionEnd

  43. Section /o "千千静听美化2" 2 ;程序区段名为"2"
  44. SetOutPath "$INSTDIR"
  45. SetOverwrite ifnewer
  46. File /r "D:\NSIS\QQ2007\QQRes.dll"
  47. SectionEnd
  48. SectionGroupEnd

  49. Function .onInit
  50. StrCpy $1 ${1} ;区段名为1的选择默认被选中!!!!!<第四步>设置默认选项
  51. FunctionEnd
  52. ;两个选择相互排斥!也就是只能选择一个选项!!!!!<第五步>设置排斥选项
  53. Function .onSelChange
  54. !insertmacro StartRadioButtons $1
  55. !insertmacro RadioButton ${1}
  56. !insertmacro RadioButton ${2}
  57. !insertmacro EndRadioButtons
  58. FunctionEnd

复制代码


回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-18 00:57 , Processed in 0.103600 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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