Jump to content
  • Advertisement
Sign in to follow this  
CodeTitan

Installer in C++

This topic is 5400 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I want to make an installer for a game that I am writing. However, there are some specific routines that must be done (such as getting things from the CD). I use C++. I want this to be an installer like those for Starcraft and Halo PC. Does anyone have an idea for a starting point?

Share this post


Link to post
Share on other sites
Advertisement
The only way that I know of is to use the CopyFile() function.

Say you have the user select the location of the cd and its in drive d.

You need to copy file GameName.exe to folder c:\CompanyName\GameName\GameName.exe:


if(!CopyFile("d:\\GameName.exe", "c:\\CompanyName\\GameName\\GameName.exe", true))
{
if(MessageBox(NULL, "File *Filename* exists, overwrite?", "Overwrite", MB_YESNO) == IDYES)
{
CopyFile("d:\\GameName.exe", "c:\\CompanyName\\GameName\\GameName.exe", false);
}
else
{
//continue to copy or quit
}
}

//File has been copied from
// d:\\GameName.exe to
// c:\\CompanyName\\GameName\\GameName.exe



Hope that helps!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!