Search code examples
c++-climixed-modeassemblyinfo

Add Company Name, Product Name, etc to Mixed Mode Assembly DLL


I'm building a mixed-mode assembly with C++/CLI but I can't figure out how to add standard Windows Assembly attributes like Company Name, Copyright, Product Name, Version, etc. There isn't a resource file that works like AssemblyInfo.cs does in C#. I tried Add->Resource->Version but that just gives me a standard ProjectName.rc. Anyone knows how to do this?


Solution

  • It took a while to figure out, and the GUI is buggy so I finally edited it by hand. I've pasted the final contents of my ProjectName.rc that generates proper Windows Assembly Properties. You can just create an RC file and paste this into it.

    If your project is an EXE project, replace FILETYPE 0x2L with FILETYPE 0x1L

    #include <windows.h>
    
    LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
    
    /////////////////////////////////////////////////////////////////////// 
    // 
    // Version
    // 
    
    VS_VERSION_INFO VERSIONINFO
     FILEVERSION 1,0,0,1
     PRODUCTVERSION 1,0,0,1
     FILEFLAGSMASK 0x3fL
    #ifdef _DEBUG
     FILEFLAGS 0x1L
    #else
     FILEFLAGS 0x0L
    #endif
     FILEOS 0x40004L
     FILETYPE 0x2L
     FILESUBTYPE 0x0L
    BEGIN
        BLOCK "StringFileInfo"
        BEGIN
            BLOCK "040904b0"
            BEGIN
                VALUE "Comments", "Sample Application"
                VALUE "CompanyName", "My Company"
                VALUE "FileDescription", "My Application"
                VALUE "FileVersion", "1, 0, 0, 1"
                VALUE "InternalName", "MyProject"
                VALUE "LegalCopyright", "Copyright (C) My Company 1999"
                VALUE "OriginalFilename", "MyProject.dll"
                VALUE "ProductName", "MyProject"
                VALUE "ProductVersion", "1, 0, 0, 1"
            END
        END
        BLOCK "VarFileInfo"
        BEGIN
            VALUE "Translation", 0x409, 1200
        END
    END