How to register file types/extensions with a WiX installer?

后端 未结 3 1047
傲寒
傲寒 2020-11-30 05:32

I didn\'t find an explicit answer to this question in the WiX Documentation (or Google, for that matter). Of course I could just write the appropriate registry keys in HKCR,

3条回答
  •  悲&欢浪女
    2020-11-30 06:11

    After some additional research, I found a partial answer to this question in the WiX Tutorial. It shows an advertised solution and does not work with WiX 3.0, but given that information, I figured it out. Add a ProgId element to the component containing your executable, like the following:

    
      
        
      
    
    

    myext is the file extension without the dot, and MyApplication.exe is the file id (not name) of the executable file (i.e. the Id attribute of the File element). This will register the file type with your executable and will supply a default icon (a white page with the application icon on it), which is sufficient for my needs. If you want to specify a dedicated icon, it seems you still have to do this yourself, like the following (code from the linked tutorial):

    
    
    
    

    I didn't find a good solution for my bonus question though.

    Edit: I started writing this before the previous answer came. However, my solution actually works, in contrast to the previous answer.

提交回复
热议问题