- make app update work in windows

This commit is contained in:
SoftCoder 2014-12-30 22:09:53 -08:00
parent f76fe55153
commit 51c67cc7ff
2 changed files with 5 additions and 1 deletions

View File

@ -4439,6 +4439,10 @@ int glestMain(int argc, char** argv) {
}
createDirectoryPaths(tempDataPath);
string binaryNameOld = Properties::getApplicationPath() + extractFileFromDirectoryPath(PlatformExceptionHandler::application_binary) + "__REMOVE";
if(fileExists(binaryNameOld)) {
removeFile(binaryNameOld);
}
if(hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_USE_PORTS]) == true) {
int foundParamIndIndex = -1;

View File

@ -460,7 +460,7 @@ void MenuStateRoot::FTPClient_CallbackEvent(string itemName,
resultRename = renameFile(binaryNameOld, binaryName);
//if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Rename: [%s] to [%s] result = %d\n",binaryName.c_str(),binaryNameOld.c_str(),resultRename);
printf("#2 Rename: [%s] to [%s] result = %d errno = %d\n",binaryName.c_str(),binaryNameOld.c_str(),resultRename, errno);
printf("#2 Rename: [%s] to [%s] result = %d errno = %d\n",binaryNameOld.c_str(),binaryName.c_str(),resultRename, errno);
}
console.addLine("Successfully updated, please restart!",true);