我想在windows 10中插入任务栏的快捷方式。脚本工作正常,但我的实用程序被检测为恶意程序特洛伊木马。微软已经删除了这个动词,这可能是原因之一。那么,是否有任何其他方法可以通过编程来锁定/解锁任何程序。
OutFile "C:\PinUnpinExe\PinUnpinShortcut.exe"
!include 'StdUtils.nsh'
!include FileFunc.nsh
SilentInstall silent
RequestExecutionLevel user ;no elevation needed
ShowInstDetails hide
var inputParam
Section
${GetParameters} $inputParam
System::Call "kernel32::GetCurrentDirectory(i ${NSIS_MAX_STRLEN}, t .r0)"
${StdUtils.InvokeShellVerb} $0 "$0" "abc.exe" $inputParam
SectionEnd这一行被检测为病毒。
${StdUtils.InvokeShellVerb} $0 "$0" "abc.exe" $inputParam我对其他语言解决方案也很满意。
发布于 2016-06-29 11:33:01
不要以编程的方式插入快捷键,任务栏是用户来放置他们最喜欢的图标!
要解锁您可以这样做(NSIS 3+):
!include "LogicLib.nsh"
!include "Win\COM.nsh"
!macro UnpinShortcut lnkpath
Push $0
Push $1
!insertmacro ComHlpr_CreateInProcInstance ${CLSID_StartMenuPin} ${IID_IStartMenuPinnedList} r0 ""
${If} $0 P<> 0
System::Call 'SHELL32::SHCreateItemFromParsingName(ws, p0, g "${IID_IShellItem}", *p0r1)' "${lnkpath}"
${If} $1 P<> 0
${IStartMenuPinnedList::RemoveFromList} $0 '(r1)'
${IUnknown::Release} $1 ""
${EndIf}
${IUnknown::Release} $0 ""
${EndIf}
Pop $1
Pop $0
!macroend
Section Uninstall
!insertmacro UnpinShortcut "$SMPrograms\MyApp.lnk"
SectionEndhttps://stackoverflow.com/questions/38093044
复制相似问题