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

IDE update or uninstall fails with "Arduino IDE cannot be closed" error #1163

Open
3 tasks done
FirebirdTA01 opened this issue Jul 10, 2022 · 35 comments
Open
3 tasks done
Labels
os: windows Specific to Windows operating system topic: infrastructure Related to project infrastructure type: imperfection Perceived defect in any part of project

Comments

@FirebirdTA01
Copy link

FirebirdTA01 commented Jul 10, 2022

Describe the problem

When attempting to update, install, or uninstall Arduino IDE, an unexpected "Arduino IDE is running. Click OK to close it." dialog appears:

image

When the user clicks the "OK" button, the process fails with an "Arduino IDE cannot be closed" dialog:

image

There is no easy way for the user to pass this point to complete the operation.

To reproduce

  1. Install the arduino-ide_2.0.0-rc8_Windows_64bit.exe linked to by the arduino website
  2. When prompted install for all users, not just your user.
  3. Attempt an in place upgrade/install of a newer nightly build (I used arduino-ide_nightly-20220710_Windows_64bit).

🐛 When running the installer it will recognize that the IDE is already installed in whichever location it was installed to and say it will be upgraded or reinstalled. It then hangs for a bit on the next progress bar and gives the reported error:

Arduino IDE cannot be closed.
Please close it manually and click Retry to continue.

Expected behavior

No unfriendly dialogs about closing Arduino IDE during the update, install, uninstall operation. Operations complete successfully.

Arduino IDE version

2.0.0-rc8

Operating system

Windows

Operating system version

Windows 10 Pro 21H2 build 19044.1766

Additional context

My install was not done to my C drive but my data drive instead.


When attempting to run the uninstaller for the RC 8 version it too encounters the same error.

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details
@FirebirdTA01 FirebirdTA01 added the type: imperfection Perceived defect in any part of project label Jul 10, 2022
@kittaakos kittaakos self-assigned this Jul 11, 2022
@kittaakos
Copy link
Contributor

kittaakos commented Jul 11, 2022

Thank you for taking the time and letting us know about the problem. I tried reproducing the defect on my Windows machine, but it worked. Could you please help us refine the exact steps you did? I did the followings:

  • IDE2 was not installed on my Windows machine,
  • Download the arduino-ide_2.0.0-rc8_Windows_64bit.exe from the 2.0.0-rc8 release page,
  • Install it, and when prompted, install it for all users.
  • I installed it to C:\\Program Files\\Arduino IDE; after the installer, I ran the app. It worked.
  • I downloaded the latest nightly (arduino-ide-nightly_20220711_Windows_64bit.exe) and installed it,
  • When prompted, I have chosen the same location (C:\\Promram Files\\Arduino IDE),
  • The installation has been successfully completed, and the IDE2 started.

install_nightly

image

I had no problems uninstalling the IDE2 either. My account does not have any special Admin rights.

image

My install was not done to my C drive but my data drive instead. When running the installer it will recognize that the IDE is already installed in whichever location it was installed to and say it will be upgraded or reinstalled.

It's not yet evident to me what exactly you did. Could you please help us and write down where you installed the rc-8, then the nightly? Thank you!

@kittaakos kittaakos added the status: waiting for information More information must be provided before work can proceed label Jul 11, 2022
@per1234
Copy link
Contributor

per1234 commented Jul 13, 2022

Other reports:

@FirebirdTA01
Copy link
Author

I installed it to my data drive, but kept the default path other than the drive letter. In my case that was E:\Program Files\Arduino IDE. I attempted to install the nightly to the same location but ran into this error. Uninstalling or reinstalling both give the same error.

@per1234 per1234 removed the status: waiting for information More information must be provided before work can proceed label Jul 30, 2022
@kittaakos kittaakos removed their assignment Aug 2, 2022
@per1234
Copy link
Contributor

per1234 commented Aug 2, 2022

Problem still occurs with the update to 2.0.0-rc9.1:

https://forum.arduino.cc/t/arduino-ide-2-0-0-rc9-available-for-download/1014434/9

image

@BigMacBeickler
Copy link

BigMacBeickler commented Aug 22, 2022

Hey,
I posted the thread in the Arduino Forum, https://forum.arduino.cc/t/can-t-uninstall-the-adruino-ide-2-0-says-the-ide-is-still-open/1023412

I´m using a Windows 10 Pro system, version 21H2, build 19044.1889 on a coorporate PC.

In my case, i had no nightly build install on my windows machine, only the lates official release. I was logged in with my user account (now admin privileges) and downloaded the latest RC build Arduino IDE 2.0 RC(2.0.0-rc9.2). I started the installer with "Shift+right-click -> start as another user" and used an admin account to install it. I wrongly selected "install only for this user" and the installation succeeded and was installed at C:\Users"Adminaccount"\AppData\Local\Programs\Arduino IDE

Until now i´ve tried to run the uninstaller just by opening it, by opening it with admin privileges and opening it as another user trying the admin account, logging into the admin user account and there tried every above mentioned way to uninstall the IDE.
Everytime, right as the progress bar appers i get the same message that the IDE is still open and i can´t progress.

Greetings

@drizztguen77
Copy link

I have Arduino IDE 2.0.0-rc6-nightly-20220526 installed and am receiving this same error. I'm trying to uninstall it so I can install the new 2.0 stable build but cannot uninstall it. I have tried everything suggested and cannot find a way so it appears I'll just have to delete the files and clean it out of the registry manually. I don't know what else to do at this point.

@ukagit
Copy link

ukagit commented Sep 20, 2022

hi i have the "same" problem ... trying to uninstall Arduino IDE 2.0.0-rc9.2
is there a fix?
or was "delete the files and clean it out of the registry manually" successful ?
73 ulrich

@drizztguen77
Copy link

@ukagit I found this link and used the software to uninstall it and it worked. Then I just uninstalled advanced uninstaller.
https://www.advanceduninstaller.com/Arduino-IDE-2_0_0-beta_11-7d455f8a9f283d5d088f74a25fe09760-application.htm

@ukagit
Copy link

ukagit commented Sep 20, 2022

Hi, thank you very much. I have successfully uninstalled the old version and the new version 2.0 is running :-)

73 ulrich

@spiff42
Copy link

spiff42 commented Nov 5, 2022

I had 2.0.0 installed (for all users), and experienced the same issue when trying to upgrade to 2.0.1.
First tried to upgrade from within the 2.0.0 IDE upgrade dialog. Failed.
Then tried restarting and downloading the 2.0.1 installer and running it. Failed (the IDE had not been started, but installer said it was running).
Ended up using @drizztguen77's suggestion of Advanced Uninstaller to remove 2.0.0. Then installed 2.0.1.
Just tried running 2.0.1 uninstaller (from Windows Add or Remove programs), and it fails to uninstall 2.0.1 as well. :-(
image
image

@per1234 per1234 changed the title Failure to upgrade 2.0 RC 8 or uninstall IDE update or uninstall fails with "Arduino IDE cannot be closed" error Nov 5, 2022
@dwesely
Copy link

dwesely commented Nov 19, 2022

I'm getting the same issue trying to go from v2.0.1 to v2.0.2.

When I got the error, I had both 2.0.0 beta (installed with arduino-ide_2.0.0-beta.12_Windows_64bit.msi) and 2.0.1 (installed with arduino-ide_2.0.1_Windows_64bit.exe) installed.

In 2.0.1, I used the "upgrade to 2.0.2" button and got the error that Arduino IDE couldn't be closed. I exited and used Add And Remove Programs to uninstall the 2.0.0 beta (successfully). When I tried to do the same for 2.0.1, I get the error, screenshots below.

This version is currently installed:
image

Using Add and Remove Programs in Win 10 (64 bit) to uninstall 2.0.1, I get a close notification:
image
I click OK then I get the error:
image

I've tried rebooting and running the uninstall again, but I get the same error.

@per1234
Copy link
Contributor

per1234 commented Nov 20, 2022

Hi @dwesely. Please provide a screenshot of the Windows Task Manager when the uninstaller is in this "Arduino IDE cannot be closed" state:

  1. Attempt to uninstall Arduino IDE.
  2. Wait until the uninstall process gets to this "Arduino IDE cannot be closed" dialog.
  3. Open Windows "Task Manager":
    https://techcommunity.microsoft.com/t5/windows-11/how-to-run-task-manager-on-windows-11-6-ways/m-p/2701239
  4. If it is not already in that mode, click the "More details" button at the bottom of the Task Manager window.
  5. Select the "Processes" tab.
  6. Click the "Name" column to sort the processes by name.
  7. Find any processes that contain the word "Arduino" in the list. If any have a icon to the left of the process name, click on that icon to expand the process tree.
  8. Make sure all the relevant processes are visible in the window.
  9. Take a screenshot of the "Task Manager" window.
  10. Open this GitHub issue in your browser: IDE update or uninstall fails with "Arduino IDE cannot be closed" error #1163
  11. Attach the screenshot to a comment here.

@spiff42
Copy link

spiff42 commented Nov 21, 2022

This is attempting to uninstall 2.0.1 (from add/remove programs). Arduino IDE is installed for all users (in C:\Program Files\Arduino IDE).
image

@per1234
Copy link
Contributor

per1234 commented Nov 21, 2022

I found this bug report in the issue tracker of the electron-builder tool we use to generate this installer/uninstaller:

electron-userland/electron-builder#6865

productName of my project is XYZ, it allows user to install a service named XYZ Helper on Windows, which runs when the operating system starts up. When I use electron-builder(23.0.3) to package(target: NSIS), the installer always show XYZ cannot be closed. Please close it manually and click retry to continue. even after I'm sure to quit XYZ completely. Only after I also stop the service named XYZ Helper, this step can be processed. But XYZ Helper is not part of XYZ, which is a separated process and should not be stopped.

This seems to indicate the installer uses a fuzzy match on process names when checking whether the application is already running. That made me think the bug might be caused by the affected users having some other process with a name similar to the product name ("Arduino IDE"). However, I have that same process shown in your screenshot when I do a successful uninstall of Arduino IDE on my machine.

@spiff42
Copy link

spiff42 commented Nov 21, 2022

Just started Arduino IDE 2.0.1, and it asked if I wanted to update to 2.0.2. I answered yes, and after a short while the same problem occurred (except during an upgrade attempt instead of uninstall). Only the installer process seems to be running.
image
Edit: I noticed the "Arduino IDE" background process, ended the task, and tried to continue, but it still failed with the same error.

@dwesely
Copy link

dwesely commented Nov 22, 2022

Hi @dwesely. Please provide a screenshot of the Windows Task Manager when the uninstaller is in this "Arduino IDE cannot be closed" state:

image

@abdullahbaig1618
Copy link

Are the devs still alive? It's at least a 6 months old issue.

See the screenshot of the error when I update to version 2.02 from version 2.01. For any people who still have doubts, I restarted the computer and ran the installer first thing. No IDE or any other software.

arduino

@SamFeinesonos
Copy link

I too have this same issue, now with 2.0.3 both when attempting to download and install the update from within the IDE itself and when downloaded from the arduino.cc website.
image

@ubidefeo
Copy link

ubidefeo commented Dec 7, 2022

@abdullahbaig1618

Are the devs still alive? It's at least a 6 months old issue.

Please be polite.
We are alive and well, with multiple issues to take care of.
We are a small team with a massive open-source project and millions of downloads.
Priorities are reassessed on a weekly basis

Thank you 🙏🏼

@Dirk-
Copy link

Dirk- commented Dec 15, 2022

Hi,

I experience the same problem when going from version 2.0.0 or 2.0.1 to 2.0.3 on several PCs in a lab. Neither uninstall nor update is possible.

During this process I am the only user on the system and I do not see any other Arduino processes active beside the installer. I am using Windows 10 Pro 21h2, German language. Maybe this is a problem when the installer searches for processes that have to be stopped:

ArduinoClose

@Vonkje2000
Copy link

Vonkje2000 commented Jan 2, 2023

I had the problem that i could not upgrade from Arduino IDE 2.0.0 to 2.0.3 and found with some googling that it was possible one or more of these windows registry keys were not properly deleted so I looked for these.

I deleted the keys that had "arduino" somewhere in the name and after that I could delete the old version and install the new version with the installer from arduino.cc.

WARNING if you are not careful with deleting registry keys it can brick or break your Windows installation so be careful.

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall\80a6dee0-faee-5422-9648-6b7ee9b05f5a
HKEY_CLASSES_ROOT\Local Settings\Software\Microsoft\Windows\Shell\MuiCache\C:\users\UserName\appdata\local\programs\arduino ide\resources\app\node_modules\arduino-ide-extension\build\arduino-cli.exe.FriendlyAppName
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules\TCP Query User{F17C4E3B-0A45-4391-AB25-73E71F5EA01F}C:\users\UserName\appdata\local\programs\arduino ide\resources\app\node_modules\arduino-ide-extension\build\arduino-cli.exe
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules\UDP Query User{5B50D949-CB93-42DB-9479-7890B6C05A93}C:\users\UserName\appdata\local\programs\arduino ide\resources\app\node_modules\arduino-ide-extension\build\arduino-cli.exe

I am sorry I do not have the exact registry keys but I hope that this will help a lot in fixing the problem.

Installer for arduino 2.0.0 : arduino_ide_2.0.0_Windows_64bit.exe
Installer for arduino 2.0.3 : arduino_ide_2.0.3_Windows_64bit.exe

@N0YHR
Copy link

N0YHR commented Jan 10, 2023

Describe the problem

I have the same problem that FirebirdTA01 experienced updating Arduino 2.0.0 to 2.0.3.

To reproduce

Attempt to install Arduino IDE 2.0.3 over Arduino IDE 2.0.0, and uninstall Arduino IDE 2.0.0. The update runs about 40% and then gives the message that it the installer cannot close the Arduino IDE.

Expected behavior

Previously with other versions over the years, the installer will run and upgrade or reinstall the existing version without hassle. The uninstaller would also successfully be able to uninstall the program

Arduino IDE version

2.0.0

Windows Version

Edition Windows 10 Pro
Version 22H2
Installed on ‎3/‎29/‎2022
OS build 19045.1889
Experience Windows Feature Experience Pack 120.2212.4180.0

Problem

I attempted the update multiple times, closing everything related to Arduino in the Task Manager, and getting the same result. I rebooted, and prior to running anything else, I attempted again with the same error. I then attempted to uninstall version 2.0.0, but get the same error with that as well.

I even paused the VPM to eliminate any possible communications issues.

Arduino Error
2.0.0.

@Thebluedrab
Copy link

A search of my Windows 10 registry editor using the word Arduino shows multiple entries of Arduino LLC, Arduino IDE and Arduino SA. Just saying. I wonder what happens if they are deleted? Will the install/upgrade work?

@shoot-again
Copy link

Frustrated by this problem for weeks.
Here is a work around that will remove 2.0.0. You can then download 2.0.3 from Arduino and install it.
https://wccftech.com/how-to/how-to-force-uninstall-programs-on-windows-10-11-computers/
Go to " Force Uninstall Programs in Registry Editor" in the article.
Follow the instructions to get to " Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" At this point you can use "find" in "edit" in the registry editor for the entry that contains "arduino".
Then follow the instructions to delete the key. This will allow you to reload 2.0.3.
Caution! When messing with the registry its wise to set a restore point before you do in case something crazy happens.
https://support.microsoft.com/en-us/windows/create-a-system-restore-point-77e02e2a-3298-c869-9974-ef5658ea3be9
Hope this helps.

@Thebluedrab
Copy link

Solve this the easy way by using Revo Uninstaller Free. https://www.revouninstaller.com/products/revo-uninstaller-free/
Here is a link to how to use Revo
https://video.search.yahoo.com/search/video?fr=mcafee&ei=UTF-8&p=revo+uninstaller+video&type=E210US91166G91641#id=1&vid=ba3876516a5f7754332024cb34ff051a&action=click
After Revo cleans up version 2.0.3 will install.
Best Thebluedrab.

@Wick-McLean
Copy link

I'm having this issue as well.

I'd guess that many people are having this issue and instead of upgrading the IDE they just keep a previous version (and not reporting it).

@rocketpsi
Copy link

I solved the problem to my satisfaction by running the install as Admin and installing for just me.

@per1234 per1234 added topic: infrastructure Related to project infrastructure os: windows Specific to Windows operating system labels Mar 1, 2023
@BigMacBeickler
Copy link

I solved the problem to my satisfaction by running the install as Admin and installing for just me.

Did this remove your old install or did you just simply installed the newer version parallel?

@N0YHR
Copy link

N0YHR commented Mar 19, 2023

Frustrated by this problem for weeks. Here is a work around that will remove 2.0.0. You can then download 2.0.3 from Arduino and install it. https://wccftech.com/how-to/how-to-force-uninstall-programs-on-windows-10-11-computers/ Go to " Force Uninstall Programs in Registry Editor" in the article. Follow the instructions to get to " Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" At this point you can use "find" in "edit" in the registry editor for the entry that contains "arduino". Then follow the instructions to delete the key. This will allow you to reload 2.0.3. Caution! When messing with the registry its wise to set a restore point before you do in case something crazy happens. https://support.microsoft.com/en-us/windows/create-a-system-restore-point-77e02e2a-3298-c869-9974-ef5658ea3be9 Hope this helps.

The Registry edits did the job for me. I had tried most others unsuccessfully.

@rocketpsi
Copy link

I solved the problem to my satisfaction by running the install as Admin and installing for just me.

Did this remove your old install or did you just simply installed the newer version parallel?

It did not. It installed at "C:\Users\owner\AppData\Local\Programs\Arduino IDE". The stat menu shortcut points to the new version however.

@YAABoySB
Copy link

(Version: 2.0.0)
Renaming the "Arduino IDE.exe" to something else say "Arduino IDE 2.exe" worked for me. I have noticed that when I start the uninstaller, I see Arduino IDE in task manager. So, the uninstaller is checking if the IDE is running or not but the uninstaller by itself is starting the IDE and is unable to close it. Renaming it passes the check and the uninstallation process carries on. I don't know if it's a proper fix or not but it's what I got after much goofing around.

@Nyako01
Copy link

Nyako01 commented Jun 8, 2023

i have same issue when install and uninstall arduino IDE v2.0+. i try to delete manually arduino folder and still same. when i see on arduino forum. someone say to delete manually the registry of arduino IDE

To uninstall the arduinoide, you need to delete the entry in the register, as described here: https://www.advanceduninstaller.com/Arduino-IDE-2_0_0-beta_11-7d455f8a9f283d5d088f74a25fe09760-application.htm 47

Use regedit.exe to manually remove from the Windows Registry the data below:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall\80a6dee0-faee-5422-9648-6b7ee9b05f5a
I have numbers at the end : 459fc68c-eb53-59f8-8957-9913bc627af3
They may also be different for you, check them one by one, look for the arduinoide.

when i search the registry. i found 2 registry for arduino IDE. first is arduino IDE that currently i try to install. second is the RC2 version (i called it beta version). i delete both registry. then install again. and its completely installed. i install the latest version (2.1.0)

@kaushalbhuva
Copy link

(Version: 2.0.0) Renaming the "Arduino IDE.exe" to something else say "Arduino IDE 2.exe" worked for me. I have noticed that when I start the uninstaller, I see Arduino IDE in task manager. So, the uninstaller is checking if the IDE is running or not but the uninstaller by itself is starting the IDE and is unable to close it. Renaming it passes the check and the uninstallation process carries on. I don't know if it's a proper fix or not but it's what I got after much goofing around.

This one is simplest I found so far. And solved!

@Natsirtt
Copy link

Natsirtt commented Feb 10, 2024

Same issue over here. In case that is not known (and I don't know if that's the same for everyone but it seems to be the root cause for me), it looks like sometimes Arduino IDE processes do not correctly terminate. I have 2 such lingering processes in my task manager right now even though the IDE is not running:

image

I believe these prevent the current Arduino IDE version to be uninstalled before the new version gets installed by the updater.

Frustratingly, these seem to be "ghost" or "unkillable" processes. No amount of elevated-permission commands or tools I have tried to use can delete the processes. They are the kind that return a "no such instance" error when using taskkill.exe.

I have no idea how much of this is Windows being Windows (meaning maybe Windows also prevented the IDE from terminating these when I closed it, in which case it could be hard to fix on the software side of things?) or how much comes from a potential bug in Arduino IDE itself leaving child processes behind maybe?
But I reckon these unkillable processes whatever their origin are the source of the updater being unable to do anything.

I hope these pieces of information help resolving this issue someday! In the meanwhile, I'm off to rebooting my machine and manually running the updater in the hopes that I may update the IDE 😄

UPDATE: rebooting the computer and manually running %LOCALAPPDATA%/arduino-ide-updater/pending/arduino-ide_2.3.0_Windows_64bit.exe did the trick. The installer.exe in the parent folder I could run successfully but it didn't seem to properly update the IDE (starting the IDE after seemingly updating still showed up as the previous version). Anyway, it's fine as a workaround for me!

@markingle
Copy link

Renaming the .exe fixed my issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
os: windows Specific to Windows operating system topic: infrastructure Related to project infrastructure type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests