Version Info

Viewing 8 reply threads
  • Author
    Posts
    • #1578
      Barry Wood
      Participant

        Hi,

        I have a TRzVersionInfo on my main form and in the FormActivate I have following code:

        fMain.Caption:= ‘ v’ + VI.FileVersion;

        However, when I run the app I get ‘vValueNotAvailable’

        In Project, Options, Version Info I have ‘Include version information in project’ ticked, with currently MAjor version of 1 Minor version of 0.

        Why does this not show?

      • #1581
        Ray Konopka
        Keymaster

          Hi

          There are actually two version numbers available in the VersionInfo block: ProductVersion and FileVersion. I suspect that you have the ProductVersion set but are querying the FileVersion.

          Ray

        • #1582
          Barry Wood
          Participant

            Ray,

            Both ProductVersion and FileVersion have values in them, I’m actually trying to show FileVersion but am getting the ‘ValueNotAvailable’ message. I get the same message if I try to show the ProductVersion.

            I’m using Delphi 10.3.3. It strikes me there are a few things that don’t work properly in this version – When I set the Locale ID to English(United Kingdom) and Save, it doesn’t save (reverts back to US). I’ve reported this to Embarcadero (like tossing a coin down a bottomless well, it seems). Maybe this problem is affecting your VersionInfo as well?

          • #1590
            Ray Konopka
            Keymaster

              Hi Barry,

              Sorry for the delay. I missed your response. Anyway, I created a brand new VCL app in 10.3.3 to try out the version info and everything worked as expected. Specifically, I just created a new VCL Forms app. Dropped a TRzVersionInfo component and a few TRzVersionInfoStatus controls on the form. I hooked them all up and then went into the Project Options (Version Info was already turned on). I then changed the Version fields (which updated the FileVersion property). I also changed the Product Version field to be something different so that I could test both status fields. All the data was displayed correctly.

              I then went and changed the Locale ID on the VersionInfo page to be English(United Kingdom) and rebuilt and ran the app, and the version info was displayed correctly.

              I’d be curious to know if you repeat the above steps does everything work, or do you get the same issue.

              Ray

            • #1593
              Barry Wood
              Participant

                Hi Ray,

                OK, I created a new project and did the same as you above, and everything worked fine. What I wasn’t doing originally was dropping the TRzVersionInfoStatus controls on my form. I thought this might the the problem (although I’ve not used these controls before). Alas, even dropping these on the form in my other project and setting them to various of the fields, when I run the project nothing displays in the field. They all say ‘Value Not Available’.

                The curious thing is in the ‘new’ test project (were everything worked) when I set the Locale ID to English(United Kingdom) and save, it is saved. Whereas in all my other projects when I change that value from United States to United Kingdom and save, the value is not saved. Has this got a bearing on how your controls work?

                As an aside, if this forum had the ability to attach screen shots it might be easier to see some of the problems.

              • #1595
                Ray Konopka
                Keymaster

                  Hi Barry,

                  A couple things to check/try.

                  1. Drop a new button on your app and add the following in the event handler. The code essentially performs the same steps that the TRzVersionInfo component provides. As such, I am expecting that you will be getting the Version Info Not Available message when you run it.

                  procedure TForm24.RzButton1Click(Sender: TObject);
                  var
                    InfoSize, Temp: DWord;
                    FilePath: string;
                    PathStz: array[ 0..MAX_PATH ] of Char;
                  begin
                    GetModuleFileName( HInstance, PathStz, SizeOf( PathStz ) );
                    FilePath := PathStz;
                  
                    InfoSize := GetFileVersionInfoSize( PChar( FilePath ), Temp );
                    if InfoSize > 0 then
                      ShowMessage( 'Version Info Available' )
                    else
                      ShowMessage( 'Version Info Not Available' );
                  end;

                  2. If you were to look in the source for the TRzVersionInfo component, you would see that the above code actually checks the FilePath property first. So, my next question, have you assigned anything to the TRzVersionInfo.FilePath property either at design-time or runtime?

                  And finally, I’ll look into how we can allow images to be added to forum posts.

                  Ray

                • #1596
                  Barry Wood
                  Participant

                    Hi Ray,

                    Did that, and as you thought, I get the ‘Version info not available’ message. The control has nothing in the FilePath property.

                    What is also interesting is that on an earlier project I did the same thing and do get ‘Version Info Available’. Nothing in the FilePath here, either. And the Locale ID info still doesn’t get saved on this project either. Is it a coincidence that this isn’t saved (as it is on that new test project I did earlier).

                  • #1612
                    Ray Konopka
                    Keymaster

                      It certainly sounds like the locale ID not being saved is definitely having something to do with the behavior you are seeing. The only thing that I can think of is that one or more files are marked as read only and when you go to change it, they are not changing.

                      Have you tried running Delphi as an administrator and then try to change the locale?

                      Ray

                    • #1618
                      Barry Wood
                      Participant

                        Ray,

                         

                        Yes, I’ve just tried that and no difference, just stays as United States. Another oddity is that I’ve some code that allows the User to choose a Style from a drop-down box. The same code works OK on other projects but doesn’t work on this one.

                        Maybe all these oddities are related. I wonder if it may be an idea to uninstall 10.3.3 and re-install it. Seems a lot of effort but may be the only way to solve this one?

                    Viewing 8 reply threads
                    • You must be logged in to reply to this topic.