const int VERSION = 1;
std::string s = std::to_string(VERSION);
bool needAnUpdate=false;
s << " " << &needAnUpdate;
char* cmd =(char*) s.c_str();
BOOL result = CreateProcess( "C:\\Upp\\upp\\out\\MyApps\\MINGW.Debug.Debug_Full.Noblitz\\newVersion.exe", //New Version const int is 2
cmd, NULL, NULL, // here we past version of current .exe
NULL, NULL, NULL, NULL,
&lpStartupInfo,
&lpProcessInfo
);
if (result)
{
if(needAnUpdate){
//Then my soft need to update itself.
}
}
const int VERSION =2;
if(argc > 1){
Upp::String arg(argv[1]); //transform args to string
Upp::String version = arg.Left(arg.Find(" ") -1); //here I get version
pp::String addrBool = arg.Right(arg.GetCount() - arg.Find(" ")); //Here I got adresse of my Boolean at string format
int versionToTest = std::stoi(version.ToStd());
if (VERSION > versionToTest){
// Here I cast my addrBool (string) to bool* (I dont know how to do it :/ )
}
//Here I end the programme
}