Accueil > > > COMPOSANT TDBPVERSIONINFO
COMPOSANT TDBPVERSIONINFO
Information sur la source
Description
Ce compo donne les infos de la version du logiciel. ex: 2.1.12.1979 ou en plus propre ex: Version 2.1 (build 21.1979) Voyez la source pour mieux comprendre.
Source
- {
- ################################################################################
- # DBPVERSIONIFO #
- ################################################################################
- # #
- # VERSION : 1.2 #
- # FICHIERS : dbpVersionInfo.pas,.dcu,.dcr,.bmp,ReadMe.htm #
- # AUTEUR : Julio P. (Diabloporc) #
- # CREATION : 20 Jul 2004 #
- # MODIFIEE : 27 Jul 2004 #
- # SITE WEB : http://diabloporc.free.fr #
- # MAIL : diabloporc@laposte.net #
- # LEGAL : Free sous Licence GNU/GPL #
- # INFOS : Retrouvez moi sur www.delphifr.com : "JulioDelphi" #
- # Lisez le ReadMe.htm ! #
- # #
- ################################################################################
- }
- unit dbpVersionInfo;
-
- interface
-
- uses
- dialogs, windows, forms, Strman, SysUtils, Classes;
-
- type
- TdbpVersionInfo = class(TComponent)
- private
- FAbout: string;
-
- function GetAbout: string;
- function GetVersion: string;
- function GetCN: string;
- function GetFD: string;
- function GetLC: string;
- function GetIN: string;
- function GetLT: string;
- function GetOF: string;
- function GetPN: string;
- function GetC: string;
- function GetPV: string;
- function LectureVersion(index: word;Value: string): string;
- function GetMajor: string;
- function GetMinor: string;
- function GetRelease: string;
- function GetBuild: string;
- protected
- public
- property Major: string read GetMajor;
- property Minor: string read GetMinor;
- property Release: string read GetRelease;
- property Build: string read GetBuild;
- property CompanyName: string read GetCN;
- property FileDescription: string read GetFD;
- property FileVersion: string read GetVersion;
- property InternalName: string read GetIN;
- property LegalCopyright: string read GetLC;
- property LegalTradeMarks: string read GetLT;
- property OriginalFileName:string read GetOF;
- property ProductName: string read GetPN;
- property ProductVersion: string read GetPV;
- property Comments: string read GetC;
- function FileVersionFmt: String;
- function Lire(Value: String): string;
-
- published
- property About: String read GetAbout write FAbout;
- end;
-
- procedure Register;
-
- implementation
-
- {$R DBPVERSIONINFO.dcr}
-
-
- // fonction de lecture des infos du fichier (voir aide delphi :p)
- function TdbpVersionInfo.LectureVersion(index: word;Value: string):String;
- Var
- S : String;
- Taille : DWord;
- Buffer : PChar;
- Autre : PChar;
- VersionL : DWord;
- FTruc : string[16];
- Begin
- Result:='';
- S := Application.ExeName;
- Taille := GetFileVersionInfoSize(PChar(S), Taille);
- If Taille>0
- Then Try
- Buffer := AllocMem(Taille);
- GetFileVersionInfo(PChar(S), 0, Taille, Buffer);
- case index of
- 10: FTruc := Value;
- 0: FTruc := 'FileVersion';
- 1: FTruc := 'CompanyName';
- 2: FTruc := 'FileDescription';
- 3: FTruc := 'InternalName';
- 4: FTruc := 'LegalCopyright';
- 5: FTruc := 'LegalTradeMarks';
- 6: FTruc := 'OriginalFilename';
- 7: FTruc := 'ProductName';
- 8: FTruc := 'ProductVersion';
- 9: FTruc := 'Comments';
- end;
- If VerQueryValue(Buffer, PChar(format('\StringFileInfo\040C04E4\%s',[FTruc])), Pointer(Autre), VersionL)
- Then Result := Autre;
-
- Finally
- FreeMem(Buffer, Taille);
- End;
- End;
-
- function TdbpVersionInfo.Lire(Value: string): string;
- begin
- result := LectureVersion(10,Value);
- end;
-
- function TdbpVersionInfo.GetAbout: string;
- begin
- Result := 'v1.2 par Julio P. (Diabloporc)';
- end;
-
- function TdbpVersionInfo.GetVersion: string;
- begin
- Result := LectureVersion(0,'');
- end;
-
- function TdbpVersionInfo.GetCN: string;
- begin
- Result := LectureVersion(1,'');
- end;
-
- function TdbpVersionInfo.GetFD: string;
- begin
- Result := LectureVersion(2,'');
- end;
-
- function TdbpVersionInfo.GetIN: string;
- begin
- Result := LectureVersion(3,'');
- end;
-
- function TdbpVersionInfo.GetLC: string;
- begin
- Result := LectureVersion(4,'');
- end;
-
- function TdbpVersionInfo.GetLT: string;
- begin
- Result := LectureVersion(5,'');
- end;
-
- function TdbpVersionInfo.GetOF: string;
- begin
- Result := LectureVersion(6,'');
- end;
-
- function TdbpVersionInfo.GetPN: string;
- begin
- Result := LectureVersion(7,'');
- end;
-
- function TdbpVersionInfo.GetPV: string;
- begin
- Result := LectureVersion(8,'');
- end;
-
- function TdbpVersionInfo.GetC: string;
- begin
- Result := LectureVersion(9,'');
- end;
-
- // petite fonction pour une sortie plus belle et rapide, ex: "Version 2.0 (build 21.12)"
- function TdbpVersionInfo.FileVersionFmt: string;
- begin
- Result := Format('Version %s.%s (build %s.%s)',[GetMajor,GetMinor,GetRelease,GetBuild]);
- end;
-
- function TdbpVersionInfo.GetMajor: string;
- begin
- Result := sm.Before('.',LectureVersion(0,''));
- end;
-
- function TdbpVersionInfo.GetMinor: string;
- begin
- Result := sm.Between('.','.',LectureVersion(0,''));
- end;
-
- function TdbpVersionInfo.GetRelease: string;
- begin
- Result := sm.BetweenRev('.','.',LectureVersion(0,''));
- end;
-
- function TdbpVersionInfo.GetBuild: string;
- begin
- Result := sm.AfterRev('.',LectureVersion(0,''));
- end;
-
- procedure Register;
- begin
- RegisterComponents('Diabloporc', [TdbpVersionInfo]);
- end;
-
- end.
{
################################################################################
# DBPVERSIONIFO #
################################################################################
# #
# VERSION : 1.2 #
# FICHIERS : dbpVersionInfo.pas,.dcu,.dcr,.bmp,ReadMe.htm #
# AUTEUR : Julio P. (Diabloporc) #
# CREATION : 20 Jul 2004 #
# MODIFIEE : 27 Jul 2004 #
# SITE WEB : http://diabloporc.free.fr #
# MAIL : diabloporc@laposte.net #
# LEGAL : Free sous Licence GNU/GPL #
# INFOS : Retrouvez moi sur www.delphifr.com : "JulioDelphi" #
# Lisez le ReadMe.htm ! #
# #
################################################################################
}
unit dbpVersionInfo;
interface
uses
dialogs, windows, forms, Strman, SysUtils, Classes;
type
TdbpVersionInfo = class(TComponent)
private
FAbout: string;
function GetAbout: string;
function GetVersion: string;
function GetCN: string;
function GetFD: string;
function GetLC: string;
function GetIN: string;
function GetLT: string;
function GetOF: string;
function GetPN: string;
function GetC: string;
function GetPV: string;
function LectureVersion(index: word;Value: string): string;
function GetMajor: string;
function GetMinor: string;
function GetRelease: string;
function GetBuild: string;
protected
public
property Major: string read GetMajor;
property Minor: string read GetMinor;
property Release: string read GetRelease;
property Build: string read GetBuild;
property CompanyName: string read GetCN;
property FileDescription: string read GetFD;
property FileVersion: string read GetVersion;
property InternalName: string read GetIN;
property LegalCopyright: string read GetLC;
property LegalTradeMarks: string read GetLT;
property OriginalFileName:string read GetOF;
property ProductName: string read GetPN;
property ProductVersion: string read GetPV;
property Comments: string read GetC;
function FileVersionFmt: String;
function Lire(Value: String): string;
published
property About: String read GetAbout write FAbout;
end;
procedure Register;
implementation
{$R DBPVERSIONINFO.dcr}
// fonction de lecture des infos du fichier (voir aide delphi :p)
function TdbpVersionInfo.LectureVersion(index: word;Value: string):String;
Var
S : String;
Taille : DWord;
Buffer : PChar;
Autre : PChar;
VersionL : DWord;
FTruc : string[16];
Begin
Result:='';
S := Application.ExeName;
Taille := GetFileVersionInfoSize(PChar(S), Taille);
If Taille>0
Then Try
Buffer := AllocMem(Taille);
GetFileVersionInfo(PChar(S), 0, Taille, Buffer);
case index of
10: FTruc := Value;
0: FTruc := 'FileVersion';
1: FTruc := 'CompanyName';
2: FTruc := 'FileDescription';
3: FTruc := 'InternalName';
4: FTruc := 'LegalCopyright';
5: FTruc := 'LegalTradeMarks';
6: FTruc := 'OriginalFilename';
7: FTruc := 'ProductName';
8: FTruc := 'ProductVersion';
9: FTruc := 'Comments';
end;
If VerQueryValue(Buffer, PChar(format('\StringFileInfo\040C04E4\%s',[FTruc])), Pointer(Autre), VersionL)
Then Result := Autre;
Finally
FreeMem(Buffer, Taille);
End;
End;
function TdbpVersionInfo.Lire(Value: string): string;
begin
result := LectureVersion(10,Value);
end;
function TdbpVersionInfo.GetAbout: string;
begin
Result := 'v1.2 par Julio P. (Diabloporc)';
end;
function TdbpVersionInfo.GetVersion: string;
begin
Result := LectureVersion(0,'');
end;
function TdbpVersionInfo.GetCN: string;
begin
Result := LectureVersion(1,'');
end;
function TdbpVersionInfo.GetFD: string;
begin
Result := LectureVersion(2,'');
end;
function TdbpVersionInfo.GetIN: string;
begin
Result := LectureVersion(3,'');
end;
function TdbpVersionInfo.GetLC: string;
begin
Result := LectureVersion(4,'');
end;
function TdbpVersionInfo.GetLT: string;
begin
Result := LectureVersion(5,'');
end;
function TdbpVersionInfo.GetOF: string;
begin
Result := LectureVersion(6,'');
end;
function TdbpVersionInfo.GetPN: string;
begin
Result := LectureVersion(7,'');
end;
function TdbpVersionInfo.GetPV: string;
begin
Result := LectureVersion(8,'');
end;
function TdbpVersionInfo.GetC: string;
begin
Result := LectureVersion(9,'');
end;
// petite fonction pour une sortie plus belle et rapide, ex: "Version 2.0 (build 21.12)"
function TdbpVersionInfo.FileVersionFmt: string;
begin
Result := Format('Version %s.%s (build %s.%s)',[GetMajor,GetMinor,GetRelease,GetBuild]);
end;
function TdbpVersionInfo.GetMajor: string;
begin
Result := sm.Before('.',LectureVersion(0,''));
end;
function TdbpVersionInfo.GetMinor: string;
begin
Result := sm.Between('.','.',LectureVersion(0,''));
end;
function TdbpVersionInfo.GetRelease: string;
begin
Result := sm.BetweenRev('.','.',LectureVersion(0,''));
end;
function TdbpVersionInfo.GetBuild: string;
begin
Result := sm.AfterRev('.',LectureVersion(0,''));
end;
procedure Register;
begin
RegisterComponents('Diabloporc', [TdbpVersionInfo]);
end;
end.
Conclusion
ps : StrManager est necessaire ! (StrMan.pas)
Sources du même auteur
Sources de la même categorie
Commentaires et avis
Discussions en rapport avec ce code source dans le forum
pb d'execution du programme [ par drew00 ]
je travaille actuellement sur une version d'evaluation de delphi.j'ai essayé d'executer mon programme depuis une machine ou le logiciel n'est pas inst
Version de démonstration d'un logiciel sous delphi 5 [ par bfouad ]
Bonjour,Je désire connaître, s'il y'a une méthode sous delphi, pour créer une version de démonstration d'un logicel.Merci
Trial Version Delphi 6 ! [ par titi29 ]
J'ai réalisé un programme avec la version Trial de Delphi 6 Entreprise. J'ai compilé mon programme avant la fin de ma période de 60 jours.Et les 60 jo
pb infos de version [ par smazaudi ]
Bonjour à tous Voilà, je développe actuellement en Delphi 5 (je sais que c'est dépassé mais je n'ai pas le choix). Je viens d'améliorer mon soft et d
Un programme pour modifier le numéro de version [ par vivelesquads ]
Bonjour,J'ai besoin d'écrire un programme avec Delphi 7 qui puisse modifier le numéro de version d'un exécutable(créé par Delphi mais je ne pense pas
Problème avec la procedure Exit [ par christophedlr ]
Bonjour,Dans mon programme, j'ai fait une DLL contenant des fonctions que j'utilise dans le programme ainsi que dans l'utilitaire de mise à jour.J'ai
Relancer un programme [ par manu00 ]
Bonjour,J'aimerai que mon application que je fais en delphi, a son lancement, demarre un autre logiciel, qu'a sa fermeture, elle ferme ce logiciel (se
Informations de version d'un projet [ par vincentstryckmans ]
Bonjour,Je souhaite récupérer les infos de version de mon projet et les afficher dans mon appli.J'utilise l'exemple donné dans l'aide de delphi (Bouto
Version de logiciel utilisé [ par WhiteHippo ]
Qu'en pensez-vous ? Ne serait-il pas intéressant d'avoir dans le forum, à côté du nom du membre ou ailleurs (Hint ??, mais rapidement accessible) la v
Chemin base des données sur le serveur non trouvé [ par notrica ]
Salut,J'ai installer mon logiciel sur le serveur win 2003, la base des données se trouve dans un repertoire different de là où se trouve le programme.
|
Derniers Blogs
[SHAREPOINT] LES SESSIONS TECHDAYS 2012.[SHAREPOINT] LES SESSIONS TECHDAYS 2012. par Patrick Guimonet
Voici donc pour ceux qui n'ont pas pu venir, ou ceux qui n'ont pas pu toutes les suivre la liste des sessions SharePoint aux TechDays 2012, que je mettrais à jour dès que les liens des vidéo seront disponibles. Ou ici : http...
Cliquez pour lire la suite de l'article par Patrick Guimonet TECHDAYS PARIS 2012 : SESSION PLEINIèRE JOUR 3TECHDAYS PARIS 2012 : SESSION PLEINIèRE JOUR 3 par ROMELARD Fabrice
Speaker: Bernard Ourghanlian Cette session est comme chaque jour transmise en live par BrainSonic, et j'ai donc suivi cette troisième pleinière par ce moyen sur mon iPad . Elle est dédiée comme chaque année à la mise en perspective de l'é...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice MISHRA READER : UN LECTEUR RSS TRèS ZUNE STYLE EN OPEN SOURCE !MISHRA READER : UN LECTEUR RSS TRèS ZUNE STYLE EN OPEN SOURCE ! par Vko
Hier durant une session dédiée aux Techdays 2012, j'ai eu le plaisir d'annoncer la sortie de la Béta 2 de Mishra Reader. C'est quoi ? Pour les utilisateurs, c'est une vraie expérience de lecture de flux RSS sur Windows. Rien à voir avec les produit...
Cliquez pour lire la suite de l'article par Vko [FRAMEWORK 4] LES TASKS ET LE THREAD UI[FRAMEWORK 4] LES TASKS ET LE THREAD UI par fathi
Je viens de passer quelques temps au TechDay's et j'ai pu voir pas mal de session intéressante. Par contre une chose m'a un peu étonné lors de certaines de ces sessions qui abordaient les améliorations du framework .NET (donc le 4.5) : en gros, bea...
Cliquez pour lire la suite de l'article par fathi WORKFLOW FOUNDATION 3 A UN PIED DANS LA TOMBEWORKFLOW FOUNDATION 3 A UN PIED DANS LA TOMBE par JeremyJeanson
Depuis déjà un an, je conseille vivement les utilisateurs de Workflow Foundation 3 à migrer vers la version 4. L'information qui va suivre ne devrait donc pas trop prendre au dépourvu les personnes qui m'ont suivi. Je profite de ce poste, pour faire le re...
Cliquez pour lire la suite de l'article par JeremyJeanson
Logiciels
Academy System (17.2.1.0)ACADEMY SYSTEM (17.2.1.0)Logiciel de gestion des établissements.
- élèves/étudiants (inscription, dossier, absence...)
-... Cliquez pour télécharger Academy System Easy-Planning (1.0.0.1)EASY-PLANNING (1.0.0.1)Basé sur les mêmes principes que MyPlanning, Easy-Planning permet de créer des plannings sous la ... Cliquez pour télécharger Easy-Planning COLLECTOR PLUS (3.00B)COLLECTOR PLUS (3.00B)COLLECTOR PLUS version 3.00B est un logiciel utilisant une base de données alimentée par :
- L... Cliquez pour télécharger COLLECTOR PLUS PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V7.4)PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V7.4)PONAMEDIA TV DEVIENS HELLLOOO FLASH
LA TV SUR VOTRE ORDINATEUR.
Toute une plateforme Multi... Cliquez pour télécharger PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO LettresFaciles 2011 (8.0.0.1)LETTRESFACILES 2011 (8.0.0.1)LettresFaciles est un logiciel facilitant la création et la rédaction de lettres types.
Son inte... Cliquez pour télécharger LettresFaciles 2011
|