I wanted to make a portable app for huya streaming and found that his main process huya.exe still has a huyaservice.exe process running after closing, causing backup of appdata content to fail.I learned that you can use the .nsh file to call killproc to solve the problem, so I put a custom.nsh in the launcher folder of paf.
${SegmentFile}
${SegmentPrePrimary}
KillProcDLL::KillProc “HuyaService.exe”
!macroend
${SegmentPostPrimary}
KillProcDLL::KillProc “HuyaService.exe”
!macroend
But it doesn't seem to be working, so what can I do about it?
You are here
The issue of closing the process before the end of the app
October 24, 2020 - 12:22am
#1
The issue of closing the process before the end of the app
KillProc and FindProc from the NSIS folks have a bug that causes them to fail without error when too many processes are running. We use our custom ProcFunc.nsh now which has a TerminateProcess procedure: https://portableapps.com/node/12561
Also, be sure you have the right to kill the process and it's not a user to admin thing.
Sometimes, the impossible can become possible, if you're awesome!
${SegmentFile}
${SegmentPrePrimary}
${TerminateProcess} “HuyaService.exe” $1
!macroend
${SegmentPostPrimary}
${TerminateProcess} “HuyaService.exe” $1
!macroend
I researched and rewrote the code to do this, but it didn't produce what it was supposed to, should I go ahead and edit the .nsi file?
Is it ending? You don't have it set to wait for it? Can you terminate it from Task Manager?
Sometimes, the impossible can become possible, if you're awesome!
I can terminate it from Task Manager.But can't using that custon.nsh to end it
Have you tried running the app as admin?
Sometimes, the impossible can become possible, if you're awesome!
I used the admin account directly.
I've now solved the problem by replacing the annoying HuyaService.exe with an empty nop.exe, which solves the problem in another sense