Sign in to follow this  

Installer in C++

This topic is 4819 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
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

This topic is 4819 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this