NI Package Manager (NIPM)

Showing results for 
Search instead for 
Did you mean: 

[Package Builder] Custom Execute "options" and quote support issue

Ok, so I've been banging my head against the wall for a while on this and am about to throw in the towel, as I'm not sure what I'm missing...


I have an NIPB build where i'm calling a custom created .bat file which takes some arguments (was hoping this .bat file would be a "reuse" file for some other builds...)


However, some of the arguments require quotes ("argument").


I've tried this a few different ways, but it seems that when you include the quote character (") in the build spec, NIPB for some reason saves this as (&quot) in the instructions file, and subsequently tries to call command line with that escaped character.


The article here:

Suggests i'm doing things correctly.


But it's clearly not working correctly.  In order to "fix" the situation, I had to manually manipulate the custom action database as described here:


When doing this, it definitely highlights the issue...


An NI created custom execute looks like this: 



One created using NIPB looks like this:



While the NIPB build looks like this:




A workaround is to build the arguments directly into the .bat file I'm calling... however I'd say this is pretty undesirable from a reuse perspective...


0 Kudos
Message 1 of 3


I believe you are hitting the following known issue from "NI Package Builder 20.6 Known Issues":

Bug Number: 1461850

Custom executes error during installation when arguments contain quote characters
Package Builder incorrectly creates the instructions file for a package when the arguments for a custom execute contains quote (") characters. The custom execute fails when Package Manager executes the command because quote characters are incorrectly expanded as "&quote;".
For example, configuring a custom execute to call a batch script as shown below returns the error "The executable returned error '1' after running the custom execute command."
Root: [System (32-bit)]
Relative Executable Path: cmd.exe
Arguments: /c ""%Program Files_64%\MyScriptFile.bat" "parameter 1" "parameter 2""


Downgrade to and build the package using Package Builder 20.5.


Reported Version: NI Package Builder 20.6

Resolved Version: N/A

Added: Jul 13, 2021

Scott Richardson
National Instruments
0 Kudos
Message 2 of 3

Yup... that sounds right.

Good to know it was already reported... must have missed that when I was scanning through those.

0 Kudos
Message 3 of 3