02-27-2013 01:39 PM - edited 02-27-2013 01:39 PM
I have multiple small projects that have been done, and oru customer now wants them combined into a single executable, where you'd select which program you want to run and have it be launched. My initial thought was no big deal, create a new VI on which the user selects which program to run, and I just call that main.vi for whichever particular program they selected.
But wait, not so fast.
As soon as the particular smaller programs' main VIs are placed on a block diagram of a VI in this master project, all their dependencies are loaded into the project. Well, a lot of these smaller projects have typedefs with the same name, or even classes with the same name because they were all developed separately. It could be a mess and very time consuming to resolve all these conflicts right now.
I was thinking of doing something "plugin-like" where I include the smaller main VIs in the install, in some folder on disk, and they get called dynamically. Would this work? I have never tried it. Is there a better way?
There is also the idea of shipping multiple executables, and my "master program" calls a particular one using a command line prompt to run the exe.
Thoughts and suggestions appreciated.
02-27-2013 01:45 PM
@for(imstuck) wrote:
There is also the idea of shipping multiple executables, and my "master program" calls a particular one using a command line prompt to run the exe.
This sounds like the simplest solution in your situation. Other options would require managing the dependencies properly, which can be difficult, and seems unnecessary based on your description. It will probably also perform better.
02-27-2013 01:51 PM - edited 02-27-2013 01:52 PM
@tst wrote:
@for(imstuck) wrote:
There is also the idea of shipping multiple executables, and my "master program" calls a particular one using a command line prompt to run the exe.
This sounds like the simplest solution in your situation. Other options would require managing the dependencies properly, which can be difficult, and seems unnecessary based on your description. It will probably also perform better.
Yeah, this felt a little "ugly" but may be best in my case. I also didn't think about the fact that to include the VIs as plugins with my installer, it would require them being in the project, thus bringing me back to square one.
02-27-2013 01:59 PM
Another option which should be simple in theory is setting up each project to build its VI as a packed library instead of an EXE. That way, all the VIs it calls should be fully namespaced and included and you can statically call the main VI in each packed library in your master project.
I have no practical experience with this, but it will mean that single EXE will now have to load copies of all the shared VIs.
02-27-2013 02:01 PM
I agree with just calling the various executables. I was going to say "just throw all of your stuff into a library" until I read that you used classes.
02-27-2013 02:07 PM
@tst wrote:
Another option which should be simple in theory is setting up each project to build its VI as a packed library instead of an EXE. That way, all the VIs it calls should be fully namespaced and included and you can statically call the main VI in each packed library in your master project.
I have no practical experience with this, but it will mean that single EXE will now have to load copies of all the shared VIs.
Hm, this may work. I think I will take the exe approach for now and can adjust as necessary. Either way it's no different for the programmer, they still have to do two builds if a VI changes (the small project, then the main one). The separate exe's also solve the issue of config files which may or may not have the same names I can't remember. This way they are all in their own data directories instead of one top level data directory which could cause issues post-install.
02-27-2013 02:07 PM
You can go with packed libraries as suggested.
02-27-2013 02:10 PM
for(imstuck) wrote:Either way it's no different for the programmer, they still have to do two builds if a VI changes (the small project, then the main one).
If you are just calling the executables, why would the main application need rebuilt? The main should only need rebuilt if another application is added to the list.
02-27-2013 02:11 PM - edited 02-27-2013 02:12 PM
Sorry, installer rebuilt. This way it would include the updated executable to be put on disk when the installer is run.
I'm in a generous mood, the kudos are flying haha.