0

When I try to build some DPKs in IDE it compiles properly and generates a appropriate BPLs, but when I try to do it with the command line, using Delphi 10.2 Tokyo then I'm getting errors like:

... .rc(14) : error RC2132 : expected VALUE, BLOCK, or END keyword

I've found out that before compilation that RC file looks like:

1 VERSIONINFO
FILEVERSION 1,0,0,0
PRODUCTVERSION 1,0,0,0
FILEFLAGSMASK 0x3FL
FILEFLAGS 0x00L
FILEOS 0x40004L
FILETYPE 0x1L
FILESUBTYPE 0x00L
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
         BLOCK "040904E4"
         BEGIN
              VALUE "FileVersion", "1.0.0.0\0"
              VALUE "ProductVersion", "1.0.0.0\0"
         END
    END
    BLOCK "VarFileInfo"
    BEGIN
         VALUE "Translation", 0x0409, 1252
    END
END

but after failed build try Delphi changes it into:

1 VERSIONINFO
FILEVERSION 1,0,0,0
PRODUCTVERSION 1,0,0,0
FILEFLAGSMASK 0x3FL
FILEFLAGS 0x00L
FILEOS 0x40004L
FILETYPE 0x1L
FILESUBTYPE 0x00L
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
         BLOCK "040904E4"
         BEGIN

So for some reason Delphi tries to overwrite the RC file but stops in the middle and than is unable to parse it.

What can be the reason for this strange behaviour?

PS: This is a standard RC file generated by Delphi IDE while creating DPK project. I did not make any changes in it.

I've already tried to delete it and recreate with the IDE.

I'm unable to tell you which command is used to generate the BPL because I use FinalBuilder 8 to do that

Gilmor
  • 439
  • 1
  • 3
  • 11
  • 1
    Can you explain the part that your rc file plays in the build? Where is it referenced in your project? How you use the command line. Etc. In short, detail. How can we repro this? – David Heffernan Sep 13 '17 at 06:51
  • I've updated the question – Gilmor Sep 13 '17 at 07:15
  • 2
    This seems like it's a final builder question. Contact them for support. Unless something has changed, the IDE doesn't create an rc file in the project directory. That sounds like final builder. – David Heffernan Sep 13 '17 at 07:17
  • The key was that Delphi did not generate an RC file:) Thank you very much @DavidHeffernan, I've missed that. You was correct, It's a FinalBuilder thing. When I uncheck "Regenerate resource" in final builder everything work like a charm. Once again, thanks :) – Gilmor Sep 13 '17 at 08:59

2 Answers2

2

Thanks to @DavidHeffernan comment, I checked that once again and it turned out that the problem was with regenerating the resource file by Final Builder.

When I've unchecked "Version info" and "Regenerate resource" in the final builder action, everything works fine.

Right now I don't know what exactly is causing the problem in Final Builder, but disabling these options does the job for me

enter image description here

Gilmor
  • 439
  • 1
  • 3
  • 11
  • Well, certainly I would file a bug report to the authors about this issue. – Victoria Sep 13 '17 at 09:56
  • 1
    I will, but some project compiles properly so at first I have to figure out what exactly generates that problems and then I will post it to the authors – Gilmor Sep 13 '17 at 12:02
1

This most likely a problem with the default version info variables that Tokyo sets - see Delphi Version Info Errors

Vincent Parrett
  • 581
  • 5
  • 9
  • 1
    BTW, we improved the error handling around this issue in a recent update, so it won't write out an incomplete rc file, instead it will report the error with the variable references. – Vincent Parrett Sep 13 '17 at 23:20
  • Thanks @VincentParrett. Would it be resolved in the future by FinalBuilder itself? I'm asking because according to the solution from your blog: manual correction of all dproj files would be a little bit annoying, adding ModuleName variable in final builder does not resolves all errors and I cant let Final Builder to handle it completely, because there ale no .res file in most of my components. Normally IDE generates it while compile. If I disable in FinalBuilder loading the version info from the dproj then I'm getting an errors while I do compile, saying that there are no res file – Gilmor Sep 14 '17 at 06:39
  • The delphi IDE usually generates a projectname.res file for projects, this is the file we regenerate when building (regenerate resource option). It's not possible for use to resolve this automatically, as we have no way of resolving those variables, they are not stored anywhere outside of delphi. – Vincent Parrett Sep 14 '17 at 08:12
  • Can you show what the error is? It's very difficult to diagnose a problem without seeing the errors or the dproj/dpr/dpk. – Vincent Parrett Sep 14 '17 at 08:14
  • I must apologise for my last comment. Previously I was getting and error during compile from Final Bilder a project without a .res file. When I was doing that from IDE the .res file was regenerated. Since then I've updated the FinalBuilder, installed some Delphi Fixes and right now it seems to work properly. I'm unable to reproduce that error so we can consider this problem to be no longer present. Thank you for advices @VincentPArrett – Gilmor Sep 15 '17 at 06:25