09-04-2014 06:42 AM
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:
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.
Solved! Go to Solution.
09-04-2014 06:59 AM
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
09-04-2014 07:02 AM
Thanks Norbert !
I will add constant values ^^
09-04-2014 07:07 AM
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)?
09-04-2014 07:17 AM
yes.. ListFolder Function returns an error. I tried this:
And this is the message
09-04-2014 08:22 AM
@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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
09-04-2014 08:44 AM
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 !
09-04-2014 08:46 AM - edited 09-04-2014 08:47 AM
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
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord