A basic MSI project needs DLL custom action functions with prototype:UINT __stdcall FunctionName(MSIHANDLE hInstall){ // ... etc. ...}The hInstall argument (whatever you passed to the custom action function) is a handle that gives you access to MS...
Normally, MSI will notice if a file you're replacing is in use and display a warning to the user. If it's not a file you're replacing, you'll still need a custom action to launch taskkill.