LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

.ICO woes in Windows Registry for my LabVIEW Application

Solved!
Go to solution

Wow, adding that last little bit of spit-and-shine to a LabVIEW program can turn into quite the process.

 

I have defined a file type with an extension .tpml (Temperature Profile XML File).  When my user double clicks a file of that type it launches my LabVIEW application.  All of this is worked out and is working well.  I even have the installer for my program add Windows Registry key entries so that the .tpml file type is associated with my program's executable.  This is related to my previous post here.

 

The problem I have is that I've made a fancy icon for my LabVIEW program and for these TPML files.  The problem is, the Windows Registry key entry that associates the file with my program, causes the TPML file icon to be the 16x16 icon from my program's executable.  If I remove the association in the registry it goes back to the .ico file I made.

 

I'm not sure if I can add my TPML file icon to my .exe in such a way that an association between the two causes the correct icon to be displayed in Windows, or if there is some other Registry Key entry that I need to make that overrides Windows and forces it to use my TPML file .ICO for the icon.  Does anyone know?

 

These are the registry keys my installer is making:

 

HKEY_CLASSES_ROOT\

.tpml = "tpmlfile"

.tpml\DefaultIcon = [INSTALLDIR]data\TPMLFile.ico

tpmlfile = Temperature Profile XML File

tpmlfile\shell\open\command = [INSTALLDIR]Profile Editor.exe "%1"

 

I have all the spit and shine I want in this program except for this issue with the icons (minus some keyboard TAB issues).  Like I said, if I remove the "tpml\shell\open\command" entry in the Registry, the DefaultIcon works A-OK.  With that registry entry in place, it defaults to the 16x16 icon for "Profile Editor.exe".

 

Any ideas?

 

Thank you so much for your time and input!

-Nic

 

0 Kudos
Message 1 of 4
(855 Views)

This is more of a Windows Registry issue than a LabVIEW issue, does anyone know a good place to get support for that.  My Google-Fu is failing me Smiley Tongue.  All attempts to search for anything relating to Windows Registry and Icons tends to lead to changing the default icons in Windwos (My Computer, Recycle Bin, etc.).

 

Unless there is a way for me to add the .ICO as a resource within the .exe that defaults to the file somehow.  I'm not seeing anything within LabVIEW to facilitate this, however...

0 Kudos
Message 2 of 4
(830 Views)
Solution
Accepted by topic author NicLinley
08-27-2015 04:09 PM

The solution was that I needed the DefaultIcon key entry as a child of tpmlfile NOT .tpml.  Here are my final registry keys that work like a champ!

 

HKEY_CLASSES_ROOT\

.tpml = "tpmlfile"

tpmlfile = Temperature Profile XML File

tpmlfile\DefaultIcon = [INSTALLDIR]data\TPMLFile.ico

tpmlfile\shell\open\command = [INSTALLDIR]Profile Editor.exe "%1"

 

-Nic

Message 3 of 4
(807 Views)

One note to add to this post: the "Name" field for all those key entries should be blank and the "Type" field should be set to "REG_SZ" or else they won't work.

 

Also, does anyone know if there is a way to delete registry keys during installation?  I have problems with files that were previously setup to open with another program or were setup to open with one of my programs via the "Open With" and checking "Always open with this program" in the dialog.

 

Also the required keys may be different with different versions.  It would be nice to be able to purge the previous entries before installing the new entries.

Message 4 of 4
(718 Views)