LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Combining run time engine into the executable (not installer)

Wont be the first time for me that keeping an open-mind (as opposed to your choice of words  - - banging of head) led to success where everyone else thought otherwise 😀  Thanks for your contribution.

[BADGE NAME]

0 Kudos
Message 21 of 29
(1,135 Views)

Share your results!

Rolf Kalbermatter
My Blog
0 Kudos
Message 22 of 29
(1,129 Views)

Your IT department seems to be a misguided lot; that is so sad.  I'm sorry that all I can offer is condolences.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 23 of 29
(1,125 Views)

@blessedk wrote:

Would it be possible at all to combine the run time engine into the same executable?

@rolfk wrote:
You still could copy the whole runtime folder into the executable folder and unless your exe didn't use to exotic drivers and features all was well.

Yes, this is still possible even with latest LabVIEW 2022Q3, but needed a little bit more than single lvrt.dll, of course.

If we talking about latest Windows 11, then very "Minimal Valuable Application" shall include 8 files - 5 DLLs and 3 resources.

They are: lvrt.dll, mesa.dll, nicont.dll, niCPULib.dll, nierInterace.dll (last one from System32 or SysWOW64 folder) and tdtable.tdt as well as lvapp.rsc and vidialogs.rsc. lvapp.rsc and vidialogs.rsc shall be placed in "English" SubFolder. That is.

 

I would like to recommend to take Virtual Machine (VirtualBox or VMWare are OK), then install your empty target OS "out of the box", then copy Run-Time and supplied DLLs into same folder, then you can check if your application is functional, then remove all unnecessary DLLs step by step and check every time that everything is OK.

 

Also I would like to recommend to take two helpful tools from SysInternals Suite - Process Explorer and Process Monitor.

 

With Process Explorer you will see all DLLs loaded together with your App (you can check this on your development PC, just select DLLs list for lower pane):

 

Screenshot 2022-09-15 08.51.54.png

 

with Process Monitor you will see how application loaded and which files are found and which - not:

Screenshot 2022-09-15 08.53.21.png

 

This is how it looks on empty Windows 11 without preinstalled Run-Time:

Screenshot 2022-09-15 08.57.09.png

 

Obviously, if you will use, for example, Mean.vi from math palette you will need lvanlys.dll and all nested libraries. If you will use Vision, then you will need nivis*.dll and other things like PlugInControls folder from Run-Time plus dealing with license and so on.

 

I will not recommend to go in production with this, as mentioned above, because this may stop working in any time - after Windows update, or may be if some NI Run-Times will be deployed and installed separately, also in previous and future LabVIEWs the list of the "minimal necessary files" could be different. It is acceptable use for internal use (sometimes I creating small internal tools for my colleagues and put all DLLs together, because I know exactly which OS version they using). And also I have seen some "side-effects" (like application may take lot of time to load etc). In additional, I've read somewhere in license agreement that you are not eligible to deploy NIs DLLs separately other than bundled into official installer.

 

But anyway this is a good exercise to understand the dependencies of your app.

 

If you prefer to have "really single executable", then the only way is to pack everything above into self-extracted archive, drop on execute to temporary folder and run from it. Embedding of the DLLs into executable will require rebasing, which is not working for LVRT, in additional, you will get some troubles with resources.

 

with best regards,

Andrey.

Message 24 of 29
(1,066 Views)

Just one more thing, when I've forgot:

If you would like to decrease the size of this minimal app (which is currently 30MB), then you can compress DLLs with UPX packer:

https://upx.github.io

This will reduce the size approx by half:

Screenshot 2022-09-15 13.50.47.png

But of course, it is not guaranteed that your particular app will be still functional after that, and in addition, some antivirus scanners may recognize such packed executables and libraries as vulnerabilities. But then absolute minimal "runtime pack" for 2022Q3x64 is approx 15 MB, which is really not so bad nowadays.

Message 25 of 29
(1,026 Views)

@Andrey_Dmitriev wrote:

Yes, this is still possible even with latest LabVIEW 2022Q3, but needed a little bit more than single lvrt.dll, of course.

If we talking about latest Windows 11, then very "Minimal Valuable Application" shall include 8 files - 5 DLLs and 3 resources.

They are: lvrt.dll, mesa.dll, nicont.dll, niCPULib.dll, nierInterace.dll (last one from System32 or SysWOW64 folder) and tdtable.tdt as well as lvapp.rsc and vidialogs.rsc. lvapp.rsc and vidialogs.rsc shall be placed in "English" SubFolder. That is.


A couple of additional comments, based on extremely limited testing:

 

  1. Most of the files Andrey mentioned are in <Program Files>\National Instruments\Shared\LabVIEW Run-Time
  2. If you're running LV 32 bit on a 64 bit OS, make sure you take nierInterace.dll from SysWOW64 folder, as the other one is a 64 bit DLL.
  3. Some of the UI elements in LV come from the models folder, so you might need that folder too if you want to see those.

___________________
Try to take over the world!
0 Kudos
Message 26 of 29
(830 Views)

@tst wrote:

  1. Some of the UI elements in LV come from the models folder, so you might need that folder too if you want to see those.

Pretty much all of the 3D controls, aka Modern controls are based on definitions defined in these files inside the models folder. NXG style controls may or may not use elements of these too.

 

Without these files the controls or parts of the controls that use these models definitions are not rendered at all.

Rolf Kalbermatter
My Blog
0 Kudos
Message 27 of 29
(825 Views)

Great job Andrey! Couldn't find a way to give you a million kudos at once. As you said it is a good learning experience regardless of whether it works reliably or not and whether it is even eventually implemented for commercial purposes or not. Thanks a lot for the contribution.

[BADGE NAME]

Message 28 of 29
(773 Views)

@blessedk wrote:

Wont be the first time for me that keeping an open-mind


Enough head banging and you have a plausible answer.... even after all the nay-saying 😁

Way to keep an open mind! 👍

---------------------------------------------
Certified LabVIEW Developer (CLD)
There are two ways to tell somebody thanks: Kudos and Marked Solutions
0 Kudos
Message 29 of 29
(750 Views)