Jump to content
  • Advertisement
Sign in to follow this  
nuclear123

How to check version of my own software?

This topic is 2342 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
Advertisement


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.


For example, a some implementation for Delphi.

Share this post


Link to post
Share on other sites

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?


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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!