tags:

views:

20

answers:

3

I need to create a resource file for a .net project (by hand) and compile it using the ResGen.exe tool provided by the .NET framework. I can't find any documentation for this. I need to write the resource file by hand because I'm in a situation where I don't want to download/buy extra tools (like VS) to generate this resource file, and also I feel more productive through the command-line (helps me understand how things really work).

So I need to write a resource file by hand to store an ICON in the executable and use it from within my program. I would also like to use this icon to represent my executable in Windows Explorer.

Any references would be great!

+1  A: 

These 2 links in conjunction provide information on using that tool to create and embed an icon file, it seems specific to C#. Of course i'm guessing at your full intention, let me know if this points you in the proper direction.

http://www.xtremedotnettalk.com/showthread.php?t=75449

specifically there is a post which states; I think you should first create a *.resources-File from the Icon with the tool named "Resgen.exe"...

resgen App.ico App.ico.resources

the next step would be compiling...

csc /t:winexe /out:Keygen.exe /res:App.ico.resources /r:Crypto.dll /win32icon:App.ico Keygen.cs AssemblyInfo.cs

I'm sure you were here already. http://msdn.microsoft.com/en-us/library/ccec7sz1(VS.80).aspx

halfevil
You use Resgen to compile a resx file and create the resource file. The question is how to embed the icon in the resx file so it can be compiled into a resource file.
pstrjds
+1  A: 

Visual C# Express Edition will do what you want for free. If nothing else you can download that, create the resource file and then use that as a subject for your admirable curiosity about 'how it really works'. This may also save you some time in manual experimentation to get it right the first time around.

Steve Townsend
+1  A: 

You should check this link: http://msdn.microsoft.com/en-us/library/ekyft91f.aspx

It explains what formatter is used and gives some code samples to generate one from code. You could then write a small wrapper app that you can call from the command line. No downloads needed!

pstrjds