Sign in to follow this  

How to check version of my own software?

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

im wanting to create a loader for my program where the client can login and it will tell them if their version of my software is outdated. could anyone offer any methods i can use to figure out/ store the version of my software so i can compare it to the latest version from my database?

Share this post


Link to post
Share on other sites
[CODE]

program CanUpdateApp;

{$APPTYPE CONSOLE}

const
AV_MAJOR = 0;
AV_MINOR = 1;
AV_RELEASE = 2;
AV_BUILD = 3;

type
TAppVersionInfo = array [AV_MAJOR .. AV_BUILD] of Word;

procedure CompleteVersionInfo(var Ver: TAppVersionInfo;
const Major, Minor, Release, Build: Word);
begin
Ver[AV_MAJOR] := Major;
Ver[AV_MINOR] := Minor;
Ver[AV_RELEASE] := Release;
Ver[AV_BUILD] := Build;
end;

function CanUpdate(AppVer, UpdVer: TAppVersionInfo): Boolean;
begin
Result := (AppVer[AV_MAJOR] < UpdVer[AV_MAJOR]) or
(AppVer[AV_MINOR] < UpdVer[AV_MINOR]) or
(AppVer[AV_RELEASE] < UpdVer[AV_RELEASE]) or
(AppVer[AV_BUILD] < UpdVer[AV_BUILD]);
end;

var
AppVer,
UpdVer: TAppVersionInfo;
begin
CompleteVersionInfo(AppVer, 1, 0, 0, 0);
CompleteVersionInfo(UpdVer, 1, 0, 0, 0);

WriteLn('Application Version: ', AppVer[AV_MAJOR], '.', AppVer[AV_MINOR], '.',
AppVer[AV_RELEASE], '.', AppVer[AV_BUILD]);

WriteLn('Update Version: ', UpdVer[AV_MAJOR], '.', UpdVer[AV_MINOR], '.',
UpdVer[AV_RELEASE], '.', UpdVer[AV_BUILD]);

WriteLn;

case CanUpdate(AppVer, UpdVer) of
True: Write('New version available!');
False: Write('You have the lastest version.');
end;

ReadLn;
end.
[/CODE]

For example, a some implementation for Delphi.

Share this post


Link to post
Share on other sites
[quote name='nuclear123' timestamp='1329616050' post='4914393']
im wanting to create a loader for my program where the client can login and it will tell them if their version of my software is outdated. could anyone offer any methods i can use to figure out/ store the version of my software so i can compare it to the latest version from my database?
[/quote]

I think, if you have to ask this question, then you are probably over-engineering this. I don't know what you are trying to create, but, I would suggest concentrating on making your game, your first version, fun and playable, and don't try and worry about every conceivable possibility that you have to cover.

Or, if you want to do it for fun and learning, then have at it. I certainly understand that.

Share this post


Link to post
Share on other sites

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