Teensy 4 Security ?

IDE 2.3.8
Win 11

I suddenly noticed the below
image

And

What is it? How did I get it?
I do have the Teensy platform (for IDE 2.0.4 and later) installed (for ages) but as far as I can remember it was never there.

Hi @sterretje. It is this Arduino IDE extension:

When you install or update an Arduino boards platform via the Arduino IDE Boards Manager, any tool dependencies specified by the platform developer are also installed. On of the tool dependencies of the "Teensy" boards platform is "teensy-tools".

When installing a platform, Boards Manager executes any "post-install scripts" that are present in the platform or tool dependencies. This allows for additional arbitrary setup operations.

The "teensy-tools" tool has a Windows post-install script with the following content:

@echo off
vscode_plugins.exe --install

vscode_plugins.exe is an installer tool created by Paul Stoffregen, which is bundled with the "teensy-tools" installation. Apparently this executable is an installer for the extension, which places the extension's VSIX file in the C:\Users\<username>\.arduinoIDE\plugins folder, where it will be loaded by Arduino IDE.

The addition by the extension of the new item to the "Activity Bar" on the left side of the Arduino IDE window is intentional, but the addition of the new menu bar item is not intentional, as reported here:

If you don't use this feature of the Teensy boards platform, you are free to uninstall the extension. I found I had to delete the following things from my hard drive:

  • The C:\Users\<username>\.arduinoIDE\deployedPlugins\teensysecurity-0.0.2 folder
  • The C:\Users\<username>\.arduinoIDE\plugins\teensysecurity-0.0.2.vsix file

After doing that, close any Arduino IDE windows that are open and start Arduino IDE again. The "Teensy 4 Security" menu item and activity bar icon should now be removed.

Thanks for the explanation. I suspect that it's a (relative) recent addition.

I don't use Teensies; the platform is only installed to be able to compile if people on the forum have problems.

Hi Paul here… the guy who makes Teensy.

This plugin is new with the 1.60.0 version of Teensy’s software, released only 11 days ago.

I spent quite a long time debating whether to include this plugin or wait for Arduino developers to address issue 2848. So far I haven’t seen any Arduino developers comment on that issue, but it has remained open. Things they don’t consider valid issues get closed quickly, but issues sometimes stay open without activity for years. So it’s quite difficult to estimate whether the Arduino developers consider this a bug worthy of time and if will be fixed anytime soon.

For years the answer to using Lockable Teensy code protection involved needing Arduino IDE 1.8.19, because it has much more mature plugin support. I seriously considered just staying with “you need to use the old Arduino IDE”.

But sadly, we had to drop MacOS support for use of Teensy on the old IDE because the old version didn’t have pluggable discovery and other important features of the new IDE 2. I have long supported those old IDEs with a special installer, which adds a Teensy-specific version of those features to the old IDE. However, on MacOS the installer became impossible with MacOS Catalina. We started supporting old IDE on newer MacOS by publishing a complete copy of the old IDE with Teensy stuff pre-installed. However, that too broke in recent time when Apple changed their notarization process to require newer xcode tools which don’t run on the older version of MacOS I was using to build all that stuff. I made the decision to abandon supporting Arduino IDE 1.8.19 on MacOS.

Without the new plugin, use of Lockable Teensy on old Macs would have become a matter of not only needing to use Arduino IDE 1.8.19, but also a copy with older Teensy software. That was the main factor that swayed me to finally include this plugin with Teensy software version 1.60.0.

My hope is the Arduino developers will eventually improve Arduino IDE plugin support. Teensy 4 Security isn’t the only plugin, but so far only a few others exist (as far as I know). We’re kind of in a difficult Catch-22 situation where so far plugins exist for the new Arduino IDE because it’s plugin support is still pretty rough and not well documented, but because there are so few plugins improving and documenting the new plugin system (probably) isn’t a priority for the Arduino developers.

Ideally over time Arduino IDE will continue to improve and gain better plugin support. At least that was my optimistic hope behind finally deciding to publish this plugin, even though with Arduino IDE 2.3.8 you still get this unwanted and ugly menu, rather than the IDE giving you a place to see which plugins are available and which you want enabled.

Thanks for this! I was not aware of the deployedPluginsfolder.

My “vscode_plugins” installer has an “–uninstall” option which deletes the plugins\teensysecurity-0.0.2.vsix file, which is the only file it writes it when run with “–install”. The Teensy tools “pre_uninstall” script runs “vscode_plugins –uninstall” in an attempt to clean up.

In the next version I will update “vscode_plugins –uninstall” to also recursively delete everything in the deployedPlugins\teensysecurity-0.0.2 folder.

Or if Arduino publishes documentation with recommended practices for delivering vscode extensions, of course I will follow that guidance.

In case it will be of interest, there is a community maintained catalog of all known Arduino IDE 2.x-specific extensions here:

I'm sure you are aware, but worth mentioning for the benefit of others who may read this is that Arduino IDE 2.x uses the VS Code extension framework, which means that there is general support for VS Code extensions. A good place to discover those extensions is the Visual Studio Marketplace:

Or if you prefer something less "M$", the (unfortunately less comprehensive) Open VSX Registry:

Keep in mind that it is the VS Code extension framework. There is a tremendous quantity of high quality information on the Internet about creating VS Code extensions.

However, there are some considerations specific to creating extensions for use with Arduino IDE. It would be expected that this information would be provided by Arduino, and you absolutely correct that we have failed to do so. The most significant deficiency is that we haven't provided any documentation about the Arduino-specific information that is available to extensions, provided via the "VS Code Arduino API" extension that is bundled with the Arduino IDE installation.

The .vsix file is a compressed archive. The Theia framework extracts the .vsix file from the plugins folder to the deployedPlugins folder. This behavior is a relatively recent change in Theia:

(previously the .vsix would have been extracted and deployed to a temporary folder on each startup)

That new behavior was introduced to Arduino IDE via feat: use `theia@1.57.0` by giacomocusinato · Pull Request #2654 · arduino/arduino-ide · GitHub, which was released in version 2.3.5.

Something you might consider is making your installer place the uncompressed extension in a folder under the plugins folder, rather than copying the .vsix file to that location. E.g.:

C:/Users/<username>/.arduinoIDE/plugins/
└── teensysecurity/
    ├── [Content_Types].xml
    ├── extension/
    │   ├── CHANGELOG.md
    │   ├── LICENSE.md
    │   ├── README.md
    │   ├── dist/
    │   ├── package.json
    │   ├── package_version.pl
    │   └── resources/
    └── extension.vsixmanifest

In this case, Arduino IDE just loads the extension in situ. This way you have more control over where the extension is located, which means your uninstaller isn't as subject to being broken by further changes in the Theia framework.

I'm working to improve my "pre_uninstall" script to fully delete the plugin, now that I know about the copy in the deployedPlugins folder. Thanks @ptillisch for that tip!!

Now my script fully deletes all the plugin files.

The new uninstall problem I'm facing is after my script has fully deleted the plugin from both deployedPlugins and plugins, Arduino IDE continues to keep reference to it in memory and lets the user click on its GUI controls. Here's a screenshot. This is just after uninstalling Teensy from Boards Manager!

Is there some programatic way from the pre_uninstall script to tell Arduino IDE to "forget" my plugin? Or rescan plugins? Or really any way to give the user a smoother uninstall experience?