NI Package Manager (NIPM)

cancel
Showing results for 
Search instead for 
Did you mean: 

Remove all NI packages

FWIW, I just found a scenario where I wanted to remove everything (except for NIPM). I saw (and kudoed) the idea exchange post for it but needed a solution in the short term. In case anyone else finds themselves in this scenario, I did the following using powershell and a bit of excel/notepad++ trickery. (There's probably a cleaner way, and you could easily write a VI to do this, but I /hope/ I don't have to do it again, so I just brute-forced it.)

 

1. Run the following:

PS C:\Program Files\National Instruments\NI Package Manager> .\nipkg.exe list-installed | Out-File c:\temp\packages.txt

2. Open packages.txt with excel and sort on first column
3. Delete all other columns; save it (still as a .txt file)

4. Open the text file in notepad++ or similar; replace all \r\n sequences with a single space
5. Copy that entire string in to the clipboard
6. Use the following command

PS C:\Program Files\National Instruments\NI Package Manager> .\nipkg.exe remove -y -v --allow-uninstall <your string here>

7. You'll probably be greeted by one of two things:

 

  • First, you might get a message saying the command is just too long. In that case, grab a portion of the string and just rerun the command with a subset of the packages.
  • You will also get the following:
Conflicting requests.
Solution 1:
- Cancel removal of 'ni-package-manager'
Conflicting requests.
Solution 1:
- Cancel removal of 'ni-package-manager-deployment-support'
Conflicting requests.
Solution 1:
- Cancel removal of 'ni-package-manager-released-feed'
- Cancel removal of 'ni-package-manager-released-feed'
Conflicting requests.
Solution 1:
- Cancel removal of 'ni-package-manager-upgrader'
  • Go back to the text editor and remove the packages that it suggests from the string.
  • Rerun.
--------------------------------------
0 Kudos
Message 1 of 3
(3,981 Views)

Hi Chris,

 

See my latest comment on the idea exchange post. 🙂

 

APena_0-1575580748038.png

 

Thanks. 

 

Aaron Peña

Product Owner, Package and License Management

National Instruments

Message 2 of 3
(3,967 Views)

As for the steps from 1 to 5, if you are using WSL/WSL2/GNU tools (windows version),

then you can get that long string by executing,

 

$ /mnt/c/Program\ Files/National\ Instruments/NI\ Package\ Manager/nipkg.exe list-installed | awk '{print $1}' | sed ':a;N;$!ba;s/\n/ /g'

 

0 Kudos
Message 3 of 3
(3,555 Views)