NI Package Manager Error -125440 Occurred While Running the Custom Execute

Updated Nov 13, 2023

Reported In


  • Package Manager

Issue Details

  • When I try to uninstall a package (.nipkg) that includes a pre-uninstall action, I get the following message Error -125540: An error occurred while running the custom execute queue 'pre'.
  • I'm unable to uninstall a package as my custom execute action is hanging.


IMPORTANT: This section contains steps that tell you how to modify the NI Package Manager database. However, serious problems might occur if you modify the database incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the database before you modify it. Then, you can restore the database if a problem occurs.

To resolve this error, follow these steps:
  1. Close NI Package Manager (NIPM).
  2. In order to have a backup, copy the following database file using Windows Explorer to some other folder: C:\ProgramData\National Instruments\NI Package Manager\Agents\file\installed.dat.
  3. Download the third-party tool DB Browser for SQLite. Choose the 64-bit Windows version and install it using the default options.
  4. If DB Browser is launched during the installation, close it.
  5. Go to the Windows Start Menu, find DB Browser, right-click on it, and choose Run as administrator. DB Browser must run as administrator because the NIPM database is in a secure directory that requires administrative privileges.
  6. In DB Browser, navigate to File>>Open Database... and open the following file: C:\ProgramData\National Instruments\NI Package Manager\Agents\file\installed.dat.
  7. Click on the Browse Data tab, and in the Table dropdown, choose Package.
  8. Scroll through the rows, and look in the PackageName column to find the name of the failing package. For that row, copy the PackageKey identifier to the clipboard. You can also type in the Filter field below that column to narrow down the list. In the following example, row number 10 corresponds to the faulty "ni-foo"  package.
  1. In the the Table dropdown, now choose CustomAction.
  2. In the Filter field under the PackageKey column, paste in the PackageKey identifier you copied in the above step.
  3. You will now only see the CustomExecutes for that package, and the FileName column has the executable name that it would run.
  4. Click on the number of the row to the left that has the problem, and click on the Delete Record button on the upper right. Here is an example for the 'ni-foo' package.
  1. Select File>>Write Changes to save your changes, then exit DB Browser.
  2. Run NIPM again, choose the package you want to uninstall, and it should succeed because the CustomExecute is skipped.

Additional Information

If you realize that you edited the database incorrectly, then use Windows Explorer to restore the original installed.dat file from the file you backed up in the second step, and repeat the above procedure.