Author Topic: Version info and manifests for 64-bit and 32-bit code  (Read 439 times)

jj2007

  • Member
  • *****
  • Posts: 7752
  • Assembler is fun ;-)
    • MasmBasic
Version info and manifests for 64-bit and 32-bit code
« on: March 04, 2017, 09:42:16 PM »
A simple console application:

include \Masm32\MasmBasic\Res\JBasic.inc      ; part of MasmBasic
Init
  PrintLine Chr$("This code was assembled with ", @AsmUsed$(1), " in ", jbit$, "-bit format")
  Inkey ComCtl32$("The application uses ComCtl32.dll version %i.%i")
EndOfCode

RichMasm options:
OPT_64      1      ; 0 for 32-bit, 1 for 64-bit assembly
OxPT_Assembler      ML      ; default is HJWasm32; remove the x to test ML64


Output:
Code: [Select]
This code was assembled with HJWasm32 in 64-bit format
The application uses ComCtl32.dll version 5.82

Starting with version 4 March 2017, RichMasm can add a semi-automatic version info to this code:
- open the attached *.asc source in RichMasm
- go to the end
- from the AutoCode menu, insert Resources: version info
- hit F6 to build the project

New output:
Code: [Select]
This code was assembled with HJWasm32 in 64-bit format
The application uses ComCtl32.dll version 6.16

By right-clicking on the exe in Explorer, Properties, Details you can see the added version info:


RichMasm AutoCode inserts this:
Code: [Select]
#include "resource.h"
IDI_APPLICATION ICON "\\Masm32\\MasmBasic\\icons\\Smiley.ico" // Calc, Disk, Editor, Eye, Globe, MasmBasic, Smiley
01 RT_MANIFEST "\\Masm32\\MasmBasic\\Res\\XpManifest.xml" // works with tooltips
VS_VERSION_INFO VERSIONINFO
FILETYPE VFT_APP
FILEVERSION 1, 0, 0, 0
PRODUCTVERSION 1, 0, 0, 0
FILEOS VOS__WINDOWS32
BEGIN
  BLOCK "StringFileInfo"
  BEGIN
BLOCK "080904B0"
BEGIN
  VALUE "Comments", "This is a comment"
VALUE "FileDescription", "Testing #F$"
VALUE "ProductName", "#U$'s Assembly Tools Collection"
VALUE "ProductVersion", "Release version #D$"
VALUE "CompanyName", "MasmBasic"
VALUE "FileVersion", "1.0"
VALUE "InternalName", "Internal name"
VALUE "LegalCopyright", "© #Y$ #U$@Masm32"
VALUE "OriginalFilename", "#F$"
END
  END
  BLOCK "VarFileInfo"
  BEGIN
VALUE "Translation", 0x809, 0x4B0
  END
END

RichMasm creates the rc file, substituting
Code: [Select]
#F$  with the filename (without extension)
#U$  with the user name (as in C:\Users\NAME\Documents)
#D$  with the current date, e.g. 4 March 2017
#Y$  with the current year

Instead of relying on these variables, you can edit everything directly in the source.

This works with dual assembly code (JBasic.inc), normal 32-bit code (plain Masm32 or MasmBasic), and with all MASM-compatible assemblers.