Shaun Hayward Posted August 7, 2011 Report Share Posted August 7, 2011 So, I have a tricky, but theoretically simple goal... I would like to ensure that when I build packed library (or any other format of plugin / source distribution), that the build version is set to the same number of my top level library. This way, both within and outside labview I can have everything see the correct version number. Right now, I have to remember to set bot the lvlib/lvclass version number before running my build, so I started thinking "there must be a better way". I got a chunk of the way there, using various property nodes, and a Pre-Build VI, but I seem to be missing a few pieces of the puzzle. I have attached one of my attempts, in the hope that maybe one of you guys might be able to help me get to my goal here (I'm also open to tackling the problem from the other side, getting the build spec version and making the lvlib match) Shaun Pre-Build Action (attempt 1).vi Quote Link to comment
jgcode Posted August 7, 2011 Report Share Posted August 7, 2011 So, I have a tricky, but theoretically simple goal... I would like to ensure that when I build packed library (or any other format of plugin / source distribution), that the build version is set to the same number of my top level library. This way, both within and outside labview I can have everything see the correct version number. Right now, I have to remember to set bot the lvlib/lvclass version number before running my build, so I started thinking "there must be a better way". I got a chunk of the way there, using various property nodes, and a Pre-Build VI, but I seem to be missing a few pieces of the puzzle. I have attached one of my attempts, in the hope that maybe one of you guys might be able to help me get to my goal here (I'm also open to tackling the problem from the other side, getting the build spec version and making the lvlib match) Shaun Hey Shaun I have an API for interacting with the project, I do similar things with builds for exes and installers so I thought I'd give PPL a go and see if it works. I was able to get it to go however, I don't use the AppBuilder_API (I have never really), instead I use PN's and set the XML tags. You should be able to replicate from this quick video: <object id="scPlayer" width="1150" height="815" type="application/x-shockwave-flash" data="http://content.screencast.com/users/jgcode/folders/LabVIEW%202010/media/37d3ee95-c471-4465-b73f-86cb2417a0c4/jingswfplayer.swf" > <param name="movie" value="http://content.screencast.com/users/jgcode/folders/LabVIEW%202010/media/37d3ee95-c471-4465-b73f-86cb2417a0c4/jingswfplayer.swf" /> <param name="quality" value="high" /> <param name="bgcolor" value="#FFFFFF" /> <param name="flashVars" value="thumb=http://content.screencast.com/users/jgcode/folders/LabVIEW%202010/media/37d3ee95-c471-4465-b73f-86cb2417a0c4/FirstFrame.jpg&containerwidth=1150&containerheight=815&content=http://content.screencast.com/users/jgcode/folders/LabVIEW%202010/media/37d3ee95-c471-4465-b73f-86cb2417a0c4/Build%20PPL%20Build%20Spec.swf&blurover=false" /> <param name="allowFullScreen" value="true" /> <param name="scale" value="showall" /> <param name="allowScriptAccess" value="always" /> <param name="base" value="http://content.screencast.com/users/jgcode/folders/LabVIEW%202010/media/37d3ee95-c471-4465-b73f-86cb2417a0c4/" /> Unable to display content. Adobe Flash is required. </object> 1 Quote Link to comment
ShaunR Posted August 7, 2011 Report Share Posted August 7, 2011 Hey Shaun I have an API for interacting with the project, I do similar things with builds for exes and installers so I thought I'd give PPL a go and see if it works. I was able to get it to go however, I don't use the AppBuilder_API (I have never really), instead I use PN's and set the XML tags. You should be able to replicate from this quick video: That's sweet. I'm not a great fan of the app builder API either. At what point does the build.vi get executed? Is it run whenever you create a new project? (wasn't clear from the video which I had to scroll around to see...lol) Quote Link to comment
jgcode Posted August 7, 2011 Report Share Posted August 7, 2011 That's sweet. I'm not a great fan of the app builder API either. At what point does the build.vi get executed? Is it run whenever you create a new project? (wasn't clear from the video which I had to scroll around to see...lol) In the video the build script gets run @ 0:30s mark - its when the VI comes into focus (and I hit run but unfortunately it was to the left, offscreen). Typically, you would run a build script like this anytime you want to create a build. The script will handle e.g. synchronizing an exe's version to an installer(s) version or maybe run tests, move files around to handle 2009's new layout and error 6 (which has been fixed in 2011!) etc... 2010 released a feature where you can code pre/post build action VIs, I haven't checked these out in too much detail, and I already used to using a script Quote Link to comment
Shaun Hayward Posted August 8, 2011 Author Report Share Posted August 8, 2011 Thanks! That's great - I was looking into the tags, but could not see the fix/build numbers, so wasnt sure if I was in the right place (In the end, I'm presuming they were not there as those numbers are currently 0). I'll give that a try this morning and see how I get on- thanks again! Quote Link to comment
Shaun Hayward Posted August 8, 2011 Author Report Share Posted August 8, 2011 That worked great! Thanks again for the pointer... In case anyone else is interested, here's my code for use with a Pre-Build action for a Packed Library (It makes the presumption of the 1st top-level VI being the library to extract the version number from). BuildSupportAction.zip Quote Link to comment
jgcode Posted August 8, 2011 Report Share Posted August 8, 2011 Thanks! That's great - I was looking into the tags, but could not see the fix/build numbers, so wasnt sure if I was in the right place (In the end, I'm presuming they were not there as those numbers are currently 0). No probs, glad you got your script to work - and yes that is correct, those tags are not included if value == 0. Quote Link to comment
Shaun Hayward Posted August 8, 2011 Author Report Share Posted August 8, 2011 Dammit... I spoke to soon - the build spec does get updated in the Pre-Build VI, but it only comes into affect on the NEXT build (so when I was testing it seemed to be working, as I was running it all over and over again ) I bet if I made a stand alone builder (like yours) it would all work, but trying to hook into the regular build action seems to be a failure (in this case) ...If only there were a way to get the ref to the running build spec... Quote Link to comment
jdunham Posted August 8, 2011 Report Share Posted August 8, 2011 Dammit... I spoke to soon - the build spec does get updated in the Pre-Build VI, but it only comes into affect on the NEXT build (so when I was testing it seemed to be working, as I was running it all over and over again ) I bet if I made a stand alone builder (like yours) it would all work, but trying to hook into the regular build action seems to be a failure (in this case) ...If only there were a way to get the ref to the running build spec... Yes the building build spec runs in a different application instance. Maybe you can get your prebuild action to spit out a ref to its own application. Quote Link to comment
jgcode Posted August 9, 2011 Report Share Posted August 9, 2011 Dammit... I spoke to soon - the build spec does get updated in the Pre-Build VI, but it only comes into affect on the NEXT build (so when I was testing it seemed to be working, as I was running it all over and over again ) I bet if I made a stand alone builder (like yours) it would all work, but trying to hook into the regular build action seems to be a failure (in this case) ...If only there were a way to get the ref to the running build spec... I haven't checked your new script, and this is just off the top of my head, but if the Pre-Build VI saves the Project, does the change persist for that time its run? Quote Link to comment
crelf Posted August 16, 2011 Report Share Posted August 16, 2011 Posted to the LabVIEW Idea Exchange: http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Add-an-option-to-set-the-version-of-an-installer-to-the/idi-p/1671514 Quote Link to comment
luissimm Posted June 11, 2014 Report Share Posted June 11, 2014 I know this topic is a little old, but I'm working on it now. I tried doing that by API Class and I used Shaun code, both respond the very same way. (updates the version always on next build). Could someone help me? Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.