Results 1 to 3 of 3

Thread: File Associations

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2011
    Posts
    87

    File Associations

    I am running Visual Studio 2013 under Win 8 and converting my application from VB6 to vb.net

    I have a number of file extensions (all registered to me at fileinfo.com) which enable the user to just click on a file and it opens and runs approriately. Now, I appreciate that if you try to write to HKCR it ignores this and actually writes to HKLM. This is explained here:

    http://msdn.microsoft.com/en-gb/libr...=vs.85%29.aspx

    So, I think I have a fair idea of how file associations should be set up. But when I look in the registry, I find the following entries for my extension ".mpkt"

    HKEY_CLASSES_ROOT\.mpkt
    HKEY_CLASSES_ROOT\mpkt_auto_file
    HKEY_CURRENT_USER\Software\Classes\.mpkt
    HKEY_CURRENT_USER\Software\Classes\mpkt_auto_file
    HKEY_CURRENT_USER\Software\Microsoft\Installer\Features\C18226F9D85B71A4FB05F5E53A8EEA25
    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts
    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.mpkt\OpenWithList
    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.mpkt\OpenWithProgids
    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs\.mpkt
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\15.0\ClickToRun\REGISTRY\MACHINE\Software\Microsoft\Win dows\CurrentVersion\Installer\UserData\S-1-5-18\Products\00005109F00000000000000000F01FEC\Features
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-21-2741316030-115422572-2107306387-1002\Products\C18226F9D85B71A4FB05F5E53A8EEA25\Features
    HKEY_USERS\S-1-5-21-2741316030-115422572-2107306387-1002\Software\Classes\.mpkt
    HKEY_USERS\S-1-5-21-2741316030-115422572-2107306387-1002\Software\Classes\mpkt_auto_file
    HKEY_USERS\S-1-5-21-2741316030-115422572-2107306387-1002\Software\Microsoft\Installer\Features\C18226F9D85B71A4FB05F5E53A8EEA25
    HKEY_USERS\S-1-5-21-2741316030-115422572-2107306387-1002\Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts
    HKEY_USERS\S-1-5-21-2741316030-115422572-2107306387-1002\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.mpkt
    HKEY_USERS\S-1-5-21-2741316030-115422572-2107306387-1002\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.mpkt\OpenWithList
    HKEY_USERS\S-1-5-21-2741316030-115422572-2107306387-1002\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.mpkt\OpenWithProgids
    HKEY_USERS\S-1-5-21-2741316030-115422572-2107306387-1002\Software\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs\.mpkt
    HKEY_USERS\S-1-5-21-2741316030-115422572-2107306387-1002_Classes\.mpkt
    HKEY_USERS\S-1-5-21-2741316030-115422572-2107306387-1002_Classes\mpkt_auto_file

    This is not all of them ... just a sample and there should be "mpktfile" refs as well but they got deleted at some point!

    Now, I like tidiness, so how much of this stuff is relevant to a programmer setting up file associations? Clearly, the engine behind the Registry does all kinds of stuff when you make changes ...

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: File Associations

    My installer sets up file associations, and I have never had a problem with it working using just 4 entries.

    where ext = extension name

    Root: HKCR; Subkey: ".ext"; ValueType: string; ValueName: ""; ValueData: "MyAppNameFileType"
    Root: HKCR; Subkey: "MyAppNameFileType"; ValueType: string; ValueName: ""; ValueData: "Description of file type";
    Root: HKCR; Subkey: "MyAppNameFileType\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "path to ico/exe used for icon"
    Root: HKCR; Subkey: "MyAppNameFileType\shell\open\command"; ValueType: string; ValueName: ""; ValueData: "Path to exe file that opens file type"

  3. #3

    Thread Starter
    Lively Member
    Join Date
    May 2011
    Posts
    87

    Re: File Associations

    Quote Originally Posted by kleinma View Post
    My installer sets up file associations, and I have never had a problem with it working using just 4 entries.

    where ext = extension name

    Root: HKCR; Subkey: ".ext"; ValueType: string; ValueName: ""; ValueData: "MyAppNameFileType"
    Root: HKCR; Subkey: "MyAppNameFileType"; ValueType: string; ValueName: ""; ValueData: "Description of file type";
    Root: HKCR; Subkey: "MyAppNameFileType\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "path to ico/exe used for icon"
    Root: HKCR; Subkey: "MyAppNameFileType\shell\open\command"; ValueType: string; ValueName: ""; ValueData: "Path to exe file that opens file type"
    In Win 8 it no longer writes to HKCR (even if you tell it to) it actually writes to HKLM or HKCU. This is explained in this article here:

    http://msdn.microsoft.com/en-gb/libr...=vs.85%29.aspx

    As an experiment, I created a file "stuff.gxkp" and clicked on it and chose to open it with Worpad. On looking in the Registry, the only entries (apart from recent files list) are as follows:

    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts - value is gxkp_auto_file_.gxkp

    HKEY_USERS\S-1-5-21-2741316030-115422572-2107306387-1002\Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts - value is gxkp_auto_file_.gxkp

    This looks like a good point to give up and just treat it like a magic black box.

Tags for this Thread

Posting Permissions

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



Click Here to Expand Forum to Full Width