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

Doesn't uninstall properly on Windows #516

Closed
adolfintel opened this issue Jun 20, 2019 · 12 comments
Closed

Doesn't uninstall properly on Windows #516

adolfintel opened this issue Jun 20, 2019 · 12 comments

Comments

@adolfintel
Copy link

When uninstalled, SyncTrayzor:

  • Does not stop the synctrayzor.exe and syncthing.exe processes
  • Leaves all the configuration data for both synctrayzor and syncthing in appdata
  • Leaves a bunch of files in Program Files\SyncTrayzor
  • Does not remove startup entry from Windows registry
@canton7
Copy link
Owner

canton7 commented Jun 24, 2019

Does not stop the synctrayzor.exe and syncthing.exe processes

I've done many upgrades and many installations myself in testing, and have never seen this. Do you have multiple users running SyncTrayzor perhaps? Anything else which you can think of which might affect this?

Leaves all the configuration data for both synctrayzor and syncthing in appdata

That's fairly standard practice for uninstallers, but having an option to remove it is a fair request. The complexity comes from the fact that the location of Syncthing's data can be customized, so it's hard for the uninstaller to find it.

Leaves a bunch of files in Program Files\SyncTrayzor

That will be because it couldn't stop the processes, for some reason.

Does not remove startup entry from Windows registry

Again, fairly standard practice (Run entries for applications which don't exist have a negligible cost). It's also a bit tricky to do from the uninstaller, as there may be multiple portable installations which all have entries, and picking the right entry gets a little bit fiddly. This is a solvable problem though.

@adolfintel
Copy link
Author

No, it's just a single user, but it was started automatically at boot so maybe it uses a different user and that's why it couldn't kill the process? (If you use HKCU instead of HKLM for the run entry, it will be started as the current user) How do you stop the process in the uninstaller? Taskkill?

Leaving config data is understandable, it's common especially on windows, but it's annoying because it's not just a few kb so an option to remove it would be nice. Could be complicated to implement it though if you have to find syncthing's data. If you're using Inno Setup, you could write a script to find it relatively easily.

As for the registry entry, that should be pretty easy, it's the same as adding it. If you're using Inno Setup it can do it automatically.

@canton7
Copy link
Owner

canton7 commented Jun 24, 2019

(If you use HKCU instead of HKLM for the run entry, it will be started as the current user)

I do use HKCU.

How do you stop the process in the uninstaller? Taskkill?

Reading further, it looks like Inno Setup doesn't use the Restart Manager during uninstallation. We already have a general IPC mechanism for controlling a running SyncTrayzor process by running the exe again with various command-line flags, so the cleanest solution is probably to extend that.

If you're using Inno Setup, you could write a script to find it relatively easily.

I do use Inno Setup. It means parsing one of SyncTrayzor's XML configuration files, and substituting some placeholders. It's logic that I'd rather not duplicate between C# and Pascal, so it might make more sense to call into SyncTrayzor itself to do this. It's a few hours' work.

As for the registry entry, that should be pretty easy, it's the same as adding it. If you're using Inno Setup it can do it automatically.

As I explained in my previous post, there may be multiple Run registry entries for SyncTrayzor (given names with sequential numbers), and we need to do some work to find the one corresponding to the instance of SyncTrayzor which we're uninstalling.

@canton7
Copy link
Owner

canton7 commented Apr 2, 2021

The uninstaller does try and remove registry keys these days, although it's only best-effort as it can't remove other users' keys.

@KzBeck
Copy link

KzBeck commented Jun 27, 2021

I am not able to uninstall Syncthing Trayzor on WIndows. It leaves the exe file and I am not able to delete them. I am getting a an error. No matter what I do I cannot remove Syncthing to reinstall. I have ended the process, Killed the process and nothing works. I thought if I uninstalled and reinstalled, I would be able to run Syncthing again.

Any thoughts?
2021-06-27_9-06-29

@canton7
Copy link
Owner

canton7 commented Jun 27, 2021

I am getting a an error.

What does the error say?

Any thoughts?

That screenshot says to read the log (which is the big block of text underneath Syncthing's UI). What does the log say?

@KzBeck
Copy link

KzBeck commented Jun 27, 2021

09:12:41 INFO: syncthing v1.14.0 "Fermium Flea" (go1.16 windows-amd64) teamcity@build.syncthing.net 2021-02-26 12:21:13 UTC
09:12:41 WARNING: Error opening database: The process cannot access the file because it is being used by another process. (is another instance of Syncthing running?)

@canton7
Copy link
Owner

canton7 commented Jun 27, 2021

OK, that's why Syncthing can't start. It's saying that another process has the database open, probably another Syncthing process. Check in Task Manager, see whether you can find it?

What's the error you get when trying to uninstall?

@KzBeck
Copy link

KzBeck commented Jun 27, 2021

I did. I ended all processes and tried to uninstall, but I still get this message after the uninstall attempt.

@canton7
Copy link
Owner

canton7 commented Jun 27, 2021

You said you got an error when trying to uninstall, but haven't yet said what that error was, despite me asking twice. I'm afraid I can't help unless I know what's wrong.

I'm afraid I can't tell what process has Syncthing's database open: the only person who can figure that out is the person who has access to your computer, which is you. Process Explorer has a tool to see which process has a file open, or restarting might help. Either way, that's an issue with Syncthing: I'm afraid it's not something SyncTrayzor can help with.

@KzBeck
Copy link

KzBeck commented Jun 27, 2021

Actually, you did help. I knew there were several process that needed closed, but there were more than I thought when I started poking around in the Task Manager. Once they were all closed I was able to uninstall and reinstall. Impressive I didn't have to do anything else.

@canton7
Copy link
Owner

canton7 commented Jun 27, 2021

Glad you got it sorted! The next version does a better job at stopping everything when uninstalling, but that won't have affected your original issue of Syncthing not being able to start

@canton7 canton7 closed this as completed in 23dfac1 Aug 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants