I created an MP3 music player, created its set up file using visual Studio Installer(Setup Project), but need help to make it the default player for windows, not manually but with code, or using the Setup project, can anyone help please
3 Answers
Use Default Programs to set the default user experience. Users can access Default Programs from Control Panel or directly from the Start menu. Set Program Access and Defaults (SPAD) tool, the primary defaults experience for users in Windows XP, is now one part of Default Programs.
When a user sets program defaults using Default Programs, the default setting typically applies only to that user and not to other users who might use the same computer. Default Programs provides a set of APIs that enable independent software vendors (ISVs) to include their programs or applications in the defaults system. The API set also helps ISVs better manage their status as defaults.
http://msdn.microsoft.com/en-us/library/windows/desktop/cc144154%28v=vs.85%29.aspx

- 4,261
- 1
- 21
- 22
-
A short summary of relevant points would be helpful for future reference to this very answer – Alex Jul 10 '12 at 10:09
I think you should have enough by reading through these links:
You need to create a custom InstallerClass
Custom Installer Class
And then manually fiddle with the Registry How to associate a file extension to the current executable in C#

- 1
- 1

- 30,492
- 6
- 73
- 100
Another option - if you're using a Visual Studio Installer project it looks like you can also use the designer to create file associations: http://msdn.microsoft.com/en-us/library/k3bb4tfd.aspx.

- 2,031
- 16
- 14