+ Reply to Thread
Results 1 to 10 of 10

Thread: Add application to File Type CSV OpenWith menu

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Add application to File Type CSV OpenWith menu

    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

  2. #2
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Add application to File Type CSV OpenWith menu

    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

  3. #3

    Default Re: Add application to File Type CSV OpenWith menu

    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\FriendlyAppNa me" (Always Install)
    ::Registry Value (REG_SZ) "HKCR\Applications\TransPost.exe\FriendlyAppName\( Default)" = "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\comman d" (Always Install)
    ::Registry Value (REG_SZ) "HKCR\Applications\TransPost.exe\shell\open\comman d\(Default)" = "C:\Program Files (x86)\Cadro\TransPost\TransPost.exe" "%1" (Always Install)
    ::Registry Key "HKCR\Applications\TransPost.exe\SupportedType s" (Always Install)
    ::Registry Value (REG_SZ) "HKCR\Applications\TransPost.exe\SupportedTypes\.c sv" = (Always Install)
    ::Registry Value (REG_SZ) "HKCR\Applications\TransPost.exe\SupportedTypes\.t xt" = (Always Install)

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

    ::Registry Value (REG_SZ) "HKCR\Applications\TransPost.exe\SupportedTypes\.c sv" = "" (Always Install)
    ::Registry Value (REG_SZ) "HKCR\Applications\TransPost.exe\SupportedTypes\.t xt" = "" (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

  4. #4
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Add application to File Type CSV OpenWith menu

    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

  5. #5

    Default Re: Add application to File Type CSV OpenWith menu

    Hi Friedrich,

    I have attached a zip of a project file which is intended to insert the registry entries:
    Test reg sbp.zip

    and a reg file containing the entries required, but with a specific application path:
    RegEntries.zip
    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:
    AsusBook new entries.zip

    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

  6. #6
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Add application to File Type CSV OpenWith menu

    Julia,

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

    Friedrich

  7. #7
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Add application to File Type CSV OpenWith menu

    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
    Attached Images Attached Images  

  8. #8
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Add application to File Type CSV OpenWith menu

    Julia,

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

    Friedrich

  9. #9

    Default Re: Add application to File Type CSV OpenWith menu

    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

  10. #10
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Add application to File Type CSV OpenWith menu

    Perfect! Thanks for the update, Julia.

    Friedrich

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •