I'm running a third party executable within my nsis script which kills my process.

Is possible to prevent this ?

有帮助吗?

解决方案

The user should be in control of their own machine and that means killing and/or debugging any process they want to.

The only way to prevent someone from killing your process would be to install some type of rootkit that prevents killing or hides the process from the process list but that would be evil so don't do it!

Edit: What if you put one process between you and the script?

!define THESCRIPT "$sysdir\calc.exe"

Section
ExecWait '"cmd.exe" /c if 1==1 "${THESCRIPT}"'
SectionEnd

or

!include LogicLib.nsh
!include FileFunc.nsh
Section
${GetParameters} $0
${GetOptions} "$0" "/DONTKILLME=" $1
${If} $1 != ""
        ExecWait '$1'
${Else}
        ExecWait '"$exepath" /DONTKILLME="${THESCRIPT}"'
${EndIf}
SectionEnd
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top