-1

So here's my problem. I have a small game framework built in python 3, and the templates are saved using the .dfw file extension (The custom binary extension for my program). When I view this file in Windows Explorer, I see a generic blank file icon for the icon, and just 'DFW File' as the type descriptor. My question is, how can I, upon installation, make Windows recognize that file extension, and have a custom icon and a type descriptor like 'DTS Framework template'. Is there any way to do this through Python? Or is there a free MSI builder which has this function?

Thanks

P.S. The program itself has a custom file icon and whatnot, it is the template files with custom file endings which do not.

Arcayn
  • 87
  • 7

1 Answers1

0

You're likely looking for Py2Exe. Note that the link is for python 3, but there is a specific option to add an icon to your program when you create the exe. This is a tutorial that might help get you started. http://py2exe.org/index.cgi/Tutorial As for the type descriptor, might also be an option in py2exe, but I couldn't say for sure.

Edit: This is a Windows registry thing, and instructions on it are here. You can change the registry from python using winreg, but this is rather dangerous territory, and would require admin privileges for the application itself.

Untitled123
  • 1,317
  • 7
  • 20
  • Thanks for reply, but I think you may have mis-interpreted the question (I've edited to make it clearer). I have converted my program to exe using Py2Exe and it has a custom icon, the .dfw files that it spawns (dfw is the file ending for my program's templates) do not. – Arcayn Dec 31 '15 at 23:55
  • Ah, my bad. this has nothing to do with python, but is rather a Windows thing. This should help: https://msdn.microsoft.com/en-us/library/windows/desktop/hh127427(v=vs.85).aspx – Untitled123 Dec 31 '15 at 23:56
  • You can edit the registry with winreg, but I would suggest you proceed with extreme caution. – Untitled123 Dec 31 '15 at 23:57
  • Ah yes, very helpful thank you :) – Arcayn Dec 31 '15 at 23:58
  • For solved, just accept the answer, instead of marking the question :) – Untitled123 Dec 31 '15 at 23:59
  • The [MSDN doc](https://msdn.microsoft.com/en-us/library/hh127427) suggests writing to `HKCR`, which you should never do. It's a merged view of `HKLM\Software\Classes` and `HKCU\Software\Classes`. Depending on the existing keys, you could end up creating the value either for the machine or for the user. – Eryk Sun Jan 01 '16 at 00:21