如何从命令行编译 Delphi RES 文件

发布于 2024-07-24 01:22:27 字数 72 浏览 11 评论 0原文

我以前从未使用过Delphi,所以也许这个问题看起来很简单,但我需要从命令行更改RES资源文件参数中的FileVersion...

I never worked with Delphi before, so maybe the question looks a simple minded, But I need to change FileVersion in RES resource file parameter from command line...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

冷心人i 2024-07-31 01:22:27

在这里可以找到 Borland 资源编译器:

%ProgramFiles%\Borland\Delphi7\Bin\brcc32.exe

编辑: 正如 mghie 提到的,您可以创建一个如下所示的 RC 文件:

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1, 0, 0, 100
PRODUCTVERSION 1, 0, 0, 1
 FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
 FILEFLAGS 0x9L
#else
 FILEFLAGS 0x8L
#endif
 FILEOS 0x4L
 FILETYPE 0x1L
 FILESUBTYPE 0x0L
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "040904b0"
        BEGIN
            VALUE "Comments", "Modified by BZCToOn's"
            VALUE "CompanyName", "Syntheretix"
            VALUE "FileDescription", "rcversion MFC Application"
            VALUE "FileVersion", "1, 0, 0, 100"
            VALUE "InternalName", "rcversion"
            VALUE "LegalCopyright", "Copyleft (C) Bzc ToOn'S 2002"
            VALUE "OriginalFilename", "rcversion.EXE"
            VALUE "PrivateBuild", "RCVERSION-20030212_100"
            VALUE "ProductName", "rcversion Application"
            VALUE "ProductVersion", "1, 0, 0, 1"
        END
    END
    BLOCK "VarFileInfo"
    BEGIN
        VALUE "Translation", 0x409, 1200
    END
END

(复制自 http://www.codeproject.com/KB/applications/cb2rcversion.aspx< /a>)

并使用 BRCC32 进行编译。 在您必须在项目设置中禁用版本信息之前。

编辑:更多信息...

http://msdn .microsoft.com/en-us/library/aa380599.aspx

http ://msdn.microsoft.com/en-us/library/aa381058.aspx

Here can find the Borland resource compiler:

%ProgramFiles%\Borland\Delphi7\Bin\brcc32.exe

EDIT: As mghie mentioned you could create a RC file like this one:

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1, 0, 0, 100
PRODUCTVERSION 1, 0, 0, 1
 FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
 FILEFLAGS 0x9L
#else
 FILEFLAGS 0x8L
#endif
 FILEOS 0x4L
 FILETYPE 0x1L
 FILESUBTYPE 0x0L
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "040904b0"
        BEGIN
            VALUE "Comments", "Modified by BZCToOn's"
            VALUE "CompanyName", "Syntheretix"
            VALUE "FileDescription", "rcversion MFC Application"
            VALUE "FileVersion", "1, 0, 0, 100"
            VALUE "InternalName", "rcversion"
            VALUE "LegalCopyright", "Copyleft (C) Bzc ToOn'S 2002"
            VALUE "OriginalFilename", "rcversion.EXE"
            VALUE "PrivateBuild", "RCVERSION-20030212_100"
            VALUE "ProductName", "rcversion Application"
            VALUE "ProductVersion", "1, 0, 0, 1"
        END
    END
    BLOCK "VarFileInfo"
    BEGIN
        VALUE "Translation", 0x409, 1200
    END
END

(copied from http://www.codeproject.com/KB/applications/cb2rcversion.aspx)

And compile it using BRCC32. Before you have to disable version information in project settings.

EDIT: Further information ...

http://msdn.microsoft.com/en-us/library/aa380599.aspx

http://msdn.microsoft.com/en-us/library/aa381058.aspx

維他命╮ 2024-07-31 01:22:27

只是要添加到 ulrichb 的答案中...

提示:创建一个 .RC 文件并使用 {$R} 指令将其包含到您的项目中。

{$R 'Splash.res' 'Splash.rc'}

上面的指令是我用来包含闪屏图像的指令。 它将自动编译.RC 文件。
作为一个选项,您可以将 .RC 包含到您的 Delphi 项目中,在这种情况下,上面的行将被添加到您的项目文件 (*.DPR) 中,并且它也会自动编译。 (并且您可以使用 Delphi 编辑 .RC 文件。)

请注意不要为资源文件指定与项目文件相同的名称。 这对于 Delphi 来说太混乱了。

Just going to add to ulrichb's answer...

Hint: Create an .RC file and use the {$R} directive to include it to your project.

{$R 'Splash.res' 'Splash.rc'}

Above directive is what I use to include an image for a splash screen. It will automatically compile the .RC file.
As an option, you can just include the .RC to your Delphi project, in which case the above line will be added to your project file (*.DPR) and it will also automatically compile. (And you can use Delphi to edit the .RC file.)

Do be careful that you don't give the resource file the same name as your project file. This becomes too confusing for Delphi.

書生途 2024-07-31 01:22:27

如果您使用delphi构建应用程序,则可以在projectsettings下打开buildnumber的自动递增。

或者使用 StampVer

If you use delphi to build your application, you can turn on auto-incrementation of the buildnumber under projectsettings.

Or use StampVer

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文