当前位置:编程学习 > 网站相关 >>

NSIS 检测默认浏览器

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

!include "LogicLib.nsh"
XPStyle on
ShowInstDetails show
OutFile "NSIStest.exe"
Name "test"
Section "test"
   GetTempFileName $0
   Rename $0 $temp\browser.htm
   System::Call "Shell32::FindExecutable(t'$temp\browser.htm', i0, t .r1)"
   System::Call "Shlwapi::StrStr(tr1, t`IEXPLORE.EXE`)t .r0"
   ${If} $0 != ""
      DetailPrint 'IE为默认浏览器'
   ${Else}
      DetailPrint "IE不是默认浏览器"
   ${EndIf}
   Delete `$temp\browser.htm`
SectionEnd

补充:综合编程 , 其他综合 ,
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,