How to check version of my own software?
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?
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement