Take your pick
There are a number of ways to create an installer for anything, including an XNA game.
1. Visual Studio Deployment Solution
This one's is fairly straightforward. If you have the Professional edition of Visual Studio, then you can add a Deployment project to your solution and whenever you compile this project, it will compile all necessary dependencies/assets for you and make you a nice installer at the end of it.
This link has most of the information that you would need to get started and contains information about redistributing the .NET framework and other related bits and pieces.
Pros:
- Integrated into Visual Studio
- Straightforward in getting a simple MSI installer built and ready to distribute
Cons:
- Not available in some versions of Visual Studio
- Difficult to get your installer to do something more complex than installing/repairing/uninstalling.
2. WiX
If you don't have the option of creating a Visual Studio Deployment project, due to a limited version of Visual Studio, there are a number of free alternatives available. WiX is one of these alternatives.
It stands for Windows Installer XML and can be integrated into Visual Studio, much like the VS Deployment projects. This also creates an msi installer after compilation. Be warned though, WiX has a steep learning curve, but it does allow for various complexities in your installer.
You can find out more about it here
Pros:
- 100% free.
- Powerful. If you want to do something ridiculously complex in your installer, just create a C# DLL, link it into your WiX project and run it as a Custom Action. (Almost) Anything is possible.
- Integrates into Visual Studio nicely, works very, very well with .NET projects.
- People on the WiX mailing list provide a lot of support.
Cons:
- Difficult to grasp and get started due to the steep learning curve.
- Errors are almost nonsensical when you start out and it takes a while to actually figure out what the real problem in your code is.
- Not enough tutorials on the subject. Most (in my opinion) are badly worded, badly structured and downright confusing.
3. NSIS
NSIS is a fully featured installer creation package. I'll admit, I've barely used it, but when I did it was a pleasant experience. There are a good amount of tutorials, it's completely scriptable, but I'd probably say it's not as powerful as WiX (if anyone feels this isn't the case, then feel free to correct me).
It's completely free and open source and you can find more information on it here.
Pros:
- 100% free.
- Scriptable installer, so you should be able to code some complex behaviour.
- Good amount of tutorials, good support.
- Doesn't make an MSI, but an EXE instead (MSI's can be bad)
Cons:
- Doesn't make an MSI, but an EXE instead (MSI's can be good)
- Fairly limited by the scope of the scripting commands
4. InstallShield and InstallAnywhere
I've never used InstallShield, but for completeness' sake, I thought I would mention it here. My only experience is from what people have told me, so I won't list out the pros and cons.
As far as I'm aware, it is pretty fully featured, however it is unable to handle a large amount of files (> 1000). You do need to pay for it though. InstallAnywhere is a cross-platform version of InstallShield. More information here.
5. Other Solutions
I'll list the other solutions for deployment here if anyone has any others to add:
Advanced Installer - The freeware version allows for basic deployment solutions. Thanks for this addition, pek.
Conclusion
There are a whole host of options available to create an installer for your XNA game. Try out a couple, see what you get on with most. However, the most important thing regarding the creation of installers is ensuring that it works on a number of computers. If you're creating an MSI installer, testing is made much easier by running the msi from the command line using the following command:
msiexec /i [name of installer.msi] /L*v verbose_log.txt
This will write out a log of every single event that the installer is going through, which you can then diff from whatever diff tool you like.
In conclusion, see what fits you and your workflow best, testing is key, and whenever you're testing your installer, always, ALWAYS log the installations (most of the time installers never give you any useful information as to what went wrong).
This turned into something longer than I expected, and I am sorry. But I do hope it helps.
~Ray