最新消息:

SAFER是NSIS打开文件进行安全警告的插件

nsis 永恒心锁 1596浏览 0评论
/*
SAFER是NSIS打开文件进行安全警告的插件
SAFER在支持在运行第三方程序的时候做出安全警告,提醒用户是否需要继续运行.
*/
!AddPluginDir "Plugins"
!define PROD_NAME "SAFER Tester App"
Name "${PROD_NAME}"
OutFile "@${PROD_NAME}.exe"
ShowInstDetails show
Section
SAFER::SupportsSAFER
DetailPrint "OS supports SAFER API: $0"
strcmp $0 1 +2
abort
goagain:
!define exec 'calc' #'notepad.exe "c:somefile.txt"'
MessageBox MB_ABORTRETRYIGNORE|MB_ICONQUESTION
'Choose SAFER Level to execute ${exec}$n$nAbort=NORMAL$nRetry=CONSTRAINED$nIgnore=UNTRUSTED'
IDIGNORE ignore IDRETRY retry
StrCpy $0 NORMAL
goto exec
ignore:
StrCpy $0 UNTRUSTED
goto exec
retry:
StrCpy $0 CONSTRAINED
exec:
DetailPrint 'Executing >>${exec}<< as $0'
SAFER::Exec $0 '${exec}'
DetailPrint "...returned $0"
MessageBox MB_YESNO|MB_ICONQUESTION "Execute again?" IDYES goagain
SectionEnd
Page InstFiles
永恒心锁,版权所有丨如未注明,均为转载丨本网站采用BY-NC-SA协议进行授权

转载请注明:永恒心锁-分享互联网 » SAFER是NSIS打开文件进行安全警告的插件

您必须 登录 才能发表评论!