LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Build Application EXE with file hierarchy intact

Solved!
Go to solution

I've tested my application in development and everything works fine, but on deployment nothing works because paths have changed. I'm using a specific file structure which I can't seem to keep intact during deployment.

 

A few examples are:

Original File Structure: <Application Directory>\Resources\Images\Logo.ico

Post Deployment Structure: <Application Directory>\Data\Logo.ico

 

Original File Structure: <Application Directory>\Benches\A380\Calibration Data\A1.txt

Post Deployment Structure: <Application Directory>\Data\A1.txt

 

I need to keep the Original File Structure intact because I dynamically change paths based on calculated data, if everything gets dumped in to "/data'', nothing is going to work.

 

Am i missing something obvious? This is the first time I've done a deployment to windows (perhaps it shows!)

0 Kudos
Message 1 of 6
(5,229 Views)

Hi LBee,

 

- all "additional" files will be put into the \data-subfolder of your AppDir by default. You may try to change the AppBuilder settings to put files in other folders… (You can easily find this folder by using the AppDir file constant in your executable!)

- you may create the needed file structure on the first run of your executable by programming a "cleanup" routine in LabVIEW…

- you may put the needed files in a ZIP files (using the file/folder structure as is needed) and unzip this file on the first run off your executable…

 

I need to keep the Original File Structure intact because I dynamically change paths based on calculated data,

You can create some error handling in your VI to recreate the needed folders in case they aren't exisiting…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(5,224 Views)

>> I need to keep the Original File Structure intact because I dynamically change paths based on calculated data,

>>> You can create some error handling in your VI to recreate the needed folders in case they aren't exisiting…

The folders will already contain files, these files are being addressed dynamically, the content of the files isn't changing, but referencing by name alone is not good enough as many folders contain the same files, by the same name (so all that's changed is the folder name to address a new file)

 

 >> all "additional" files will be put into the \data-subfolder of your AppDir by default. You may try to change the AppBuilder settings to put files in other folders… (You can easily find this folder by using the AppDir file constant in your executable!)

I find that all folders are stripped and only the files appear in \data. A file at the path <App Dir>\Benches\A380\AI\Sig1\Configuration.txt will end up as data/Configuration.txt

 

>>  you may create the needed file structure on the first run of your executable by programming a "cleanup" routine in LabVIEW…

I'm really trying to avoid this :(, there is potential when this is scaled for a rather huge number of files involved

 

>> you may put the needed files in a ZIP files (using the file/folder structure as is needed) and unzip this file on the first run off your executable…

I'll try this approach first I think

 

I can't help but think that the "Preserve Disk Hierarchy" option should just keep my file structure intact?

 

0 Kudos
Message 3 of 6
(5,208 Views)

I believe the application builder only adds the folders you tell it to put something into.  So you may need to add dummy files into your installer to keep your folders active.


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
Message 4 of 6
(5,199 Views)
Solution
Accepted by Lbee11

After a few hours of messing about now, I've finally got it working.

 

For anyone who runs in to the issue in the future, I had to do the following when creating the application exe build:

  1. In the "Destinations" category, add a new destination for the top level folders that reside in your application directory - for example: If your path is <App Dir>/Folder1/Folder2/Folder3, you only need to create a destination for Folder1
  2. On each new destination, click the Preserve Disk Hierarchy option, make sure it's enabled
  3. In the Source File Settings category, point the top level folders to their matching destinations by clicking "Set destination for all contained items" and choosing the correct destination
  4. In the Source File Settings, click "Dependencies" and set the destination for this to your Application.exe. If you don't do this step, the AppBuilder creates some crazy directories inside your top level folders.

 

As @crossrulz mentioned above, any folders that have no files inside (only subdirectories) are stripped and the files inside are placed instead of the folder. Luckily for me, this didn't matter with that particular folder

Message 5 of 6
(5,191 Views)

I cannot give this enough Kudos, as I had thought that I 

0 Kudos
Message 6 of 6
(3,335 Views)