From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

application builder - programatically updating version and adding .msi to the pre-build to install CUDA

Solved!
Go to solution

Hello all!

Two questions regarding the application builder:

1) Is there a way to programattically set the version #? I use SVN for my version control and I would like the output of an "svn status" which shows the version to automatically update the build specification to the new version.

2) I noticed that it's possible to run .bat's and .exe's as a pre and post install. How about a .msi? I know the .msi blocks some installations so I couldn't tell if this was an issue or not. I need to install CUDA alongside my application and would like all of it to go in the same installer.

 

Thanks for the help!

0 Kudos
Message 1 of 6
(3,704 Views)

Don't know abouit 1), but about 2) make a .bat that calls your msi. Windows knows the filetype so this will have the effect of running your msi file. 

0 Kudos
Message 2 of 6
(3,701 Views)

I gave that a shot. I checked that the .bat will call the .msi outside of the installer and everything looked good. However, when I added the .msi and the .bat file to the build and configured the installer to call the .bat in the "post-install" step I saw the command window flash up and then nothing.

 

My first guess is that the installer had no idea where to look for my .msi (i.e. they are not in the same directory even though they are in the project file. Possibly it has been renamed). I tried a separate .bat with only the line "echo Your text here >> C:\Users\Public\textfile.txt" and that worked fine, so I know I am adding the .bat correctly.

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

Hi ColeVV,

 

If build your installer and include a .bat file in the "post-install" step in the method that you have previously mentioned, Then you can copy the .msi into the installer folder that is generated (by building the installer). Then as long as you used relative addressing in your .bat file, it should find and run the .msi at the end of your installation.

Evan See
National Instruments
0 Kudos
Message 4 of 6
(3,663 Views)
Solution
Accepted by topic author ColeVV

I ended up calling NI support and got some excellent feedback there.

 

Regarding programmatically changing the version I obtained this response

----------------------------------

If you navigate to the path C:\Program Files\National Instruments\LabVIEW 2012\vi.lib\AppBuilder, you will find a set of VIs that allows us to build applications programmatically. There is no documentation but the descriptions shown in the Context Help. I tried using the BuildTargetBuildSpecification.vi, but in one of the descriptions, it states that you first need to configure the properties from the Build Specification Dialog Box. These are the references I mentioned you over the phone.

Programmatically Build Applications in LabVIEW
http://zone.ni.com/devzone/cda/epd/p/id/5051

Programmatically Build Specifications Lavag.org
http://lavag.org/topic/10643-programmatically-modifying-buildspec/

Following the instructions on the forum, I configured a small VI that shows all the application hierarchy until we get to the Build Specifications properties and methods. It looks like calling the XML file for the project in conjunction with these properties should allow you to set values for the properties. I also added a method node that should allow setting tags in the Build Specifications.

-------------------

Regarding the .msi, I was not using the relative paths correctly. These directions ended up solving the issue for me.

------------------

 

You can include 3rd party installers in the LabVIEW installer following the next steps. For .msi installers, you will have to create a batch file first in order to run the .msi installer.
Add the executable (.exe, .bat) for the installer into the LabVIEW project by right-clicking in My Computer. I suggest adding the whole folder containing the installer just to make sure you included all the required files for setup.

When you build the application, add these files into the ‘Always Included’ section in the Source Files category.

When you build the installer, the files should be included when you add the application in the Source Files page.
In the Advanced tab in the installer, click on the ‘Run executable at end of installation’ box and select the 3rd party installer from the Source Files options.

Please a take a look at these articles for information on how to set a batch file and running executables after installation.

Creating a Batch File
http://digital.ni.com/public.nsf/websearch/B2640E34C4654F7B86256D07006D843D

How Do I Make My LabVIEW-Built Installer Run an Executable After Installation?
http://digital.ni.com/public.nsf/websearch/9564f80c4debc4508625656900661050

Running a Batch File Automatically After an Installation to Access Installer Files
http://digital.ni.com/public.nsf/allkb/99632C017ABD96C286256DDE006121C9?OpenDocument

-----------------

 

I have tested the .msi solution, which worked great, and am about to test the first solution. I expect it will work as well.

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

Hi,

 

Can you please share the sample batch file what you prepared and added to your project.

 

I searched a lot and couldn't able to get any example batch file to use in LabVIEW installer.

 

Regards,

Raagul.

Rocky
0 Kudos
Message 6 of 6
(2,524 Views)