Teensy 1.58.0 version released - tools issue

This may be related to some other problems that others ran into recently. I have already resolved it, but thought I might mention it here, in case some else runs into similar problem.

Yesterday PJRC was in the process of releasing 1.58, so there was a semi-private version for the file to use in preferences, to point to the Teensy installs... Which I used and helped verify that it works. So this morning when the actual release happened, so set the URL back to the official one for Teensy, and wanted to reinstall 1.58. So this time I went to the board manager, and this time did an uninstall of 1.58, told the package list to update and then did an install. Thought everything was fine, until I tried to do a build.

After pulling out a few more hairs, I checked the Teeny tools directory mentioned and found it only had teensy.exe in it. Tried choosing different version and then back, it sill did not work. Hint: when I reinstalled 1.58, one of the messages was the tools were already installed.

What happened, was before I started doing the update, I had compiled a sketch or two and the Teensy app was still running. The actual window was buried somewhere on my screen.

When I told Arduino to remove Teensy install, it failed to remove the Teensy.exe as it was running. I don't believe there was any warnings on this. And as it did not remove that app, it did not remove the directory it was contained in.

So when I told it to reinstall, it saw the directory and did nothing, so I was left with just that one app and the build failed.

I fixed it by selecting different version, then delete the 1.58 tools directory and then tell it to update to the new release and everything is working again.

Not sure if one or more issues should be created, or if there already are ones. But thought I would mention it, in case someone else runs into something similar.

Kurt

Edit: Should mention I am running Windows 11
Nightly build: 20230330

1 Like

@ptillisch @pjrc This issue keeps coming up.

The most recent postings are up in the PJRC Forum thread:
Teensyduino 1.58 Released - Page 4 (pjrc.com)

As I asked Paul on that thread, if there was some mechanism, that when a board type is uninstalled or upgraded to a new version. Is there any mechanism in place, where when an uninstall is started that the developer of that board type has a callback, that for example can look for active processes or the like, and have the ability to terminate them?

In addition to this, I believe that the IDE should:
a) Not silently fail to remove a file or files.

b) If the user chooses to reinstall a version that uses that partially deleted directory. The install should do some form of validation and not assume that if the directory exists, everything is fine. Both to handle this case, as well as maybe the case where files were deleted by a virus detection software...

thanks
Kurt

The post_install script is great. But what we really need for Teensy is also a pre_uninstall script.

The pre_uninstall script would be responsible for stopping any background processes and closing any network connections (even if only localhost) and freeing any persistent system resources the tools have allocated. This is needed because some operating systems (especially Windows) will not allow files to be deleted if an background process is still running or certain types of resources are still in use.

Today uninstalling Teensy fails in those cases.

The way things go wrong isn't detected. A useful error messages isn't shown to users. When they try to uninstall and reinstall (eg, change versions via the drop-down menu in IDE 2.x.x Boards Manager) they just end up with an incomplete install but no way to know it didn't install properly, other than things go wrong when they try to use it. Perhaps lack of detecting uninstall / install errors and showing useful messages is separate issue from the need for a pre_uninstall script?

I opened a feature request.

1 Like

@pjrc Paul, looks like a fix was checked in to the CLI code base today :smiley:

So hopefully it will be in the next release of the IDE and before that, when they merge in the current CLI stuff to the daily builds for the IDE.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.