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

Fix issue where exe files were not removed during uninstall. #1667

Conversation

johan-lindqvist
Copy link
Contributor

@johan-lindqvist johan-lindqvist commented Oct 8, 2020

This error occurred due to a disposable resource not being disposed.

Tested with our application and the change resolves the issue of exe-files not being removed since version 2.0.0.

Fixes #1641

Sidenote: there's still two files left after an uninstall, a ".dead"-file, and Update.exe as described in #1586, but if I understand correctly that is expected behavior?

@GeertvanHorrik
Copy link
Contributor

Looks good to me!

@johan-lindqvist
Copy link
Contributor Author

@anaisbetts any chance of getting this reviewed? We currently use a forked version of this but it would be nice to have it in the main package.

var assembly = AssemblyDefinition.ReadAssembly(executable);
if (!assembly.HasCustomAttributes) return null;
using (var assembly = AssemblyDefinition.ReadAssembly(executable))
{
Copy link
Contributor

Choose a reason for hiding this comment

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

⬆️, the bracket belongs on the same line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to what I think you meant.

@johan-lindqvist johan-lindqvist force-pushed the branches/exe-files-not-removed-during-uninstall branch from bdbb879 to db240d8 Compare October 26, 2020 07:34
This error occured due to a disposable resource not being disposed.
@johan-lindqvist johan-lindqvist force-pushed the branches/exe-files-not-removed-during-uninstall branch from db240d8 to c982449 Compare October 26, 2020 08:09
@anaisbetts anaisbetts merged commit 45834cb into Squirrel:develop Oct 31, 2020
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.

GetAllSquirrelAwareApps locks all exe files, therefore the uninstall process can't delete these exe files
3 participants