NI Package Manager (NIPM)

cancel
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: https://www.ni.com/documentation/en/ni-package-builder/latest/manual/customexecutes/

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: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000YPYfCAO&l=en-US

 

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

 

An NI created custom execute looks like this: 

jyoung8711_0-1642475447381.png

 

One created using NIPB looks like this:

jyoung8711_1-1642475473512.png

 

While the NIPB build looks like this:

jyoung8711_2-1642475507265.png

 

 

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 5
(1,482 Views)

young8711,

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

Bug Number: 1461850
Description:

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""

Workaround:

Downgrade to and build the package using Package Builder 20.5.

Details:

Reported Version: NI Package Builder 20.6

Resolved Version: N/A

Added: Jul 13, 2021

Scott Richardson
0 Kudos
Message 2 of 5
(1,453 Views)

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 5
(1,449 Views)

@Scott_Richardson was this fixed in the 22Q3 build?

--------------------------------------
0 Kudos
Message 4 of 5
(1,187 Views)

Hi Chris, yes the bug mentioned in this thread had been fixed, see 1461850 listed on NI Package Builder 2022 Q3 Bug Fixes.

Scott Richardson
0 Kudos
Message 5 of 5
(1,175 Views)