开发者

How to open different App version for one given file extension

We have a data files with an extension ".ppx" for our business app here. Users will typically have multiple versions of the application installed (side by side) for example version 1 and version 2.

The ppx files are xml files and they contain the version of the app they were created from (v1 or v2). Lets say that we have AFileCreatedWithAppv1.ppx and AFileCreatedWithAppv2.ppx opens with version 1 or version 2 of our app respectivly when they both have the same file extension?

It must be doable since that is what Visual Studio does. In fact, they even prov开发者_StackOverflow中文版ide different icons for the same .sln extension to indicate what Visual Studio version it will open with. I learned that Visual Studio is using the Selector or Launcher in between, but then again, how do they change the icons in Windows?

cheers :)


Visual Studio associates its file extensions with an application called "Visual Studio Version Selector". When a file is double-clicked, this application opens the file (eg. project file, solution file) and looks inside it at the version information contained within the xml structure of the file. It then launches the correct version of Visual Studio and passes it the name of the file that was clicked on. I think the icons change based on an explorer extension that overlays the version number over the icon (although I'm not 100% sure on this) - I believe Office may do something similar.

You could mirror this behaviour with your application, associating your ppx file extension with your own version selector application.

Your version selector application will need to know about all versions of your application that are installed on a machine, so that it able to delegate responsibility of opening the file to the correct version.


You need to check for the version and then proceed for the rest of the usage. We have a product that stores data in a binary serialised file. The header contains the version info. The product senses the version while deserialising before proceeding.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜