How Do I Include The File Structure In A Build

Updated May 19, 2021

Reported In

Software

  • LabVIEW

Issue Details

How do I include the Project Explorer folder/ sub-folder structure once I build the Application (EXE)?

Solution

During the build of an Application (.EXE) the structure cannot be replicated, this is because when building a Application (.EXE) the files needed to run the Application are all placed into the same folder, from the example above during the compiling process the VIs (Demo 1.vi & Demo 2.vi) and the Text file (Documented Code.txt) are all placed as one single file. 

For those looking at creating additional sub-folders, for files during the build of an application please see here.

Additional Information

When building an Application (.EXE) from the host computer the Application will automatically link the LabVIEW Libraries required for the Application. If the Application is built for another computer to use, it is advised you create an Installer which includes the necessary files needed to run the Application. 

Please Note

When using the Always Included option in the Source Files when Building an Application, Selecting the main folder will NOT allow you to use the files within the folder as a Startup VI. This is because the files will ultimately be duplicated. To avoid this place the Startup VIs in the main folder and include the remaining folders, please see below:

 



When having some cross-linking references and adding these elements to the Always Included section, then you can face Error 7 at Open VI Reference for a Stand-Alone Application when trying to find files by path inside the executable. For example, in the previous example, let's assume that Demo 2.vi uses a VI from a Library that belongs to a second project. This library is called Library.lvlib and the VI used by Demo 2.vi is called Lib_VI_1.vi. This library was added to Folder 4 as shown below:


If Folder 2 is added to the Always Included section, then a new hierarchy level will be added inside the executable. The Application Builder will include all the required files inside a top-level folder, which name will be the same as the folder where your project is located. For example, if the Untitled Project 1.lvproj is located on ProjectFolder then the path to find Demo 1.vi inside the executable will be the following:
 

  • ...MyApp.exe/ProjectFolder/Test/Folder 1/Demo 1.vi
If Folder 2 is not added to the Always Included section, then the path for Demo 1.vi is: 
  • ...MyApp.exe/Test/Folder 1/Demo 1.vi

The file structure created inside the EXE is dependent on the file structure on the disk, not the virtual folder structure inside the LabVIEW project. If you want to make your first path to work, then you should have a disk file structure as the following: