News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

manifest

Started by jimg, December 07, 2019, 09:09:21 AM

Previous topic - Next topic

jimg

Is there a way to put the manifest lines directly into the rc file, say just above the version lines, or do they always have to be in a separate included file?

hutch--

Not that I know of Jim, still, its simple enough to include an external manifest so I don't see the problem. Have a close look at the options for the linker you are using as there may be a way to do it.

jimg

Just trying to fight this excess file proliferation.  Odd that it can include it but not just take it straight.

sinsi

You can add this as a link response file

/manifest:embed
/manifestdependency:"type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'"
/manifestuac:"level='asInvoker' uiAccess='false'"


jimg

Thanks Sinsi (I think).

When you say "link response file" I'm not sure what you meant.  But since I asked to embed the commands in the .rc file, I assume that's what you gave me.

So I tried rc.exe from 1998 and got the following error-

rsrc.rc (45): error RC2135 : file not found: name

Writing /MANIFESTDEPENDENCY:"TYPE='WIN32':/MANIFEST:EMBED,      lang:0x409,     size 0.


So I thought, I probably need to use a newer resource compiler.  So I tried Pelles porc.exe from 2011 and got
PORC: rsrc.rc(44): warning: Unrecognized or misplaced token: /
PORC: rsrc.rc(45): warning: Unrecognized or misplaced token: /
PORC: rsrc.rc(45): warning: Unrecognized or misplaced token: /
PORC: rsrc.rc(45): warning: Unrecognized or misplaced token: "STRING"
PORC: rsrc.rc(45): warning: Unrecognized or misplaced token: "STRING"
PORC: rsrc.rc(46): warning: Unrecognized or misplaced token: /
PORC: rsrc.rc(46): warning: Unrecognized or misplaced token: "STRING"
PORC: rsrc.rc(46): warning: Unrecognized or misplaced token: "STRING"
W


So clearly I have absolutely no idea what I'm doing, but thanks for you patience


jimg

Just so there is less confusion, here is the text of the .rc file.  As you can see, I used Hutch's bigbutton demo for a test :shhh:

// ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

#include "\masm32\INCLUDE\Resource.h"

// ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

500 ICON MOVEABLE PURE LOADONCALL DISCARDABLE "bigbutn2.ico"
700 BITMAP MOVEABLE PURE LOADONCALL DISCARDABLE "toolbar.bmp"
800 BITMAP MOVEABLE PURE LOADONCALL DISCARDABLE "bluegrad.bmp"

// ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

600 MENUEX MOVEABLE IMPURE LOADONCALL DISCARDABLE
BEGIN
    POPUP "&File", , , 0
    BEGIN
        MENUITEM "&Open", 1010
        MENUITEM "", , 0x0800 /*MFT_SEPARATOR*/
        MENUITEM "&Save", 1020
        MENUITEM "", , 0x0800 /*MFT_SEPARATOR*/
        MENUITEM "&Exit", 1090
    END
    POPUP "&Help", , , 0
    BEGIN
        MENUITEM "&About", 10000
    END
END

// ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

5000 DIALOGEX MOVEABLE IMPURE LOADONCALL DISCARDABLE 10, 10, 257, 133, 0
STYLE DS_MODALFRAME | 0x0004 | DS_CENTER | WS_CAPTION | WS_VISIBLE | WS_POPUP
CAPTION " About"
FONT 8, "MS Sans Serif", 700, 0 /*FALSE*/
BEGIN
    LTEXT           "img", 999, 0,0,12,10, SS_LEFT, , 0
    ICON            500, 998 15,35,18,20, , 0
    LTEXT           "Text", 997, 51,37,190,60, SS_LEFT, , 0
    PUSHBUTTON      "OK", 1, 189,104,50,14, 0, , 0
END



/manifest:embed
/manifestdependency:"type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'"
/manifestuac:"level='requireAdministrator' uiAccess='false'"

// ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1, 0, 0, 0
PRODUCTVERSION 1, 0, 0, 0
FILEOS VOS__WINDOWS32
FILETYPE VFT_APP
// FILETYPE VFT_DLL
BEGIN
  BLOCK "StringFileInfo"
  BEGIN
    BLOCK "040904B0"
    BEGIN
      VALUE "CompanyName",      "Your Company Name\000"
      VALUE "FileDescription",  "Description Of Application\000"
      VALUE "FileVersion",      "1.0\000"
      VALUE "InternalName",     "Item Name\000"
      VALUE "OriginalFilename", "Original File\000"
      VALUE "LegalCopyright",   "\251 2010-2020 Application Copyright Holder\000"
      VALUE "ProductName",      "Item Name\000"
      VALUE "ProductVersion",   "1.0\000"
    END
  END
  BLOCK "VarFileInfo"
  BEGIN
    VALUE "Translation", 0x409, 0x4B0
  END
END

// ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

sinsi

Link command
link myfile.obj @myfile.rsp

myfile.rsp
/manifest:embed
/manifestdependency:"type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'"
/manifestuac:"level='asInvoker' uiAccess='false'"


A response file is simply the linker's command line switches, one per line, in a text file.
You could put the three manifest lines on the link command instead.

jimg

So, I didn't make my self clear.   I wanted to do this to avoid having an .xml file hanging around, but I need to make an extra .rsp file instead.  Or add to the link command.

k, thanks.

jj2007

Jim,

I perfectly understand your wish to avoid little files all over the place, but what's the difference to expecting, for example, \Masm32\include\masm32.inc to be in that precise location? Once you've built the exe, the client does not need the xml file. So put that stuff in a folder of your choice, even \Masm32\include\ will do, and adjust your rc files accordingly. Attached some samples.

jimg


hutch--

Jim,

This is the basic manifest file I use in 32 bit. The section with bold text is the individual app specific data.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<description>YourAppNameHere</description>

<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>

</dependentAssembly>
</dependency>
</assembly>

jimg

Yup.  That looks exactly like the one that came with your bitbutton demo :)

aw27

A manifest is a XML file and can be placed directly in a .RC file like this:

1 24
MOVEABLE PURE LOADONCALL DISCARDABLE
BEGIN
0x3F3C, 0x6D78, 0x206C, 0x6576, 0x7372, 0x6F69, 0x3D6E, 0x3122,
0x302E, 0x2022, 0x6E65, 0x6F63, 0x6964, 0x676E, 0x223D, 0x5455,
.....
0x0D3E, 0x3C0A, 0x612F, 0x7373, 0x6D65, 0x6C62, 0x3E79, 0x0A0D,
END

Some resource tools do it. It is easy to make a little program to convert the Manifest text to the format above accepted by the Microsoft compiler.

aw27

#13
I have produced the converter and is attached.


jimg

the program doesn't open a window, it just shows up on the task bar and the only option is to close it.