LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding a key to the registry clears Default values (Adding to Windows right click menu)

Solved!
Go to solution

I'm developing a program that will be installed as a right click option when the user clicks on a folder. It automates some SCC stuff that's previously been tedious.

 

To change the right click menu contents, one writes to HKEY_CLASSES_ROOT.Directory.shell and adds a new key there called [name of program]. Within that key, you add another key called "command" whose default value is the cmd line argument that runs your program. Doing that manually seems to work fine.

 

I then tried to add registry keys to the Installer to do the same:

BertMcMahan_0-1657670792897.png

 

However, after installing, I found that the default values for HKEY_CLASSES_ROOT.Directory and HKEY_CLASSES_ROOT.Directory.shell were cleared, despite having no keys listed in the installer section.

 

This is *extremely* annoying, because when those values get cleared the default Windows action when double clicking a folder becomes VLC Media Player, which... doesn't do well opening folders 🙂

 

(By the way, for future Googlers- to fix that, you have to set the default value of Directory to "File Folder" and of shell to "none", with no quotes. Leaving it empty will not work.)

 

So why does the LV installer clear the Default entries for those two items? And is there any way to prevent this?

0 Kudos
Message 1 of 2
(863 Views)
Solution
Accepted by topic author BertMcMahan

Apparently my Google-fu failed me last night- I found some more info today:

 

https://forums.ni.com/t5/LabVIEW/Project-Installer-Does-not-maintain-Registry-value-if-tag/td-p/4113...

 

Apparently, the Installer *only* adds new keys. It can't modify old ones. So, the answer is "make your own executable that just modifies some registry keys and runs after the installer" rather than a checkbox for "don't modify existing keys". I wish this was documented in the Help better, as the existing behavior is not what I expected. Disappointed, but ah well, it won't take long to make a simple executable.

Message 2 of 2
(828 Views)