How to associate a Windows application with a particular file type but share that association with other applications?

后端 未结 3 1210
时光说笑
时光说笑 2021-02-07 04:28

If I create a new app, and associate with, say, the .xml file extension on a particular computer, when someone double clicks the .xml file, it will launch my app and pass the fi

3条回答
  •  星月不相逢
    2021-02-07 05:06

    Well, all file associations are stored in the registry. There's an article, "Understanding MS Windows File Associations" that may help.

    Beyond that, there are many ways to create file associations programmatically. Though most often this is done in the installer. For example, my favorite installation system NSIS has a macro to handle this: http://nsis.sourceforge.net/FileAssoc

    But then there's the challenge of setting a default program to open a certain file type. I don't know what language or install system you're planning on using to do this but it appears that question is answered here for NSIS. Surely Microsoft also has documentation for their way of doing this with Windows Installer. But as you can probably guess, I'm more of an NSIS guy. ;)

提交回复
热议问题