01-05-2024 02:43 AM
Hey there.
I guess it's gonna be cross-posting from here, because I couldn't figure out where to post in the first place.
I'd like to set up a docker container for my test application, that needs a https://www.ni.com/en/support/downloads/drivers/download.ni-daq-mx.html#494676 driver package. For that I need to install it from command line.
I figured that I need NIPM, but there is no README on how the installer is supposed to work neither on the download page, nor in the downloaded package itself. I finally was able to google this article https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000g18jSAA&l=en-GB , which was supposed to give me what I need, but alas, more questions...
First of all, the approach in the article leaves a lot to figure out for the user, like mounting the image on windows, for example (it's not that straightforward as in Linux).
Secondly, it assumes that I'm supposed to run it in cmd, but I have a powershell in my container. Thus the command
start /wait Install.exe --quiet --accept-eulas --prevent-reboot doesn't work any more.
I came up with something like this:
`Start-Process -FilePath "${driverLetter}:/Install.exe" -ArgumentList "--quiet --accept-eulas --prevent-reboot" -PassThru -Wait`,
but this also doesn't work, because '-Wait' in 'Start-Process' waits for the whole process tree to be finished, but I see in the task manager that NI Error Reporting Server is still running. Only when I kill it manually, my command returns.
I tried to work around it with
`Start-Process -FilePath "${driverLetter}:/Install.exe" -ArgumentList "--quiet --accept-eulas --prevent-reboot" -PassThru | Wait-Process`,
but it returns immediately, I assume because the Installer spawns another process for the installation.
And the last part of my rant, I couldn't find how to uninstall NI Package manager from the command line. Another article mentioned to contact the support if I don't have access to "Add / Remove Programs" in the control panel.
What would be the proper way to address my issue and install the driver package in the container?
01-05-2024 11:03 AM - edited 01-05-2024 11:06 AM
You might find my Dockerfiles at https://github.com/oist/LabVIEW_Dockerfiles illustrative.
In particular, the "Base NIPM" file downloads and installs NIPM, along with Git, 7z and Powershell 7 (you can just remove any you don't need or comment out).
The URL for NIPM is an arg, so you can pick a newer version if required.
Copying directly for the tl;dr: (where nipm_installer.exe is the file I download)
Start-Process -wait .\nipm_installer.exe -ArgumentList '--passive','--accept-eulas','--prevent-reboot' ;
01-10-2024 01:31 AM
Thanks for your help
I used it as an inspiration to make my container working. This is what I came up with:
Thanks for your help
I used it as an inspiration to make my container working. This is what I came up with:
ARG 7z_Url="https://www.7-zip.org/a/7z2107-x64.exe"
RUN `
$ProgressPreference = 'SilentlyContinue'; `
$ErrorActionPreference = 'Stop'; `
Invoke-WebRequest -Uri $env:7z_Url -OutFile 7z-installer.exe ; `
Start-Process -wait .\7z-installer.exe -ArgumentList '/D=C:\7zip', '/S' ; `
Remove-Item 7z-installer.exe ;
# Download NI packages
RUN Invoke-WebRequest -Uri https://download.ni.com/support/nipkg/products/ni-d/ni-daqmx/23.8/offline/ni-daqmx_23.8.0_offline.iso -OutFile NIPackageManager-installer.iso
# Install NI packages
RUN mv NIPackageManager-installer.iso ni-installer.zip; `
c:\7zip\7z.exe x .\ni-installer.zip -oni-installer; `
Start-Process -FilePath cmd.exe -ArgumentList \"/c start /wait c:\ni-installer\Install.exe --quiet --accept-eulas --prevent-reboot\" -PassThru | Wait-Process; `
rm .\ni-installer -r -force; `
rm .\ni-installer.zip