Sign in to follow this  
CodeTitan

Installer in C++

Recommended Posts

CodeTitan    258
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
Programmer16    2321
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

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