How to list files in a LabVIEW 2009 executable app

Posted on Friday 2 October 2009

In earlier LabVIEW versions (prior to LabVIEW 2009), you could list all the VIs inside a built LabVIEW application using the List Folder function.  This is a very useful feature, since you might want to dynamically open VI References or find *.lvclass (LabVIEW Class) files for loading plugins, etc.

List Folder

However, in LabVIEW 2009 this no longer works.  But, there’s still hope.  It turns out that LabVIEW 2009 EXEs are basically just ZIP archives.

And, you can list the contents of LabVIEW 2009 EXE files, programmatically, using the OpenG Zip Tools library, as shown below:

List LV2009 EXE File Contents

Note: The image above is a VI Snippet and you can just drag & drop it into a LabVIEW 2009 block diagram (but, make sure to install the OpenG Zip Tools first). Or, download the VI File, here: List LV2009 EXE File Contents.vi

Voilà! Problem solved :)

I definitely couldn’t live without these handy VIs.


8 Comments for 'How to list files in a LabVIEW 2009 executable app'

  1.  
    Thomas
    October 30, 2009 | 6:51 am
     

    We were not able to list a LabVIEW 8.x exe’s vi’s using list folder. Are you sure you didn’t mean prior to LabVIEW 8.0 you could view vi’s the first way?

  2.  
    October 30, 2009 | 8:29 am
     

    Thomas: Yes, you are probably right. I forgot that they disabled this capability in 8.x.

  3.  
    Ton Plomp
    November 3, 2009 | 12:19 am
     

    In LabVIEW 8.x you need to strip some header part from your executable, the rest is an llb like in the 7.x days.

    Somewhere on Lava is info about this, I just can’t find it.

    Ton

  4.  
    Thomson Tat
    November 6, 2009 | 8:56 am
     

    Couldn’t you just use the “Use LabVIEW 8.x file layout” option when you build the executable instead?

  5.  
    November 6, 2009 | 9:37 am
     

    Thomson: I think that that LabVIEW 8.x file layout will change the structure but not the format. Meaning, it will still be stored in a ZIP format, but it will just be a flat folder with no subfolders.

  6.  
    July 23, 2011 | 8:01 am
     

    Thanks for the article! I had no idea what VI Snippets were until just now and I’m blown away. I’ve got to start doing this. :)

  7.  
    Yair
    July 23, 2011 | 9:59 am
     

    If you like snippets, you might wish to look into the Code Capture Tool, which includes some improvements to them – http://lavag.org/files/file/63-code-capture-tool/

  8.  
    peter
    June 4, 2012 | 2:55 am
     

    Very sad but doesnt work. OpenG Open zip function gives error 7 trying this.

Leave a comment

(required)

(required)


Information for comment users
Line and paragraph breaks are implemented automatically. Your e-mail address is never displayed. Please consider what you're posting.

Use the buttons below to customise your comment.


RSS feed for comments on this post |

 

Bad Behavior has blocked 1127 access attempts in the last 7 days.