杉宫竹苑工作室

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

NSIS 检测默认浏览器

[复制链接]
发表于 2017-4-28 16:59:13 | 显示全部楼层 |阅读模式

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

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

x
  1. #检测默认浏览器
  2. #编写:水晶石
  3. #原理:用FindExecutable函数查找htm关联程序路径与名称,然后分析字串中包含的可执行文件名。

  4. !include "LogicLib.nsh"
  5. XPStyle on
  6. ShowInstDetails show
  7. OutFile "NSIStest.exe"
  8. Name "test"
  9. Section "test"
  10.    GetTempFileName $0
  11.    Rename $0 $temp\browser.htm
  12.    System::Call "Shell32::FindExecutable(t'$temp\browser.htm', i0, t .r1)"
  13.    System::Call "Shlwapi::StrStr(tr1, t`IEXPLORE.EXE`)t .r0"
  14.    ${If} $0 != ""
  15.       DetailPrint 'IE为默认浏览器'
  16.    ${Else}
  17.       DetailPrint "IE不是默认浏览器"
  18.    ${EndIf}
  19.    Delete `$temp\browser.htm`
  20. SectionEnd
复制代码


回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-12 13:43 , Processed in 0.117628 second(s), 22 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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