2016-06-29 3 views
0

Windows 10에서 작업 표시 줄에 바로 가기를 고정하고 싶습니다. 스크립트는 정상적으로 작동하지만 내 utily는 맬웨어 트로이 목마로 탐지됩니다. Microsoft는 동사를 제거했으며 이것이 동사의 이유가 될 수 있습니다. 그래서 프로그램 적으로 프로그램을 고정/고정 해제 할 수있는 대체 방법이 있습니다.NSIS 스크립트에서 InvokeShellVerb의 대안이 있습니까?

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 

다른 언어 솔루션에서도 문제가 없습니다.

답변

0

Don't programmatically pin shortcuts, 작업 표시 줄은 즐겨 찾는 아이콘을 넣으려면 a place for users입니다.

은이 (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" 
SectionEnd