The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Strobe Raver on August 10, 2009, 11:10:40 PM

Title: "About Dll" Settings
Post by: Strobe Raver on August 10, 2009, 11:10:40 PM
Anyway to put a name, description, author, date created on a dll file with Masm32?

Like so in C#:
//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]


[assembly: AssemblyVersion("1.0.*")]
Title: Re: "About Dll" Settings
Post by: Astro on August 10, 2009, 11:16:18 PM
Hmm... Interesting question!

You might need to create a resource file to do that.

Best regards,
Astro.
Title: Re: "About Dll" Settings
Post by: Strobe Raver on August 10, 2009, 11:23:33 PM
Would it be possible to create a resource file in the QEditor?
Title: Re: "About Dll" Settings
Post by: Astro on August 11, 2009, 12:01:56 AM
Found this! Looks interesting!! http://www.resedit.net/

QuoteWould it be possible to create a resource file in the QEditor?
If you know the format the .rc file needs to be in, you can use the menu to compile it to binary file than you can then link with. The linker converts the .res file to COFF format before adding it to the final .exe.

Best regards,
Astro.
Title: Re: "About Dll" Settings
Post by: fearless on August 11, 2009, 12:04:01 AM
RadASM has an option to add versioninfo resource which contains all the above info

Or you could add your own file (mydll.rc for example) and manually add the contents:

#define VERINF1 1
VERINF1 VERSIONINFO
FILEVERSION 1,0,0,0
PRODUCTVERSION 1,0,0,0
FILEOS 0x00000004
FILETYPE 0x00000000
BEGIN
 BLOCK "StringFileInfo"
 BEGIN
   BLOCK "040904B0"
   BEGIN
     VALUE "CompanyName", "fearless\0"
     VALUE "FileVersion", "1.0.0.0\0"
     VALUE "FileDescription", "AutoUpdate Uploader\0"
     VALUE "InternalName", "AUUploader\0"
     VALUE "LegalCopyright", "(C) 2009 -[Nwo]- fearless\0"
     VALUE "LegalTrademarks", "(C) 2009 -[Nwo]- fearless\0"
     VALUE "OriginalFilename", "AUUploader.exe\0"
     VALUE "ProductName", "AUUploader\0"
     VALUE "ProductVersion", "1.0.0.0\0"
   END
 END
 BLOCK "VarFileInfo"
 BEGIN
   VALUE "Translation", 0x0409, 0x04B0
 END


then use RC.EXE to compile the resource to a .res file, then convert it to an object file with CVTRES.EXE and finally link in the OBJ file to your other OBJ files to create your EXE or DLL

Using RadASM it is a much easier process
Title: Re: "About Dll" Settings
Post by: dedndave on August 11, 2009, 12:06:28 AM
you guys should have a look at Erol's site (Vortex)
he has some cool stuff there
also, he is invaluable when it comes to helping us make sense of this type of thing

http://www.vortex.masmcode.com/
Title: Re: "About Dll" Settings
Post by: Astro on August 11, 2009, 12:22:54 AM
Bookmarked!  :U

Thanks!

I tried the resource editor app I linked to - it created the Version tab but it was empty.

@fearless: That worked! I've been searching the 'net and couldn't find anything relating to the actual format of the source file. All the information MS seem to have is .NET orientated now.  :(

Best regards,
Astro.
Title: Re: "About Dll" Settings
Post by: Strobe Raver on August 11, 2009, 12:39:10 AM
I think I will be using RadASM IDE instead. fancy stuff  :cheekygreen:  :boohoo:



It's not working for me, setting the file details for a DLL
Title: Re: "About Dll" Settings
Post by: Strobe Raver on August 11, 2009, 01:15:12 AM
it isn't work for me  :dazzled:

how do I put a resource file into a dll?  :'(
Title: Re: "About Dll" Settings
Post by: dedndave on August 11, 2009, 01:21:49 AM
http://www.masm32.com/board/index.php?board=10.0
Title: Re: "About Dll" Settings
Post by: Strobe Raver on August 11, 2009, 01:38:53 AM
Quote from: dedndave on August 11, 2009, 01:21:49 AM
http://www.masm32.com/board/index.php?board=10.0

Would you know how to put a resource file into a static-library?
Title: Re: "About Dll" Settings
Post by: dedndave on August 11, 2009, 02:13:56 AM
so far, i have only used one to create an icon
(i will want to learn more about it in a short time - i have a few things i want to learn before i move on)
but, that forum has all kinds of threads on the subject
use the search window
also, Vortex is the man for this kind of stuff
his site....
http://www.vortex.masmcode.com/
Title: Re: "About Dll" Settings
Post by: fearless on August 11, 2009, 02:42:22 AM
To add a resource file into your dll using RadASM:

- Create new DLL project: File Menu->New Project->DLL Project radio button

- Add your code as required, define your .def file library exports

- Add the version resource to your project by clicking on Project Menu->Versioninfo

- Edit the version info information to your liking

- Assemble, Link or Build to compile all together

- Right click on DLL in windows explorer, properties, version tab to view all your info you have just added to your DLL
Title: Re: "About Dll" Settings
Post by: Strobe Raver on August 11, 2009, 03:34:16 AM
I have it working in MASM32 QEditor. Used a program called "RLINK32.EXE (http://www.powerbasic.com/files/pub/tools/win32/RLink32.zip)" (Homepage (http://www.powerbasic.com/files/pub/tools/win32/))

Just had to link the compiled resource file (.RES) to the library (.DLL).  :green2

---

What's neat is I found "Edit -> Settings -> Edit Menus"

With just a few clicks, I can: build a DLL, and link a resource file to it.  :dance:

---

RLINK32.EXE does not take directories so this handy batch file will work:
@echo off

REM Link resource files to dll/exe with this

COPY /Y RLINK32.EXE %1
CD %1
START "RLINK32.EXE %2 %3"
ECHO
ECHO Cleaning up...
DEL /F /Q "RLINK32.EXE"
PAUSE
[/s]
Title: Re: "About Dll" Settings
Post by: Astro on August 11, 2009, 03:18:29 PM
Hi,

If you've got the paths set up, create the resource file, then as part of the link line (after compiling the .rc to .res using rc.exe) add:

LINK (parameters here) SomeFile.obj SomeFile.res

This will add the resources to the final exe/dll/etc.. and you're good to go!  :thumbu

Best regards,
Astro.
Title: Re: "About Dll" Settings
Post by: Vortex on August 11, 2009, 08:23:33 PM
Quote from: Strobe Raver on August 11, 2009, 01:38:53 AM
Quote from: dedndave on August 11, 2009, 01:21:49 AM
http://www.masm32.com/board/index.php?board=10.0

Would you know how to put a resource file into a static-library?

Hi Strobe Raver,

I managed to created a static library from .res files converted to .obj :


res2obj ColorDlg.res Rsrc1.obj _ColorDlg
res2obj Listbox.res Rsrc2.obj _Listbox
\masm32\bin\link -lib /OUT:Rsrc.lib *.obj


_ColorDlg and _Listbox are labels referencing to the binary resource data.

Title: Re: "About Dll" Settings
Post by: Strobe Raver on August 11, 2009, 11:00:46 PM
Thank you