Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kill processes belonging to us on install and uninstall #590

Merged
merged 9 commits into from
Feb 5, 2016

Conversation

anaisbetts
Copy link
Contributor

For certain types of apps, it's super easy to run the installer while the app is still running. This of course fails, but users think it is just because the installer has a bug. Enact Process Violence to stop this from occurring

var pbi = new PROCESS_BASIC_INFORMATION();

//Get a handle to our own process
IntPtr hProc = OpenProcess((ProcessAccess)0x001F0FFF, false, Process.GetCurrentProcess().Id);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use the enum here instead of the literal?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just moved code from long ago, but yeah, probably - this is calling undocumented methods so it might not be possible

@CharlieHess
Copy link
Contributor

Could maybe beef up the tests around this scenario, although there's no way to mock them.

anaisbetts added a commit that referenced this pull request Feb 5, 2016
Kill processes belonging to us on install and uninstall
@anaisbetts anaisbetts merged commit 70a350a into master Feb 5, 2016
@anaisbetts anaisbetts deleted the process-murder branch February 5, 2016 23:48
@ricardopolo
Copy link
Contributor

@paulcbetts so this #358 is not necesary anymore?

@anaisbetts
Copy link
Contributor Author

@ricardopolo Nope!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants