LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to associate a file extension to an executable ?

Solved!
Go to solution
Is it possible to associate a specific file extension to an executable created with labVIEW ? And of course to get the corresponding properties : specific icon, open with double-click...)

CC
Chilly Charly    (aka CC)
0 Kudos
Message 1 of 20
(7,126 Views)
The association of a file extension with an executable is an OS issue. Are you using windows?
It is a simple as clicking the unassociated file, selecting the application, and check "always use this program ...". 🙂

On the LabVIEW side, you need to make sure that your executable reads the commandline options in order to get the name of the clicked file when it opens via this mechanism (e.g. double clicking an associated file, drop a file on the executable, etc.)..

On the diagram, you read the commandline parameters via the "application..comandline arguments" property in the code.

When building the executable, you should ensure that you specify "Pass all command line arguments to application" (it is under Application Settings).
Message 2 of 20
(7,121 Views)
Here's a quick test executable I made about a year ago (just built again into a 7.1 LV application). The diagram is shown in the image.

Now create a file with a random unused extension, e.g. abc.zzz, double click it, and specify to always open it with commandline.exe.

The first element in the array is the name of the application. the second element is the double-clicked file.

Message Edited by altenbach on 04-15-2005 11:12 PM

Download All
Message 3 of 20
(7,124 Views)
Thanks Altenbach !
That is a solution on my development machine. But how could I do that on a customer's PC ?
And have you any idea on how to associate a specific icon to the custom files ?

CC
Chilly Charly    (aka CC)
0 Kudos
Message 4 of 20
(7,110 Views)

@chilly charly wrote:
But how could I do that on a customer's PC ?
It basically boils down to write the correct entries to the registry. This can be done with a small labview executable that you include with the installer. In the advanced Installer settings you can specify to run it at install time. LabVIEW includes registry access tools (in the advanced palette) that will let you interact with the registry.

I am not very familiar with all the details, so hopefully somebody will chip in.

@chilly charly wrote:
And have you any idea on how to associate a specific icon to the custom files ?

No, but I would like to know how to do that myself. 🙂
0 Kudos
Message 5 of 20
(7,103 Views)
Hi CC,

Try the attached code (LabVIEW 7.0). There is probably a cleaner solution using class IDs (CLSID), but this one should work. However, one problem could be that you need to know in advance where your Application will be installed. Unless you install it into something based on %SystemRoot%, there is some more code required.

Cheers,
-B2k
Message 6 of 20
(7,094 Views)
Houch ! that was a painfull move...

I believe there are a few things here that will interest a number of other LVWers... 😉

I have to inform you that I'm not familiar AT ALL with the subtilities of the windows registry. Few minutes ago, I even add problems with the signification of the words "register" and "key" as used here ! 😞

So, could you be kind enough to :
1/ direct me to an online information source such as "the window registry explained to dummies";
2/ develop a bit more the comments associated to your vi, just to avoid me more brain disruption ? 🙂

Thanks a lot !

CC
Chilly Charly    (aka CC)
0 Kudos
Message 7 of 20
(7,086 Views)
A good place to start is microsoft KB article 256986 and the links mentioned in it.

For a better feel, you might just run regedit and browse around in the keys. For example, search for "LabVIEW" and look at all the keys containing it. (Just don't start randomly changing or deleting things ;))

The status bar at the bottom always shows the full key your are currently viewing.
Message 8 of 20
(7,083 Views)
Altenbach, Biker
I think I have found some interesting documents here and also here

Need some time to assimilate now.
Thanks for your help !

CC

Message Edited by chilly charly on 04-16-2005 11:41 PM

Chilly Charly    (aka CC)
Message 9 of 20
(7,075 Views)
The second link, about customizing file icons, was corrupted. The info is in fact here
Think I'll need some help to learn how to call SHChangeNotify to notify the shell to update its cache...
CC

Message Edited by chilly charly on 04-16-2005 11:54 PM

Chilly Charly    (aka CC)
0 Kudos
Message 10 of 20
(7,086 Views)