簡體   English   中英

NSIS腳本中是否可以使用InvokeShellVerb?

[英]Is there any alternative of InvokeShellVerb in NSIS Script?

我想將快捷方式固定到Windows 10中的任務欄。腳本運行良好,但我的工具被檢測為惡意軟件木馬。 Microsoft刪除了該動詞,這可能是相同的原因。 因此,有沒有其他方法可以編程方式固定/取消固定任何程序。

    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

我也同意其他語言的解決方案。

不要以編程方式固定快捷方式 ,任務欄是用戶放置自己喜歡的圖標的地方!

要取消固定,您可以執行以下操作(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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM