LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

install cvirte.dll from autorun cd

Hello,

I have a little problem with the Run Time Engine. I have created a project with Labwindows 8.0 and I made an autorun CD where I have my .exe and .uir and . I want to run this .exe in other computers that don`t have Labwindows installed. I know that I need to install cvirte.dll in system32 folder so I made a distribution with cvirte.dll and cvirte folder (not the .exe file, because I don`t want to install it).

So after explainig what I made now I have two options to solve and two problems:

1st option: I make a distribution with: .exe, .uir, cvirte.dll and cvirte folder, then with my autorun I execute setup.exe so my programme and the .dll`s are installed in the target PC and the programme will run in it but... I need to know if there is any way to detect which "letter" (I mean d:\ or e:\ or f:\ ) is the CD-ROM in the target PC.

2nd option: I make a distribution just with .dll and cvirte folder in order to install them in the target PC and I`d like that after installing them my programme were executed from the CD-ROM.

How could I do one of those two options? Thanks a lot.
0 Kudos
Message 1 of 7
(4,700 Views)
John,

Are you using the CVI distribution builder? It concerns me that you are talking about installing the cvirte folder or DLL individually. The runtime engine comprises more than just those two elemlents, and you could run into problems by doing a "partial" install of just the DLL and cvirte folder. Additionally, unless you include the runtime engine as a packaged component (by selecting it on the Drivers & Components tab), you may run into problems if any other installer installs (or has installed) the CVI runtime engine to the same machine. Bottom line, use the Drivers & Components tab; don't just explicitly add cvirte.dll to your distribution.

From your two options, I surmise that you need your application to access an uninstalled file from the CD? Well, for either option 1 or 2, you can install an executable that will be run after the install, and you can pass it command line arguments that resolve to the installation source (i.e. path to directory containing setup.exe). In the installation tree of the Files tab, double click the executable you want to run, and check the Launch After Installation box on the file option dialog that comes up. You'll also see a Cmd Line Args box in which you can specify arguments to pass to that executable when it is run. CVI supports a few symbolic "%" tokens that you can use in your command line arguments. Specifically you can pass %src, which expands to the location from which the installer was run. Click the help button for more information (Edit Installer Dialog Box - Files Tab help topic) about the various % symbols.

Hope this helps.

Mert A.
National Instruments
0 Kudos
Message 2 of 7
(4,695 Views)
Hi Mert A.,

I tried what you said but I see one "probem", if I do that everytime I want to run my CD the installer will install the libraries (.dll`s needed and cvirte folder) in my system32 folder? I`m thinking about making an installer that install all the dll`s dependencies of my programe and install also .exe file and all the file that are in the because I don`t know how to avoid the installer the second time you run the programe from the CD.

I mean that the first time you run the CD it`s obviouslly that libraries have to be installed in the target PC, but the second time you run that CD in that PC it wouldn`t be necessary to install them again, and the installer will do it anytime you put the CD into the CD-ROM, am I wrong?

Thanks a lot for the help because your answer helped me.
0 Kudos
Message 3 of 7
(4,686 Views)
It sounds like your intent is to alway use the CD to run your program. Is there a reason for this? An installation should provide a machine the ability to run your application without the original source. Maybe you can just run everything off the CD without doing an actual install. Or maybe you could have users run your application from the machine without the CD.

Of course, if for some reason you do need to both install some components and also initiate every use of your application from a CD, then you can have some logic in your autorun that looks for an existing installation (perhaps checks for a registry key or system file) and launches the installer if it's not found.

Mert A.
National Instruments


0 Kudos
Message 4 of 7
(4,683 Views)

"Of course, if for some reason you do need to both install some components and also initiate every use of your application from a CD, then you can have some logic in your autorun that looks for an existing installation (perhaps checks for a registry key or system file) and launches the installer if it's not found."

Hello Mert A.

Yes, that is what I want to do with my autorun CD. Is there any way to do that? I mean if there is any instruction that let me check for a registry? I ask that (if you know it) becuase, although I am not a professional doing autorun CDs I think there isn`t any instruction that let me do that. I think the instructions that can be writen in an autorun are: shell, shellexecute, open, icon, label, and none of them let me check for that registry. Maybe I could do it in the source code of my programe in Labwindows before loading the panel?

So like you said my point is: run my autorun.inf file where I check if the cvirte.dll and all the libraries dependecies are installed in the target PC and if there aren`t installed then run setup.exe (installer made with Labwindows and then run from the CD the other programe) and if the libraries are installed just run my programe.exe (executable made with labwindows) without installing the libraries again.

I`m afraid that my idea is a little odd, so if I don`t find out the solution I`ll do what you said about installin the programe and all the files needed to run it without the CD.

Thanks a lot, and sorry for bothering so much.



Mensaje editado por John_E
0 Kudos
Message 5 of 7
(4,659 Views)
I don't think there's direct support for that in the autorun.inf commands, but you can have the autorun.inf launch (shellexecute) a small program that does the registry check and launches your installer and/or main application. If you write this "helper" program in CVI, you will have to copy cvirte.dll and the cvirte directory from the system directory to the CD, in the same directory as the helper program. (I usually advise against partial, copy-by-hand runtime engine installs, but in this case, since you are just trying to run a minimal program and this all stays on the CD, it should be fine.)The following code uses one of the Programmer's Toolbox functions to detect the presence of the CVI runtime engine registry key and launches setup.exe if detection fails:

if (RegQueryInfoOnKey(REGKEY_HKLM, "software\\National Instruments\\CVI Run-Time Engine",
        NULL, NULL, NULL, NULL, NULL) < 0)
        system("setup.exe");

The system command will not return until setup.exe finishes. At that point you can use LaunchExecutable, LaunchExecutableEx, or system to run your main application.

Mert A.
National Instruments
0 Kudos
Message 6 of 7
(4,620 Views)
Thank you a lot, Mert A. Now I`m at work but I`ll try it as soon as I get home this evening, I did something similar but I still had problems with the installer because the main programe launched before the setup.exe finished installing the libraries, I forgot to use "system". Thanks a lot.
 
I`ll tell you about writing the code you said. Thanks Smiley Wink
0 Kudos
Message 7 of 7
(4,609 Views)