In a NI Package Manager-based installer, I need to run batch commands. How can I implement that in my packages?
In NI Package Builder, you can add batch files to your target and use Custom executes to run those files. Follow these steps:
(1) Create your batch file yourbatchfile.bat (or similar)(2) In NI Package Manager, add your batch file to your Inputs
(3) Add your batch file to your package via Drag-and-Drop. This way it will be installed to the target with the package.
(4) Next, advice your package to run Custom executes. In NI Package Builder go to the Packages pane. There choose your package. In the Properties of your package, search for Custom executes (this is the last entry) and press …
(4.1) In the Manage Custom Executes Popup, make sure, you choose Post All Install.
Now you are done. Create your package and your installer. The installer will also run yourbatchfile.bat.
Custom executes can be used to run single lines of batch commands without installing a .bat file. Attention: Custom executes do create temporary bat files which are saved to the local %TEMP% folder and executed from there. So you cannot implement admin access with custom executes. If you need admin rights, use .bat files instead (and, for example, put them into the support folder of your software). More on Custom Executes can be found in the NI Package Builder Help: Custom Executes article.
As your NI Package Manager installs packages as admin, your Batch files will have admin rights, too.
Collaborate with other users in our discussion forums
A valid service agreement may be required, and support options vary by country.