Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-12

Resources and Version info

10 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Leonardo M. Ramé

Hi, I'm trying to convert a Delphi Dll to a Lazarus one. After a couple of changes the Dll compiles as expected, the problem is that I need to add some fields to version information resource.

When I check Project Options -> Version Information -> Include version info...

The compiler automatically generates an .rc file. If I manually edit this file adding the fields I need, the next time I compile my program, the file is recreated removing my new fields.

How can I avoid this problem?

P.S.: I'm trying to create a Netscape plugin. The browser reads the resources contained in the dll looking for the string "MIMEType".

Thanks in advance,
Leonardo.

Reply by email

Henrique Faria
to Leonardo M. Ramé

Did you check Version Info -> +Additional info? Which version info fields Lazarus doesn't have?

Henrique.

Show quoted text 27 lines
Date: Thu, 4 Dec 2008 16:37:08 -0300 From: To: Subject: [Lazarus] Resources and Version info Hi, I'm trying to convert a Delphi Dll to a Lazarus one. After a couple of changes the Dll compiles as expected, the problem is that I need to add some fields to version information resource. When I check Project Options -> Version Information -> Include version info... The compiler automatically generates an .rc file. If I manually edit this file adding the fields I need, the next time I compile my program, the file is recreated removing my new fields. How can I avoid this problem? P.S.: I'm trying to create a Netscape plugin. The browser reads the resources contained in the dll looking for the string "MIMEType". Thanks in advance, Leonardo. _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

_________________________________________________________________ Cansado de espa?o para s? 50 fotos? Conhe?a o Spaces, o site de relacionamentos com at? 6,000 fotos! http://www.amigosdomessenger.com.br
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20081205/f76c75a3/attachment.html

Reply by email

Felipe Monteiro de Carvalho
to Henrique Faria

Make the entire .rc file yourself. Possibly disable the version info taken care by the IDE or create a file with a different name from the one the IDE maintains. Link it to your project with {$R myrcfile.rc}

Felipe Monteiro de Carvalho

Reply by email

Mac Programmer

In Delphi you can add additional keys to a version info resource in addition to the standard keys, but Lazarus doesn't have a place to define additional keys, only the standard ones. The .rc file supports them okay, so just create it manually. For example, I usually add a key for Programmer so that the developer's name is embedded in the executable and displayed along with the other info in Explorer when you right-click the executable and view the version info properties.

Thanks.

-Phil

Reply by email

Graeme Geldenhuys
to Mac Programmer
Mac Programmer wrote
In Delphi you can add additional keys to a version info resource in addition to the standard keys, but Lazarus doesn't have a place to define additional keys, only the standard ones.

Yes it does. "Project Options" | "Version Information" tab | "Additional Info" button

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Leonardo M. Ramé
to Graeme Geldenhuys

Well, no, in Additional Info you can use only a predefined set of fields. It could be great if Lazarus allow adding custom fields.

Leonardo.

Graeme Geldenhuys escribi?:

Show quoted text 24 lines
On Fri, Dec 5, 2008 at 5:05 AM, Mac Programmer wrote: > In Delphi you can add additional keys to a version info resource in > addition to the standard keys, but Lazarus doesn't have a place to > define additional keys, only the standard ones. > Yes it does. "Project Options" | "Version Information" tab | "Additional Info" button Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Leonardo M. Ramé
to Felipe Monteiro de Carvalho: Make the entire .rc file yourself. Possibly disable the version info taken care by the…

It seems I'm placing the {$R myresource.rc} in the wrong place...when I try to compile I receive this error:

windres: plugin.rc:15: syntax error
NPDemo.lpr(26,1) Error: Error while compiling resources
NPDemo.lpr(26,1) Fatal: There were 1 errors compiling module, stopping

This is a the code:
------------------

library NpDemo;
uses
LResources,
NPPlugin in 'NPPlugin.pas',
NPForm in 'NPForm.pas',
NPSubCls in 'NPSubCls.pas',
{ you can add units after this }

  Unit1;

exports
NP_GetEntryPoints index 1,
NP_Initialize index 2,

  NP_Shutdown index 3;
{$R plugin.rc}
begin
end.

And this is my "plugin.rc" file:
----------------------------

1 VERSIONINFO
FILEVERSION 1, 0, 0, 1
PRODUCTVERSION 1, 0, 0, 1
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEOS VOS__WINDOWS32
FILETYPE VFT_DLL
{
BLOCK "StringFileInfo"
{
BLOCK "040904e4"
{
VALUE "CompanyName", "Mike Scott Software\000"
VALUE "FileDescription", "Delphi Netscape Plugin Sample DLL\000" VALUE "FileExtents", "mds\000"
VALUE "FileOpenName", "Mike Scott's plugin file (*.mds)\000" VALUE "FileVersion", "1, 0, 0, 1\000"
VALUE "InternalName", "SamplePlugin\000"
VALUE "LegalCopyright", "Copyright Mike Scott \251 1995\000" VALUE "MIMEType", "application/x-test-plugin\000"
VALUE "OriginalFilename", "NPDemo.dll\000"
VALUE "ProductName", "Mike Scott's Delphi Netscape Plugin Sample\000" VALUE "ProductVersion", "1, 0, 0, 1\000"
}
}

BLOCK "VarFileInfo"
{
VALUE "Translation", 1033, 1252
}
}

Leonardo M. Ram?
Griensu S.A. - Medical IT C?rdoba
Tel.: 0351 - 4247979

Felipe Monteiro de Carvalho escribi?:

Show quoted text 5 lines
Make the entire .rc file yourself. Possibly disable the version info taken care by the IDE or create a file with a different name from the one the IDE maintains. Link it to your project with {$R myrcfile.rc}

Reply by email

Paul Ishenin
to Leonardo M. Ramé
Leonardo M. Ram? wrote 7 lines
It seems I'm placing the {$R myresource.rc} in the wrong place...when I try to compile I receive this error: windres: plugin.rc:15: syntax error NPDemo.lpr(26,1) Error: Error while compiling resources NPDemo.lpr(26,1) Fatal: There were 1 errors compiling module, stopping

The error is in your .rc file on line 15.
Try to compile your .rc file with windres to see whether the problem is exactly there. Windres is much stricter than brcc32 or gorc. It is sometimes very difficult to satisfy it.

Best regards,
Paul Ishenin.

Reply by email

Leonardo M. Ramé
to Paul Ishenin

Thanks Paul!, I've commented out these fields:

#FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
#FILEOS VOS__WINDOWS32
#FILETYPE VFT_DLL

and WindRes interpreted it perfectly.

Leonardo M. Ram?

Paul Ishenin escribi?:

Show quoted text 23 lines
Leonardo M. Ram? wrote: > It seems I'm placing the {$R myresource.rc} in the wrong place...when I > try to compile I receive this error: > > windres: plugin.rc:15: syntax error > NPDemo.lpr(26,1) Error: Error while compiling resources > NPDemo.lpr(26,1) Fatal: There were 1 errors compiling module, stopping > > The error is in your .rc file on line 15. Try to compile your .rc file with windres to see whether the problem is exactly there. Windres is much stricter than brcc32 or gorc. It is sometimes very difficult to satisfy it. Best regards, Paul Ishenin. _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Mac Programmer

Leonardo is correct. The "Additional Info" fields are just the rest of the Microsoft "standard" version info keys, probably because they couldn't fit on the main panel. Although it's fun to pay homage to Microsoft with a Windows-style nested dialog approach, this dialog should have used a property list or grid or something where you can both enter values for the "standard" keys and also define new keys: MIMEType, Programmer, whatever your heart desires - i.e., like Delphi circa version 2.

Thanks.

-Phil

Reply by email