PDA

View Full Version : how to check the application product version??



Cantora
5th June 2009, 04:07
Hi all,

Let say, I have a application called testing.exe.

And for this EXE file, it got production version.

So how I going to read the production version? I going to create a application to read it, but in Qt which function allow me to do that?

thanks

e8johan
5th June 2009, 08:03
I'm not sure what you mean. Where do you put your version? Into the exe? In that case I suppose that you'll have to parse through it and have a look

nish
5th June 2009, 08:17
i use my application's return value to determine various things

MyApp


#define VERSION 142 //version 1.4.2

int main(int argc,char** argv)
{
QApplication app(argc,argv);
if(argc>1)
{
if(!strcmp(argv[1],"ReturnVersionAndExit");
return VERSION;
}

....
....
}


now your other qt application can start the QProcess with your application and check the code.

check App


QString program="myapp.exe";
QStringList args;
args<<"ReturnVersionAndExit";

int version=QProcess::execute(program,args);
//voila!! u got the version.:D

wysota
5th June 2009, 08:36
I think he's talking about a possibility to embed the version of the application into the application executable (or the manifest, I don't know) on Windows that can be later read by Windows Explorer and displayed in the properties dialog of the application. If so, then this can only be retrieved using WinAPI (or by parsing the exe as Johan suggested).

nish
5th June 2009, 08:43
I think he's talking about a possibility to embed the version of the application into the application executable (or the manifest, I don't know) on Windows that can be later read by Windows Explorer and displayed in the properties dialog of the application. If so, then this can only be retrieved using WinAPI (or by parsing the exe as Johan suggested).

:o:o oh.. u r rite. :o:o

nish
5th June 2009, 10:07
looks like i was rite:p:rolleyes::D