LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

List "Always included" files in a build

Solved!
Go to solution

Hello,

 

I'm trying to list files included in an executable. In build specifications, I declare "IncludeMe1.vi" as Always included in Source Files. I made this VI, and created an executable:

 

ListIncludedFiles.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

When I run my exe, my problem is this one:

- The CallByReference part works. The VI "IncludeMe1" executes (it only contains DialogBox that appears)

- The Dialog Box shown in this picture (connected to ListFiles) does not show anything.

 

So, why does the List File Function does not return "IncludeMe1" file ? Is there a way to accomplish it ?

 

Thanks in advance

Julien

 

PS: I perfectly know I can use constant strings designating the files I included, but I want to know if it could work dynamically.

 

0 Kudos
Message 1 of 8
(4,097 Views)
Solution
Accepted by topic author julienAu

Julien,

 

it is not possible to list files in the executable (anymore). It was considered to be a security leak and NI intergrated measurements which prohibit exactly this use case.

So it is "working as intended".

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 8
(4,081 Views)

Thanks Norbert !

 

I will add constant values ^^

0 Kudos
Message 3 of 8
(4,079 Views)

Probably because inside of an EXE is not really a folder.  Therefore you can't get the folder contents.  Are you getting an error out of the List Folder function (you may want to wire up your error wires and display any errors)?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 8
(4,070 Views)

yes.. ListFolder Function returns an error. I tried this:

b.jpg

 

And this is the message

a.jpg

 

 

0 Kudos
Message 5 of 8
(4,062 Views)

@Norbert_B wrote:

 

it is not possible to list files in the executable (anymore). It was considered to be a security leak and NI intergrated measurements which prohibit exactly this use case.


Yup I'd say this changed around the 2009 era, maybe 2010.  Another technique worked in some versions, and that was to perform an extraction of the EXE as if it were a zip and that could give you a file list.  Also in some versions treating it as an LLB worked giving a file list of VIs in the EXE.

 

Those days are gone, and the only techniques I found that still work are to predict where the VIs will be within the EXE by looking at the relative path from the project file to the source VI.  Or enable the INI key NI_Appbuilder_logging=TRUE which makes a detailed log file of the build process.  This file will have information in it like what files are included and where they can be found in the EXE.  This file can then be used by the EXE to know more about itself.

Message 6 of 8
(4,040 Views)

Thanks !!

 

I tried to add the "NI_Appbuilder_logging" parameter in the .ini file. It's more complicated than just put ListFolder function (which doesn't work), but your solution do the job ^^ Thanks again !

 

Message 7 of 8
(4,029 Views)

I didn't say it was easy, just that it might work.  I agree that the ListFolder function would be super easy and is a little anoying that it doesn't work anymore.  But to be fair NI never said it was a feature, or ever suggested to a user to use this technique as far as I can tell.

 

EDIT:  BTW give thanks with kudos, and marking solutions.

Double EDIT: Thanks for the kudo

0 Kudos
Message 8 of 8
(4,026 Views)