Arduino IDE 2.0 RC - Silent Install

Hi,

I wondered if anyone else has tried to install Arduino IDE 2.0 RC in an enterprise environment (rather than standalone). We need to be able to package this software so it can be remotely deployed to 100+ machines for students to use in lessons. Its not feasible to manually install on each device.

With our previous version (1.8.16), we were able to pre-add the certificates to allow it to install the drivers and additional circuits during the normal install. However, it looks like the approach has changed.

In an ideal scenario, we would like to be able to silently push the IDE with the drivers, and also an additional library (Our ICT Teachers would specifically like the Adafruit Motor Shield V2 Library)

2 Likes

Your topic has been moved to a more suitable location on the forum.

was it not more suitable within the installation pages of the forum?

1 Like

As IDE 2.0 has not yet been released as a product the question is better asked here

2 Likes

Hi @simonparsons. Thanks for your interest in the Arduino IDE 2.0.0 release candidate!

Please provide more details on what you discovered through your investigation.

Which operating system(s) are you using on the machines?

Something to note is that, unlike Arduino IDE 1.x, Arduino IDE 2.x does not come with any bundled drivers.

The classic Arduino IDE came with a collection of Windows drivers for the original Arduino boards, Over time, more and more boards were added and so Arduino developed the Boards Manager system, which allows boards platforms and toolchains to be distributed as separate packages, independent from the Arduino IDE installation. Those platforms are installed and updated as needed by the user. With this new system, it makes far more sense to distribute and install the drivers along with the boards platform using Boards Manager.

Arduino IDE 2.x uses this Boards Manager system exclusively.


Unlike Arduino IDE 1.x, the "Arduino AVR Boards" platform of the Uno, Mega, Leonardo, etc. boards is not bundled with the Arduino IDE installation. Instead, on the first run of the IDE, the platform is automatically installed via Boards Manager.

Since the drivers were always distributed with the IDE, the maintainers of the "Arduino AVR Boards" platform never added them there. Now that the situation has changed, the drivers have been added to the "Arduino AVR Boards" platform:

That advancement has not yet been released, but it should be within a matter of days.

The Arduino IDE doesn't present any interface for doing this. You could use Arduino CLI for it. This is the command line tool which is used by Arduino IDE to all the non-GUI operations, but can also be used directly from the command line or a script.

https://arduino.github.io/arduino-cli/latest/

You would use this command to install the latest release of "Adafruit Motor Shield V2 Library" and all its dependencies:

arduino-cli lib install "Adafruit Motor Shield V2 Library"

Or if you want to specify the version, you can do something like this

arduino-cli lib install "Adafruit Motor Shield V2 Library"@1.1.0

More information here:

https://arduino.github.io/arduino-cli/latest/commands/arduino-cli_lib_install/

Thanks for the prompt reply, that's really appreciated

possibly a silly question though, but why has it been made so difficult to package this for an enterprise environment when arduino kit is sold for the education market? its simply not practical to do these installs manually on each and every machine - yes there are probably ways to script them, but it should be made simple for mass installations as its a decent piece of software that im sure many more schools would take up if it was easier to push out for users

You're welcome. I'm glad if I was able to be of assistance.

It is not clear to me what difficulties you have encountered in mass installations. Please provide details so that I can understand.

just that we cant seem to find how to do a silent install - the parameters and methods used for other packages dont seem to work for this, and the exe itself doesnt seem to have any options for installing silently (normally you can see a help list of commands that can be used)

Since you didn't tell me the operating system, I'll assume Windows from the mention of "exe".

There are two Windows installer variants of Arduino IDE 2.x.

The .exe file is the interactive NSIS installer.

There is also an MSI installer available from the "Windows MSI installer" download link on the Arduino Software page. This should be the preferred installer for your use case. You can use msiexec to install the Arduino IDEE .msi file according to your needs:

i tried both the exe and msi - the msi didnt seem to work (which would normally be the easiest route) and the exe didnt seem to have the usual silent install parameters

ill download the msi afresh and try again though

thanks for the help

Great. I have no problems using the .msi version to install the IDE on my computer. But I don't know whether that really simulates what you are doing.

Please let us know what you discover when you try it out.

Hello,
I continue this discussion, since I'm having the same problem/question:

I'm trying to install the Arduino 2.0RC5 IDE on my school PCs (about 50 machines) silently, using the MSI installer and a BATCH file to run the commands:

START /WAIT "" MSIEXEC /i "arduino-ide_2.0.0-rc5_Windows_64bit.msi" /qn ALLUSERS=1

With this command, the IDE is correctly deployed to the machines, but every different user that logs on the machine, at the first execution of the IDE needs to download all the basic cores/libraries, that seems to get saved into the APPDATA folder of every user:

C:\Users\[username]\AppData\Local\Arduino15

Unfortunately, this is not possible in our case, since the Appdata of the network profile of the students is not large enough to contain all the hundreds of MB (>300MB) that are saved there! :pensive:

Is there a way to install the IDE (completely) locally on the machine, which I thought was the case with the ALLUSERS=1 switch, maybe downloading at least the basic boards/libraries on the machine itself (it's ok if any future additional core/library chosen by the students goes into their profiles, but not all the hundreds of MB of the default installation)?

Thank you very much for any advice!

P.S.
I already tried, using arduino-cli during the installation, to issue the command

arduino-cli.exe core install arduino:avr

but unfortunately it doesn't seem to work... :roll_eyes:

Hi @MattiaB. The path of the Arduino boards platforms installations, both from the automated "Arduino AVR Boards" installation as well as any subsequent installations or updates via the Arduino IDE "Boards Manager", is configurable.

This path is set via the directories.data key in the Arduino CLI configuration file here:

%HOMEPATH%\.arduinoIDE\arduino-cli.yaml

You may also be interested in the directories.downloads key, since all the downloaded archives for the "Boards Manager" and "Library Manager" installations are cached there.

More information about the file here:

https://arduino.github.io/arduino-cli/latest/configuration/

So a custom configuration should allow you to share a single installation of the boards platforms between all users as long as their account has access to whatever path you have chosen.

It is a bit of a "catch-22" in that the configuration folder itself is in the user folder, and this is not configurable. Would it be possible for you to set up that custom configuration for each of the student accounts at the time you install the Arduino IDE? You can use the arduino-cli config command for this purpose if you like, or it is easy enough to just work with the YAML directly.

You can do that if you like. Just make sure that Arduino CLI is using the same configuration as the IDE (the configuration file location I mentioned above which is used by Arduino IDE 2.x is in a custom location, different from the default one used by Arduino CLI when you are using arduino-cli directly).


As you noticed, Arduino IDE 2.x also installs some libraries on the first startup. That goes pretty fast (even more so after the first installation caches the archives under directories.downloads, but if you prefer to install it in advance, you could do that by running the following command:

arduino-cli lib install Arduino_BuiltIn

These are installed to the libraries subfolder of the path set via the directories.user key of the Arduino CLI configuration file (this is the "sketchbook folder"). Since these libraries don't take up much disk space, you might prefer to leave that path set to the default %USERPROFILE%\Documents\Arduino\ so that each student has their own isolated set of libraries.


Please let us know if you have any questions or concerns. I'd also be interested to learn about what approach you end up taking in using Arduino IDE 2.x in this application.

1 Like

Hi,
thank you very much for all the infos! :grinning:

I managed to solve my problem with a bit of scripting (I tried with some test-users and everything works fine on multiple machines) and here below I explain how.


END RESULT:

  • The IDE is deployed locally on every machine, including the core boards arduino:avr already downloaded. :white_check_mark:

  • The user (student) can download new boards on the local machine: this will probably not be needed in our school, where only Arduino UNO/Mega are used, but it could be useful in the future. :white_check_mark:

  • The user (student) can download new libraries on his (network) profile: this is desired, since every student develops personal projects that require specific libraries, so every student already has "his" libraries installed on every PC he will log on. :white_check_mark:


STEP 1 - Software DEPLOYMENT/INSTALLATION:

  • Software Installation for all users:

START /WAIT "" MSIEXEC /i "arduino-ide_2.0.0-rc5_Windows_64bit.msi" /qn ALLUSERS=1

  • I create a hidden folder named Appdata inside C:\Program Files\arduino-ide, which can be written by everyone (it shouldn't create any security problem).
    This folder contains a "neutral" arduino-cli.yaml configuration file, whith the lines:
directories:
  data: C:\Program Files\arduino-ide\Appdata\Local\Arduino15
  downloads: C:\Program Files\arduino-ide\Appdata\Local\Arduino15\staging
  user: %USERPROFILE%\Documents\Arduino

The folder (with configuration file) is copied/created with the commands:

XCOPY "Appdata" "C:\Program Files\arduino-ide" /I/Q/H/R/K/Y/S/E
ICACLS "C:\Program Files\arduino-ide\Appdata" /t /grant Everyone:(OI)(CI)M
ATTRIB +h "C:\Program Files\arduino-ide\Appdata"
  • I finally install the core boards using this configuration file:
SET "PATH_ARDUINO_CLI=C:\Program Files\arduino-ide\resources\app\node_modules\arduino-ide-extension\build\arduino-cli.exe"
SET "PATH_ARDUINO_CLI_CONFIG=C:\Program Files\arduino-ide\Appdata\arduino-cli.yaml"
START /WAIT "" "%PATH_ARDUINO_CLI%" core install arduino:avr     --config-file "%PATH_ARDUINO_CLI_CONFIG%"

STEP 2 - User Configuration WHILE STARTING THE IDE:
Every user starts now the IDE not using the created icon, but instead using a given Shortcut that links to the following BATCH file (with the Arduino Icon :smile:):

@ECHO OFF
SET "CONFIG_NAME=arduino-cli.yaml"
SET "ARDUINO_CLI=C:\Program Files\arduino-ide\resources\app\node_modules\arduino-ide-extension\build\arduino-cli.exe"

SET "APPDATALOCAL_DIR=C:\Program Files\arduino-ide\Appdata"
SET "CONFIG_USER_DIR=%userprofile%\.arduinoIDE"
SET "CONFIG_USER_FILE=%CONFIG_USER_DIR%\%CONFIG_NAME%"
SET "CONFIG_BLANK_FILE=%APPDATALOCAL_DIR%\%CONFIG_NAME%"


IF NOT EXIST "%CONFIG_USER_DIR%"  MD "%CONFIG_USER_DIR%"
IF NOT EXIST "%CONFIG_USER_FILE%" XCOPY "%CONFIG_BLANK_FILE%" "%CONFIG_USER_DIR%" /I/Q/H/R/K/Y/S/E
ATTRIB +h "%CONFIG_USER_DIR%"

"%ARDUINO_CLI%" config set directories.data      "%APPDATALOCAL_DIR%\Local\Arduino15"         --config-file "%CONFIG_USER_FILE%"
"%ARDUINO_CLI%" config set directories.downloads "%APPDATALOCAL_DIR%\Local\Arduino15\staging" --config-file "%CONFIG_USER_FILE%"

START "" "C:\Program Files\arduino-ide\Arduino IDE.exe"

EXIT /B 0

This solves my "catch-22" problem: at every start of the IDE, I ensure that the current user has the correct folders set (except the sketch/library one, which defaults to %USERPROFILE%\Documents\Arduino at the first start but can then be freely modified).


So long, everything seems to work just as intended, so let's hope it will stay this way :crossed_fingers:

Thank you again, cheers!
Mattia

I'm very glad you were able to find a good approach to using Arduino IDE 2.x in this important setting.

Thanks so much for taking the time to share this valuable information. I'm sure that others with similar requirements will be glad to find it.

Regards,
Per

1 Like

Hi,
after some more tests, I'm still running into an error that doesn't allow me to fully automate the process on every machine (in fact I didn't make the tests on machines on a specific situation, i.e. while formatting WIN10, where our system automatically runs all our installation scripts, including mine above).

In particular, after running the following command in the batch file

START /WAIT "" MSIEXEC /i "arduino-ide_2.0.0-rc5_Windows_64bit.msi" /qn ALLUSERS=1

the IDE (gui), some time after the installation, opens and starts downloading and installing various stuffs. Unfortunately, the IDE starting is not the arduino-ide_2.0.0-rc5_Windows_64bit.msi process itself, so the /WAIT flag does not apply to it, and the script continues with it in the background.

This is however a problem for several reasons:

  • If the script was the last one (or the other ones were fast), the PC reboots with it still open and downloading.
  • [More important] My script has to turn off the Windows firewall at the beginning and turn it on at the end. However, after turning it on, the IDE is still working (maybe not even started on slow PCs!) and at the next download I get a "Windows firewall - allow?" pop-up windows that needs the user intervention and hence blocks everything.



  1. Is there a way to prevent the IDE from opening and running commands after the MSI "silent" execution?

  2. Alternatively, is there a way to know when it has downloaded/installed what it needed?
    (since, after finishing, it stays open indefinitely, so there is no way to know, by looking at its process in the task manager, if it can be killed or not)


Thank you again! :slight_smile:

Hi @MattiaB. I have submitted a proposal to configure the MSI so that it does not run after installation. I think this will be the best behavior for the intended use case of that package.

The proposal is here:

If you would like to give it a try, tester builds are available. I'll provide the instructions:

  1. Sign in to your GitHub account.
    (GitHub only allows downloads of the tester builds when you are signed in)
  2. Open this page in your browser:
    https://github.com/arduino/arduino-ide/actions/runs/2094687356#artifacts
  3. Click the "Windows_X86-64_MSI" link under the "Artifacts" section of the page.
  4. Wait for the download to finish.

Use the downloaded file just as you have before with the production MSI package.

Since I am not very knowledgeable about this particular use case for installing the Arduino IDE, I'd be very interested in your results and any other feedback you might have.

The proposed change to the Windows Installer behavior has been accepted.

It is now available for testing via the nightly builds, so the instructions in my previous reply are no longer required.

The download links for the nightly builds are listed here, and do not require a GitHub account:

https://github.com/arduino/arduino-ide#nightly-builds

Feedback is welcomed from @simonparsons, @MattiaB, and all other interested parties.

Hi, thank you very much for all the work! :slight_smile:

I tried the nightly version of today, and it seems to work correctly (i.e. without starting the IDE and finishing the installation process). I will start next week testing the installed IDE in action with the students, I'll report here any issue that should appear with these silent installations!

Thank you again!
Cheers,
Mattia

1 Like

Hello,

I have try to install via the .exe /S or MSI package with ALLUSERS=2 etc...
Alwais install in local appdata folder for the admin user...
I just test the nightly version to.

Please, we have more than 500 computer to install it, can you provide the arduino V2 with a working silent install for all users?
Can you get à Chocolatey package to?

Many thanks in advance! :slight_smile: