LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What does the "Copy error code files" option do in the build spec properties

I have the "Copy error code files" checked for my application build specification but when I run my EXE on a different computer and call the simple error handler, I don't get the custom error from my computer's

C:\Program Files(x86)\National Instruments\LabVIEW 2012\user.lib\errors\User-errors.txt file. Instead I get the "this error code is undefined" explaination.

 

I've also tried including that file in the "always included" section of the build spec but that didn't work either. Am I missing something?

CLED (2016)
Message 1 of 15
(4,583 Views)

Infinite,

 

Check out this link:

http://www.ni.com/white-paper/3209/en

 

Specifically this paragraph:

"When building an executable (EXE) or shared library (DLL) with the Application Builder, make sure to add the custom error file as a support file (under the Source Files tab). For an executable, the custom error file will be saved in the <executable destination directory>\user.lib\errors directory. For a shared library, the custom error file will be saved in the National Instruments\Shared\LabVIEW Run-Time\<version>\Errors directory. When distributing a shared library, make sure to install the custom error file in this directory."

 

 

James K.
National Instruments
Applications Engineer
Message 2 of 15
(4,545 Views)
And I suspect the op did not create an installer that would actually place the error file on the pc.
0 Kudos
Message 3 of 15
(4,540 Views)

That is correct. I am not using an installer. I would like to "copy error code files" so that they are built into the EXE. It's simpler if I don't have to hand out installers everytime I want to patch an EXE. Also, I'd just generally like to know what that checkbox in the build spec properties does.

CLED (2016)
0 Kudos
Message 4 of 15
(4,530 Views)
You can't embed an external file in an exe. As already mentioned, the checkbox creates a copy of your file to be included in the installer.
0 Kudos
Message 5 of 15
(4,523 Views)

So the check box only applies to installers not the application? I think that was the source of my confusion. I was hoping the EXE would look in it's local builds folder which is where the application builder puts the error file if you use the "always include" option.

CLED (2016)
Message 6 of 15
(4,517 Views)
If you don't include the file with an installer, how would the file get to the pc with the exe?
0 Kudos
Message 7 of 15
(4,514 Views)

I was expecting that since I'm using the new error rings, the appliction builder would hard code the error message into the exe. Alternatively, since I used the "always include" option, the exe could check the data folder for my error code file. Either of those options would be preferable to always needing to distribute an installer and installing a new version every time I wanted to update my application.

CLED (2016)
0 Kudos
Message 8 of 15
(4,496 Views)

There is no mechanism for embedding an external file into an exe. If you want to have them as part of the exe, then you can do like the white paper above where it explains how to pass custom codes and messages to the general error handler.

 

The exe does check the appropriate folder for the error code file.

 

I don't understand your objection. You can create one installer for the initial installation of the exe, run time, and all of the other files. Then your updates can be just the file(s) that changed.

0 Kudos
Message 9 of 15
(4,492 Views)

I don't think its unresonable for me to expect that since the text is visible on the block diagram that the text is somehow embedded in the source/exe.

 

If I add an error code, I don't want tell users where to put my new error file or give out a new installer.


I like the general error handler idea but it makes errors with custom text (ie "Com port %d failed") tricky.

 

errros.PNG
Since one of these two methods work well without an external file, there's clearly some mechanism of embedded error info into the source code.

 

CLED (2016)
0 Kudos
Message 10 of 15
(4,489 Views)