LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LV2013 Post Build Action Fails

I am trying to have a post - build VI move the ini file that labview places in the /data directory on build, into the same directory with the .exe file.

 

I am including that VI into the project that I am creating the build from (is that the problem?) and assigning the Destination ( I have tried both the .exe destination and the support folder destination)

 

Now on the Inclusion Type - it says include if referenced, so I don't know if it's getting omited, because the complier thinks it's not referenced?  I don't see a way to force include it.

 

The VI does NOT execute though.

0 Kudos
Message 1 of 13
(2,690 Views)

I have also tried the 'always included option' with the same result

0 Kudos
Message 2 of 13
(2,686 Views)

@rsmrostov wrote:

I am trying to have a post - build VI move the ini file that labview places in the /data directory on build, into the same directory with the .exe file.

 


What flavor of Build specification?  for an application build (I'm assuming that is what you mean) the "MyApplication.ini" is directed to the same location as "MyApplication.exe"

 

You have another file that you would want to use?  Choose use custom configuration file on the advanced build spec property page.

 

Other than that my 8-Ball is overheating this morning so you'll need to be a bit more specific.


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 13
(2,681 Views)

I do not use .ini files, I use XML files as INI files, to pre-set all the controls on the FP to the last known condition.

0 Kudos
Message 4 of 13
(2,673 Views)

This is begining to make more sense but let me try to restate it.

 

In your project you have a *.xml file that is set to always incuded with source file settings destination in the support diectory <MyApp>\Data\MyFile.xml after build on disk right?

 

Then you have a vi in the project that moves a file from <MyApp>\Data\MyFile.xml to <MyApp>\MyFile.xml. that "should" execute after build but, you are having issues where you do not find <MyApp>\MyFile.xml when you explore into the build.

 

Have I gotten it right?

 

There are many ways I would do this differently because the absolute path to file is easilly knowable in the dev enviornment and the relative path is selectable in the runtime enviornment AND the installer operator (that human idiot actually running the installer) can chose an alternate absolute destination during install.  That moving a file in the build destination post build seems unnecessary and fragile anyway.

 

 But, if you don't screw-up the path of the vi on disk (source code vi not subvi in build) relative to the build destination it "Should" work run the vi and move the file.

 

Without a sample project I can't see what you are doing wrong exactly.  There are a lot of possibilities for confussing yourself here (as I hope I pointed out)


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 13
(2,664 Views)

yes, we are on the same page now.   I always use application directory to get the position of the xml.ini progrommaticaly, and data directory doesn't exist in my project; therefore, at post-build I just wanna go to the location of the xml.ini and move it to the application directory.  The vi itself works, I have placed it in the directory, ran it and it has moved the xml.ini where it was supposed to. 

 

The question here is - how to specify the position of that vi (the one that does the posb-build) in the project, so it runs (I believe it doesn't run, since if it did and didn't find the xml.ini it's supposed to spit an error / per post build definition by NI)

I went as far as specifying this post build.vi as always included in the Source Files option of the Build Properties, and specified it's location - support directory in the Source File Settings (and it is placed in the 'data' folder).  So when I run the vi that is placed there it goes ahead and moves the XML.ini file, but it won't do it pos build.

0 Kudos
Message 6 of 13
(2,657 Views)

that's what the post-build vi does

0 Kudos
Message 7 of 13
(2,654 Views)

Major edit

 

Whoa, you are copying a file to a path not a file name.  you need another build path in there specifying what to name the new file or you will throw an error

Capture.PNG

 

Of course with automatic error handling off in the vi properties (like a good sub-vi) you'll never see that error


"Should be" isn't "Is" -Jay
Message 8 of 13
(2,649 Views)

you are my star, this works!  wonder why my take failed....

0 Kudos
Message 9 of 13
(2,643 Views)

Better n better! LOL after the major edit.

 

My guess is that the build isn't quite "Saved" to disk and the app directory is not a path like when the project is not saved.  Or the post-build is being called via a proxy that has an odd default app directoy.  the abs path should be used here since LabVIEW is tossing that value in from the build spec

 

For those playing along (And this is going into funny threads isn't itSmiley Embarassed)

I originally posted:

"try This"

!1-1.png

because I thought I was right---- Then, sure I was mistaken I did a major edit to the post and confussed myself by attempting to move the file twice (getting an error) to find out I was wrong because I was right in the first place but made a mistakeSmiley Very Happy

 

So, try not to laugh too hard at me when you come across this post in the future.


"Should be" isn't "Is" -Jay
0 Kudos
Message 10 of 13
(2,638 Views)