NSIS Kill Process

For my projects, I love to use, NSIS installer. Sometimes, usually for plug-ins, I need to check if host program runs, then I try to close, terminate or kill it. Here is a simple plug-in help terminate, close, quit and detect any working process from NSIS installer.

Notes for usage:

  1. Download NSIS Installer
  2. NSIS Installer
  3. Download Kill Process for NSIS
  4. Unrar it and to NSIS installed path, usually are C:\Program Files\NSIS\Plugins\
  5. Make any script install
  6. Exported Function are: ExistsProcess, KillProcess, CloseProcess, QuitProcess
  7. Use inside script:
Function CloseParentWithUserApproval
Push $5

loop:
  push "msimn.exe"
  processwork::existsprocess
  pop $5
  IntCmp $5 0 done

  MessageBox MB_RETRYCANCEL|MB_ICONSTOP
        'Outlook Express must be closed during
        this installation.$\r$\n
        Close Outlook Express now,
        or press "Retry" to automatically close
        Outlook Express and continue or press
        "Cancel" to cancel the
        installation entirely.'  IDCANCEL BailOut
  push "msimn.exe"
  processwork::KillProcess
  Sleep 2000
Goto loop

BailOut:
  Abort

done:
Pop $5
FunctionEnd

Click here to download Kill Process for NSIS

Want more features or any bug? Fill free to contact me.

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply

You must be logged in to post a comment.