杉宫竹苑工作室

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

NSIS自动检测

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

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

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

x
  1. !include "MUI.nsh"
  2. OutFile "S32.exe"

  3. !define MUI_PAGE_CUSTOMFUNCTION_PRE ComponentsPage1Pre
  4. !insertmacro MUI_PAGE_COMPONENTS

  5. Sectiongroup "完整独立程序" SecOL3
  6.   Section /o "QQ直播程序" Sec60
  7.   SectionIn 1 2
  8.   SetOutPath "$TEMP"
  9. setoverwrite on
  10.   File "QQLive5.0.3240.exe"
  11.   ExecWait '"$TEMP\QQLive5.0.3240.exe /S'
  12. SectionEnd
  13.   Section /o "QQ音乐程序" Sec20
  14.   SectionIn 1 2
  15.   SetOutPath "$TEMP"
  16. setoverwrite on
  17.   File "QQMusicClickInstall.exe"
  18.   ExecWait '"$TEMP\QQMusicClickInstall.exe /S'
  19. SectionEnd
  20.   Section /o "QQ医生程序" Sec30
  21.   SectionIn 1 2
  22.   SetOutPath "$TEMP"
  23. setoverwrite on
  24.   File "qqdoctor1.3kb1setup.exe"
  25.   ExecWait '"$TEMP\qqdoctor1.3kb1setup.exe /S'
  26. SectionEnd
  27.   Section  /o "QQ旋风程序" Sec50
  28.   SectionIn 1
  29.   SetOutPath "$TEMP"
  30. setoverwrite on
  31.   File "qqdownload1.4b1.exe"
  32.   ExecWait '"$TEMP\qqdownload1.4b1.exe /S'
  33. SectionEnd
  34.   Section  /o "QQ游戏程序" Sec40
  35.   SectionIn 1 2
  36.   SetOutPath "$TEMP"
  37. setoverwrite on
  38.   File "QQGame2007Beta1_setup.EXE"
  39.   ExecWait '"$TEMP\QQGame2007Beta1_setup.EXE /S'
  40. SectionEnd
  41.   SectionGroupend

  42. Function ComponentsPage1Pre
  43.   Call Check1
  44.   Call Check2
  45.   Call Check3
  46.   Call Check4
  47.   Call Check5
  48. FunctionEnd

  49. Function Check1
  50. IfFileExists $PROGRAMFILES\NSIS\NSIS.exe skip
  51.    !insertmacro UnselectSection ${Sec60}
  52.   skip:
  53. FunctionEnd

  54. Function Check2
  55. IfFileExists $PROGRAMFILESA\A.exe skip
  56.    !insertmacro UnselectSection ${Sec20}
  57.   skip:
  58. FunctionEnd

  59. Function Check3
  60. IfFileExists $PROGRAMFILES\DAEMON Tools\DAEMON.exe skip
  61.    !insertmacro UnselectSection ${Sec30}
  62.   skip:
  63. FunctionEnd

  64. Function Check4
  65. IfFileExists $PROGRAMFILES\QQGAME\Game.exe skip
  66.    !insertmacro UnselectSection ${Sec40}
  67.   skip:
  68. FunctionEnd

  69. Function Check5
  70. IfFileExists $windir\notepad skip
  71.    !insertmacro UnselectSection ${Sec50}
  72.   skip:
  73. FunctionEnd
  74. =====================================================
  75. 上下源码均为NSIS自动检测。罾心製作DIY。
  76. =====================================================
  77. !include Sections.nsh

  78. Name TestSelectSection
  79. OutFile "TestSelectSection.exe"

  80. Page components
  81. Page instfiles
  82. ShowInstDetails show

  83. Sectiongroup "完整独立程序" SecOL3
  84.   Section /o "QQ直播程序" Sec60
  85.   SectionIn 1 2
  86.   SetOutPath "$TEMP"
  87. setoverwrite on
  88.   File "QQLive5.0.3240.exe"
  89.   ExecWait '"$TEMP\QQLive5.0.3240.exe /S'
  90. SectionEnd
  91.   Section /o "QQ音乐程序" Sec20
  92.   SectionIn 1 2
  93.   SetOutPath "$TEMP"
  94. setoverwrite on
  95.   File "QQMusicClickInstall.exe"
  96.   ExecWait '"$TEMP\QQMusicClickInstall.exe /S'
  97. SectionEnd
  98.   Section /o "QQ医生程序" Sec30
  99.   SectionIn 1 2
  100.   SetOutPath "$TEMP"
  101. setoverwrite on
  102.   File "qqdoctor1.3kb1setup.exe"
  103.   ExecWait '"$TEMP\qqdoctor1.3kb1setup.exe /S'
  104. SectionEnd
  105.   Section  /o "QQ旋风程序" Sec50
  106.   SectionIn 1
  107.   SetOutPath "$TEMP"
  108. setoverwrite on
  109.   File "qqdownload1.4b1.exe"
  110.   ExecWait '"$TEMP\qqdownload1.4b1.exe /S'
  111. SectionEnd
  112.   Section  /o "QQ游戏程序" Sec40
  113.   SectionIn 1 2
  114.   SetOutPath "$TEMP"
  115. setoverwrite on
  116.   File "QQGame2007Beta1_setup.EXE"
  117.   ExecWait '"$TEMP\QQGame2007Beta1_setup.EXE /S'
  118. SectionEnd
  119.   SectionGroupend

  120. IfFileExists $windir\notepad.exe QQliveExists PastQQliveCheck
  121. QQliveExists:
  122.   !insertmacro SelectSection ${SEC60}
  123. PastQQliveCheck:
  124. ;/////////////////////QQ音乐//////////////////////////////////////////////////
  125. IfFileExists $windir\notepad.exe QQmusicExists PastQQmusicCheck
  126. QQmusicExists:
  127.   !insertmacro SelectSection ${SEC20}
  128. PastQQmusicCheck:
  129. ;/////////////////////QQ医生//////////////////////////////////////////////////
  130. IfFileExists $windir\notepad.exe QQdoctorExists PastQQdoctorCheck
  131. QQdoctorExists:
  132.   !insertmacro SelectSection ${SEC30}
  133. PastQQdoctorCheck:
  134. ;/////////////////////QQ旋风//////////////////////////////////////////////////
  135. IfFileExists $windir\notepad.exe QQdownloadExists PastQQdownloadCheck
  136. QQdownloadExists:
  137.   !insertmacro SelectSection ${SEC40}
  138. PastQQdownloadCheck:
  139. ;//////////////////////QQ游戏/////////////////////////////////////////////////
  140. IfFileExists $windir\notepad.exe QQgameExists PastQQgameCheck
  141. QQgameExists:
  142.   !insertmacro SelectSection ${SEC50}
  143. PastQQgameCheck:
  144. FunctionEnd

  145. !include Sections.nsh

  146. Section "Photoshop plug-ins" ps_plugins
  147. SectionEnd

  148. Function .onInit
  149. IfFileExsists $PROGRAMFILES\Photoshop\main.exe psins
  150. !insertmacro SelectSection ${ps_plugins}
  151. Goto done
  152. psins:
  153. !insertmacro UnselectSection ${ps_plugins}
  154. done:
  155. FunctionEnd
复制代码


回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-19 11:44 , Processed in 0.111910 second(s), 22 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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