检测默认浏览器

#检测默认浏览器
#原理:用FindExecutable函数查找htm关联程序路径与名称,然后分析字串中包含的可执行文件名。
!include "LogicLib.nsh"
XPStyle on
ShowInstDetails show
OutFile "NSIStest.exe"
Name "test"
Section "test"
 GetTempFileName $0
 Rename $0 $tempbrowser.htm
 System::Call "Shell32::FindExecutable(t'$tempbrowser.htm', i0, t .r1)"
 System::Call "Shlwapi::StrStr(tr1, t`IEXPLORE.EXE`)t .r0"
 ${If} $0 != ""
 DetailPrint 'IE为默认浏览器'
 ${Else}
 DetailPrint "IE不是默认浏览器"
 ${EndIf}
 Delete `$tempbrowser.htm`
SectionEnd
© 版权声明
THE END
喜欢就支持一下吧
点赞5 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容