Not planned
Description
Where's the source code for dpinst-amd64.exe
?
If it's gonna ask me for admin credentials, and is supposedly used to download "drivers" for additional Arduino boards, I really wanna see it's source code.
- Other driver software generally doesn't ask for admin cred's to download drivers!
- To make it worse, it is downloaded after main install package is getting installed. Why the
****
isn't it packaged with the installer, in the first place?
Additional context
The installer is trying to run with the following flags:
/LM - Legacy mode. Accepts unsigned driver packages and packages with missing files.
These packages won't install on the latest version of Windows.
/SA - Suppress the Add/Remove Programs entry normally created for each driver package.
/SW - Suppresses the Device Installation Wizard, the operating system might still pop-up user dialogs.
Here's the help file:
pinst-amd64.exe [/U INF-file][/S | /Q][/LM][/P][/F][/SH][/SA][/A][/PATH Path][/EL][/L LanguageID][/C][/D][/LogTitle Title][/SW][/? | /h | /help]
/U INF-file Uninstall a driver package (INF-file).
/S | /Q Silent (Quiet) mode. Suppresses the Device Installation Wizard and any dialogs popped-up by the operating system.
/LM Legacy mode. Accepts unsigned driver packages and packages with missing files. These packages won't install on the latest version of Windows.
/P Prompt if the driver package to be installed is not better than the current one.
/F Force install if the driver package is not better than the current one.
/SH Scans hardware for matching devices and only copies and installs those drivers for which a device is present. Only valid for Plug and Play drivers.
/SA Suppress the Add/Remove Programs entry normally created for each driver package.
/A Install all or none.
/PATH Path Search for driver packages under the given path.
/EL Enables all languages not explicitly listed in the XML file.
/L LanguageID Tries to use the given language in all UI. Useful for localization tests.
/SE Suppress the EULA.
/C Dump logging output to attached Console (Windows XP and above).
/D Delete driver binaries on uninstall.
/SW Suppresses the Device Installation Wizard, the operating system might still pop-up user dialogs.
/? | /h | /help Shows this help.
Issue checklist
- I searched for previous reports in the issue trackerMy report contains all necessary details
Activity
per1234 commentedon Nov 23, 2024
It is a proprietary tool from Microsoft:
https://learn.microsoft.com/windows-hardware/drivers/install/difx-guidelines
First of all, an overview:
On the first run after a fresh installation of Arduino IDE 2.x, the IDE automatically installs the "Arduino AVR Boards" platform. This automatic installation is done to provide beginners with everything they need to get started working on Arduino projects with the common boards right away, without first needing to learn how to use Boards Manager.
Arduino boards platforms may include a "post-install" script to perform arbitrary system configuration for the platform. If the platform contains a post-install script, the script is executed by Arduino IDE when the platform is installed via the Boards Manager system:
https://arduino.github.io/arduino-cli/dev/platform-specification/#post-install-script
The "Arduino AVR Boards" platform has a Windows post-install script (here). The script uses the Driver Package Installer tool (DPInst), which is bundled with the platform (here) it to install drivers for the platform's boards:
ArduinoCore-avr/post_install.bat
Lines 2 to 18 in c8c514c
Now to answer your question: the reason Arduino IDE downloads the "Arduino AVR Boards" platform from the Internet on the first run after installation is so that the user will always get the latest version of the platform.
This design decision was based on hard won experience from the Arduino IDE 1.x, project. The "Arduino AVR Boards" platform is bundled with the Arduino IDE 1.x and this approach was found to be harmful both for the users and for the maintainers. It was harmful for the users because they would often end up with an outdated version of the "Arduino AVR Boards" platform, missing important fixes or enhancements, even though they installed the latest version of the IDE. It was harmful for the maintainers because they were sometimes forced to spend time making releases of the IDE solely for the purpose of distributing a new version of the "Arduino AVR Boards" platform, even though there was no need for a release from the perspective of the IDE application itself.
By separating the distribution of the IDE application and the platform in Arduino IDE 2.x, we avoid these problems, and we can use the existing platform distribution system that is Boards Manager, so the implementation and maintenance of the system is trivial.
eabase commentedon Nov 24, 2024
@per1234
Fair enough, and thanks for taking your time to explain. However, you still didn't address the questions of (a) where is the source code and (b), why do you need admin rights to use it?
As for (a), the only comfort, although not fully realistic (as we can create hash collisions and fake hashes), is that, apparently, it was compiled back in 2008/9 by Microsoft. But has gone under all sorts of different names, since.
Some other names:
The last and most important criticism is, why do you need to download and install several 100's of drivers to Arduino boards that you will most likely never use? All without informing or giving consent to/from the user. Nor is there any reasonable explanation. This is an extremely ignorant and dangerous breach of standard security guidelines.
per1234 commentedon Nov 24, 2024
The source code is proprietary. It is locked away on Microsoft's internal server, only available to Microsoft's developers.
Because it is installing drivers and doing that requires elevated permissions.
Surely there aren't hundreds? You can see them here:
https://github.com/arduino/ArduinoCore-avr/tree/master/drivers
The drivers are installed so that the user's computer will recognize the serial port of their Arduino board when they connect it to their computer with a USB cable. We do this automatically in order to make the learning curve less steep. If the user was forced to manually install a driver to get their board to be recognized before they could even get started with the fun Arduino stuff, this would make it significantly less accessible to casual beginners. If you don't believe me, do a search on your favorite search engine for
arduino ch340 driver
to see examples of bad first experiences that are suffered when beginners are forced to install drivers themself (cheap derivative boards often use the WCH CH340 USB chip).If you don't feel comfortable with it, simply don't give DPInst permissions. You will need to manually install any missing drivers that are required for your board.