01-17-2022 09:12 PM
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 (") 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:
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...
01-18-2022 12:08 PM
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 ""e;".
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
01-18-2022 12:29 PM
Yup... that sounds right.
Good to know it was already reported... must have missed that when I was scanning through those.
07-21-2022 11:55 AM
@Scott_Richardson was this fixed in the 22Q3 build?
07-22-2022 02:37 PM
Hi Chris, yes the bug mentioned in this thread had been fixed, see 1461850 listed on NI Package Builder 2022 Q3 Bug Fixes.