3

I cannot see to get an XE2 project to include version information in the project files. A minimal project: program Project1;

uses
  Vcl.Forms,
  Unit2 in 'Unit2.pas' {Form2};

  {$R *.res}

begin
  Application.Initialize;
  Application.MainFormOnTaskbar := True;
  Application.CreateForm(TForm2, Form2);
  Application.Run;
end.

and a blank unit:
    unit Unit2;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes,       Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs;

type
 TForm2 = class(TForm)
 private
{ Private declarations }
 public
{ Public declarations }
 end;

var
  Form2: TForm2;

implementation

{$R *.dfm}

end.

Compiles fine and I have "Project>>Options>>Version Info>>Include version information in project' Checked. If I uncheck it and come back its still checked as if the file is read only. No idea which file could have become read only?

Seti Net
  • 693
  • 1
  • 7
  • 24
  • Did you rebuild the project ? Not compiled, rebuild... – TLama Feb 19 '14 at 15:58
  • Yes I did. Any changes I put in work as expected. I opened the XE2 base directory (on my B:Drive which is a SSD) and checked the properties with Windows Explorer (Win 7). The 'Read-only' check box is lite up (not checked and not blank) so I assume that one of the files, at least, is read-only. I unchecked that and hit 'apply' but the box is still lite up. Could this be the problem? – Seti Net Feb 19 '14 at 18:27
  • @SetiNet Windows will keep doing that with the Read Only flag in Explorer. Don't take any notice of that. You can do the same with pretty much any folder on your PC. There may be some logic behind it but I haven't picked up what it is yet. – Graymatter Feb 19 '14 at 18:53

2 Answers2

2

For your problem where it is not saving the selection you are probably changing the version information only in the Debug Configuration Target. At the top of the right hand panel there is a drop down box called Target. Select "All Configurations - All Platforms - 32-bit Windows platform" and uncheck it from there. After that, save and go back in, you will see that it saves the setting. After that you can uncheck it from the debug configuration and it will save. Delphi is inheriting the setting from the "All configurations" option for some reason.

S̶e̶e̶ ̶i̶f̶ ̶p̶u̶t̶t̶i̶n̶g̶ ̶a̶l̶l̶ ̶o̶f̶ ̶t̶h̶e̶ ̶v̶e̶r̶s̶i̶o̶n̶ ̶d̶e̶t̶a̶i̶l̶s̶ ̶y̶o̶u̶ ̶w̶a̶n̶t̶ ̶i̶n̶ ̶t̶h̶e̶ ̶a̶p̶p̶l̶i̶c̶a̶t̶i̶o̶n̶ ̶i̶n̶ ̶t̶h̶e̶ ̶"̶A̶l̶l̶ ̶C̶o̶n̶f̶i̶g̶u̶r̶a̶t̶i̶o̶n̶s̶"̶ ̶v̶e̶r̶s̶i̶o̶n̶ ̶i̶n̶f̶o̶ ̶h̶e̶l̶p̶s̶.̶I̶ ̶a̶m̶ ̶n̶o̶t̶ ̶a̶w̶a̶r̶e̶ ̶o̶f̶ ̶a̶ ̶p̶r̶o̶b̶l̶e̶m̶ ̶i̶n̶ ̶D̶e̶l̶p̶h̶i̶ ̶w̶h̶e̶r̶e̶ ̶i̶t̶ ̶d̶o̶e̶s̶n̶'̶t̶ ̶p̶u̶t̶ ̶t̶h̶e̶ ̶v̶e̶r̶s̶i̶o̶n̶ ̶i̶n̶f̶o̶r̶m̶a̶t̶i̶o̶n̶ ̶i̶n̶ ̶t̶h̶e̶ ̶E̶X̶E̶ ̶f̶i̶l̶e̶ ̶w̶h̶e̶n̶ ̶i̶t̶ ̶o̶n̶l̶y̶ ̶c̶o̶m̶e̶s̶ ̶t̶o̶ ̶d̶e̶b̶u̶g̶ ̶v̶e̶r̶s̶i̶o̶n̶s̶ ̶b̶u̶t̶ i̶t̶ ̶m̶a̶y̶ ̶b̶e̶ ̶s̶o̶m̶e̶t̶h̶i̶n̶g̶ ̶r̶e̶l̶a̶t̶e̶d̶ ̶t̶o̶ ̶X̶E̶2̶.̶

Updated to include the version cleanup project that Remi mentioned below:

https://github.com/ronaldhoek/delphiprojectcleanup

Jan Doggen
  • 8,799
  • 13
  • 70
  • 144
Graymatter
  • 6,529
  • 2
  • 30
  • 50
  • It is a known problem that per-build version settings take priority over all-configuration version settings, even after you set the all-configuration settings and clear the per-build configuration. There are third party tools floating around that clean up the version info "garbage" to make all-configuration work correctly. – Remy Lebeau Feb 19 '14 at 20:20
  • @RemyLebeau Thanks, didn't know that. Are you talking about DDevExtensions http://andy.jgknet.de/blog/ide-tools/ddevextensions/? – Graymatter Feb 19 '14 at 20:34
  • I don't recall the specific tool(s), I just know there are some floating around. Search in the Embarcadero forums for past discussions on the matter. – Remy Lebeau Feb 19 '14 at 20:36
  • Still no joy. I compiled the clean up tool and ran it against my project. It did 'something' and then left its progress bar up. I re-loaded XE2 and the default program but it still does not Include the version information or auto generate the build number. – Seti Net Feb 20 '14 at 01:33
  • Messing around with some more I managed to get it to save the version information in the EXE but I cannot get it to Auto Increment the build number. – Seti Net Feb 20 '14 at 01:45
  • 1
    @SetiNet I believe that is a problem that was only fixed in XE3 - See here http://qc.embarcadero.com/wc/qcmain.aspx?d=98487 – Graymatter Feb 21 '14 at 00:43
-4

In case it helps anyone, in XE2 the logic is reversed, so

Application.MainFormOnTaskbar := true;//will NOT show the icon on the task bar
Application.MainFormOnTaskbar := false;// WILL show the icon on the task bar

At least this is the case for me.

Anshul Goyal
  • 73,278
  • 37
  • 149
  • 186
  • This has nothing to do with the question asked. Read the text instead of just grabbing one line of code out of context and posting an answer to a totally different topic. – Ken White Dec 20 '17 at 21:50