PDA

View Full Version : Add application to File Type CSV OpenWith menu



Julia
03-26-2016, 08:19 PM
Hello,

My application processes CSV and TXT files and I would therefore like to have the install process add it to the "OpenWith" menu for such files, without changing the existing default.

The MS documentation I have read has so far turned up many possible approaches which seem to depend a variety of circumstances and seem to involve some assumptions about the pre-existing associations.

Any hints or advice on which approaches may be straightforward/inadvisable would be greatly appreciated.

Julia

linder
03-28-2016, 04:58 AM
Julia,

This is the recommended way to handle it:

https://msdn.microsoft.com/en-us/library/bb166549.aspx

You can use the "Edit Registry..." script function to manipulate the Windows Registry. The "Get Registry" script functions let you read existing registry keys and values.

Does this help?

Friedrich

Julia
05-05-2016, 08:44 AM
Hi Friedrich,

That was useful reading but I am still stuck. I have been fiddling around with this with not much success.

What I think I want to add is entries which when exported to a reg file look like:

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.csv\OpenWithList]
[HKEY_CLASSES_ROOT\.csv\OpenWithList\TransPost.exe]
[HKEY_CLASSES_ROOT\.txt\OpenWithList]
[HKEY_CLASSES_ROOT\.txt\OpenWithList\TransPost.exe]
[HKEY_CLASSES_ROOT\Applications\TransPost.exe]
[HKEY_CLASSES_ROOT\Applications\TransPost.exe\Frien dlyAppName]
@="\"TransPost\""
[HKEY_CLASSES_ROOT\Applications\TransPost.exe\shell]
[HKEY_CLASSES_ROOT\Applications\TransPost.exe\shell \open]
[HKEY_CLASSES_ROOT\Applications\TransPost.exe\shell \open\command]
@="\"C:\\Program Files (x86)\\Cadro\\TransPost\\TransPost.exe\" \"%1\""
[HKEY_CLASSES_ROOT\Applications\TransPost.exe\Suppo rtedTypes]
".csv"=""
".txt"=""

and importing that gives me the following script lines:
::Registry Key "HKCR\.csv" (Always Install)
::Registry Key "HKCR\.csv\OpenWithList" (Always Install)
::Registry Key "HKCR\.csv\OpenWithList\TransPost.exe" (Always Install)
::Registry Key "HKCR\.txt" (Always Install)
::Registry Key "HKCR\.txt\OpenWithList" (Always Install)
::Registry Key "HKCR\.txt\OpenWithList\TransPost.exe" (Always Install)
::Registry Key "HKCR\Applications" (Always Install)
::Registry Key "HKCR\Applications\TransPost.exe" (Always Install)
::Registry Key "HKCR\Applications\TransPost.exe\FriendlyAppName" (Always Install)
::Registry Value (REG_SZ) "HKCR\Applications\TransPost.exe\FriendlyAppName\(D efault)" = "TransPost" (Always Install)
::Registry Key "HKCR\Applications\TransPost.exe\shell" (Always Install)
::Registry Key "HKCR\Applications\TransPost.exe\shell\open" (Always Install)
::Registry Key "HKCR\Applications\TransPost.exe\shell\open\command" (Always Install)
::Registry Value (REG_SZ) "HKCR\Applications\TransPost.exe\shell\open\command \(Default)" = "C:\Program Files (x86)\Cadro\TransPost\TransPost.exe" "%1" (Always Install)
::Registry Key "HKCR\Applications\TransPost.exe\SupportedTypes" (Always Install)
::Registry Value (REG_SZ) "HKCR\Applications\TransPost.exe\SupportedTypes\.cs v" = (Always Install)
::Registry Value (REG_SZ) "HKCR\Applications\TransPost.exe\SupportedTypes\.tx t" = (Always Install)

so I edit duplicating % and putting "" after =
::Registry Value (REG_SZ) "HKCR\Applications\TransPost.exe\shell\open\command \(Default)" = "C:\Program Files (x86)\Cadro\TransPost\TransPost.exe" "%%1" (Always Install)

::Registry Value (REG_SZ) "HKCR\Applications\TransPost.exe\SupportedTypes\.cs v" = "" (Always Install)
::Registry Value (REG_SZ) "HKCR\Applications\TransPost.exe\SupportedTypes\.tx t" = "" (Always Install)

It now compiles but only installs these entries:
[HKEY_CLASSES_ROOT\Applications\TransPost.exe]
[HKEY_CLASSES_ROOT\Applications\TransPost.exe\Frien dlyAppName]
@="\"TransPost\""
[HKEY_CLASSES_ROOT\Applications\TransPost.exe\Suppo rtedTypes]
".csv"=""
".txt"=""[/SIZE]

Any suggestions would be greatly appreciated.

Julia

linder
05-06-2016, 05:28 AM
Julia,

Could you please post a test .sbp project file (which includes the above entries) so we can see what you are doing? And if possible, your .reg file in a ZIP archive.

Friedrich

Julia
05-07-2016, 06:50 PM
Hi Friedrich,

I have attached a zip of a project file which is intended to insert the registry entries:
4312

and a reg file containing the entries required, but with a specific application path:
4310
If I import these registry entries directly using regedit they have the desired effect.

This is an export of the only registry entries that do get added by the install:
4311

The overall effect that I am after is that my application is added to the open-with sub-menu on a right-click on a .csv or .txt file.

Thank you for your attention to this.

Best regards

Julia

linder
05-09-2016, 08:35 AM
Julia,

I'll play with your project and get back to you...

Friedrich

linder
05-12-2016, 07:47 AM
Julia,

Please try the following. Where you only need the registry key, add the "Default Value" with "value not set" (see attached screenshot).

Does this help?

Friedrich

linder
05-18-2016, 03:03 AM
Julia,

Does the above work for you? I can send you the modified project file if you want.

Friedrich

Julia
05-22-2016, 12:38 AM
Hi Friedrich,

Finally got around to trying it out and it works treat.

It does not add the command I was attempting as the last entry but that does not matter because the installed app does what is needed anyway. My application appears as an option on the 'Open with' for .csv & .txt files and is started successfully with the file as the parameter.

Thank you.

Julia

linder
05-22-2016, 04:27 AM
Perfect! Thanks for the update, Julia.

Friedrich