08-09-2013 04:41 PM
Hello,
I am fairly new to Labveiw and have created a CAN diagnostic tool which uses an ActiveX control to display the CAN Spec PDF on the front panel. This works absolutely fine and still works fine when I create and use an executable on the same computer. However, I need to use the application on multiple computers that do not have Labview installed, and therefore require the executable. I have tried placing a copy of the PDF in the "Volume" folder and recreating the .exe with that path, then placing it in the same location on another computer, but no luck. I am fairly certain it has to do with the static file path, set in the Main VI, since it refers to a static location that does not necessarily exist on the next computer. I need some way to get around this though, so that I can easily transfer the application from one computer to another. The code I am using is very simple; I just open Adobe Reader and the file during initialization then close the reference path (see attached picture). Any Ideas?
Thank you for your assistance!
-Mike
08-09-2013 05:02 PM
Is Adobe Acrobat Reader installed on the other computer?
08-10-2013 02:34 PM
Yes, Adobe Reader is installed on the other computer.
08-11-2013 03:12 AM - edited 08-11-2013 03:14 AM
Hello All,
I believe I have discovered the problem - both problems to be exact. First, the computer I use to create the .exe was using Adobe Reader XI while the target computer was using Adobe Reader X. Number two was the file path: because I was placing the PDF on the desktop, the user account was included in the file path, which was different on the next computer. By putting the PDF directly on the C drive, I was able to fix that. Since the installer creates a National Instruments folder in Program Files (x86), I can use that path in the Main VI diagram and manually place the PDFs in that folder after installation of different computers, but does anyone know if/how the installer could be set up to do this automatically and how to make the path constant use that path?
Thanks again for your assistance!
-Mike
08-11-2013 03:51 PM
A solution that I have found to work well is to use the Project Directory node as a root path. In the development environment this node will always return the path to the directory containing the project that is calling it. In an executable, it returns the path to where the executable is located.
With that known starting point, I can put files like that pdf in either the same directory as the project/executable or a subdirectory of that location and I can always find it.
When creating a build spec you can include non-LV files and specify destinations for them. Likewise, the installer will then put these files where they belong during the installation.
Mike...