LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Auto-detect if Run-Time Engine is required, then install it.

Solved!
Go to solution

We use a company wide LabVIEW App that exists as a single .exe file on a shared drive.  If I need to fix a bug, I then create a new .exe file with the same name and everyone's link to the exe continues to work as before.

At present, if someone new joins the company, it does not work for them because they do not have Run-Time-Engine on their PC.  I have to instruct them to download and install the correct version Run-Time-Engine to get them up and running.

Is it possible to create a file that looks like MyApp.exe but also has Run-Time-Engine installer included.  When the user tries to open the .exe, they get a message stating that Run-Time-Engine is required and they can accept/reject the installation of Run-Time-Engine to their PC.

Note that I do not want MyApp.exe installed to their PC.

If the LabVIEW Professional Development System does not support this, are there other third-party apps that can achieve it?

 

0 Kudos
Message 1 of 11
(1,510 Views)

One obvious difficulty here is that your app would need the run-time engine to run, which forms a chicken and egg problem.

 

To handle that, you can either try running a separate program (Python, .NET, batch file, etc.) or you could try having a local copy of the RTE, as shown here: https://forums.ni.com/t5/LabVIEW/Combining-run-time-engine-into-the-executable-not-installer/m-p/425...

 

This might work for what you need (and it might even work for your full program, not requiring the install at all), but it's not supported, could stop working and there are certain things which already won't work there.

 

As for detecting whether the RTE is installed, you could probably run the EXE, but then you would get the missing RTE popup and I'm not sure you would get an error popup.

 

You could try using the registry. There are registry VIs shipping with LV (which may or may not work with the self-contained RTE and may or may not require admin permissions) and it should be possible with a batch file too. I'm not sure what you would look for, so that would require some searching.

 

You could probably check if the LVRT DLL is found where it's supposed to go (National Instruments\Shared\LabVIEW Run-Time), but that would also depend on version, bitness and whether it was installed to the default location.

 

 

Assuming you managed all of that, if your small app finds the RTE, it launches your real app. If it didn't, it runs the installer for the RTE, which you would need to save next to it (possibly silently, which I believe you can do with some switches). I would not be surprised if you need to run a batch file, wait and exit your EXE before installing the RTE.

 

Overall, this seems like a pretty complex process with a bunch of things that can go wrong. It might be simpler to just have a readme pointing them to the RTE or explaining it to them directly. If you want to have the RTE, you can download an installer from NI or you can create an installer in LV which doesn't have an EXE, but does include the RTE in the additional installers.


___________________
Try to take over the world!
Message 2 of 11
(1,470 Views)

Thanks for the response, the chicken and egg launch problem would mean the wrapper needs to be something other than LabVIEW.  At present I have the offline installer in a sub-folder of the App, a ReadMe.txt file instructs the user how to install RTE for themselves.

I'm not desperate enough to go to great lengths to achieve it, just hopeful there was some user-friendly App out there that creates a wrapper for you.

Asking the IT department to include the RTE as part of the standard company PC build is another option.

0 Kudos
Message 3 of 11
(1,465 Views)

Hi,

 

After you generate the EXE file you generate an installer. The installer will install all necessary packages including the run-time.

If the run-time is already present the installer will skip that step.

I also use 7ZIP to create one EXE file as an installer. 

 

If the user run this EXE (created with 7ZIP) it will automatically unpack the installer files and will run the installer file you specified.

This way I only have to distribute one file with no worries about the run-time version

 

Kees

0 Kudos
Message 4 of 11
(1,439 Views)
Solution
Accepted by bmann2000

Our IT guy figured out an acceptable solution.  We created a PowerShell exe called MyApp.exe, when the user double clicked the PowerShell exe, it appeared they were opening MyApp.exe LabVIEW App, but in fact they were running a PowerShell.exe.  The PowerShell exe tested to see if LabVIEW RTE was installed, if TRUE, it launched the real MyApp.exe LabVIEW app.  If FALSE it prompted the user to accept an install of RTE.  It works really well.

Message 5 of 11
(1,342 Views)

@bmann2000 wrote:

Thanks for the response, the chicken and egg launch problem would mean the wrapper needs to be something other than LabVIEW.  At present I have the offline installer in a sub-folder of the App, a ReadMe.txt file instructs the user how to install RTE for themselves.


Ah-Hah!  Therein lies the obvious work-around.   Simply rename ReadMe.txt to one of these suggested names;

  • DoNotReadMe.txt
  • NSFW.txt
  • Porn.txt
  • Etc...

No one reads a file named ReadMe


"Should be" isn't "Is" -Jay
Message 6 of 11
(1,329 Views)

In a similar vein, if you need to check a VI to be dynamically loaded, you can use the attached.

0 Kudos
Message 7 of 11
(1,305 Views)

@bmann2000 wrote:

The PowerShell exe tested to see if LabVIEW RTE was installed


What's the actual test performed by the script to see if the RTE is installed? This could help people who want to do this in the future.


___________________
Try to take over the world!
0 Kudos
Message 8 of 11
(1,284 Views)

The check is, does folder exist:

C:\Program Files\National Instruments\Shared\LabVIEW Run-Time\YYYY

We also found a way of checking using a registry key, but decided the path method would probably be more reliable across different PCs.

0 Kudos
Message 9 of 11
(1,257 Views)

You can check if your required version shows up in the list from this command.

 

 

Get-ChildItem "HKLM:\SOFTWARE\National Instruments\LabVIEW Run-Time" | Get-ItemPropertyValue -Name "Path" | Get-ChildItem -Filter lvrt.dll | Get-ItemPropertyValue -Name VersionInfo | Format-List -Property FileName,FileVersion

 

0 Kudos
Message 10 of 11
(1,249 Views)