How to insert manifest into EXEs

Miscellaneous Forums/General Discussion/How to insert manifest into EXEs

I have a standalone manifest file, but I'd like to insert it into exe so only exe is will be needed and buttons would look XP styled.

I've tried Resource Hacker, but I didn't achive anything.

Whats a manifest file ?

It's a file that changes common GUI gadgets into XP Style

you change the manifests file name to same as the executable, but you add ".manifest" at the end(Example: for program.exe you change it into program.exe.manifest).

Content of the manifest file:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
    version="1.0.0.0"
    processorArchitecture="X86"
    name="MyCompany.MyLabel.MyAppName"
    type="win32"
/>
<description>MultiMedia BoardCast/Scheduler.</description>
<dependency>
    <dependentAssembly>
        <assemblyIdentity
            type="win32"
            name="Microsoft.Windows.Common-Controls"
            version="6.0.0.0"
            processorArchitecture="X86"
            publicKeyToken="6595b64144ccf1df"
            language="*"
        />
    </dependentAssembly>
</dependency>
</assembly>


I've read something about selfextracting media that can be added into exe so you won't need any extra files. Would that solve my problem?

The easiest way I found was to compile an object file using MinGW, which you can import into your project so that it is linked into the EXE when it is compiled.

I've uploaded it here. Download it, and extract it into the same directory as your Blitz source code, and add the following lines to the top of your code.

?win32
Import "xpmanifest.o"
?
Next time you compile, your EXE will have the manifest file built inside the EXE so it can be distributed as a stand-alone EXE without the external manifest file.

Hope this helps...


Seb

What do you use to compile it into an object file?

To insert the manifest with Resource Hacker, do the following...

Open the exe in ResHacker

Select Action>Add a new resource

Now select your manifest file

Use the following settings...

Resource Type: 24
Resource Name: 1
Resource Language: 1033

Save the exe



Or for BlitzMax exes try the following method...

http://www.blitzmax.com/Community/posts.php?topic=65355

:)

Whoa! This is some incredibly interesting info... now can someone do a tutorial with screengrabs???

Thanks for the info!

A long time ago I added manifest files to BlitzIde and blitzcc too so IDE and everything i compile has XP style. Pretty nice :P

One more thing, can manifest files be used to add Company name/version and stuff to EXEs too?

Here's a bat file I use with Reshacker.
First line adds a version resource. ( Company name/version etc.)

ResHacker.exe -addoverwrite myprog_release.exe, myprog.exe, myprog.res,,,
ResHacker.exe -addoverwrite myprog.exe, myprog.exe, myprog.manifest,24,1,1033


I tried using ResHacker, but it said that the application isn't win32 compatible!? :S

I'm not getteing that error. Just tested with a freshly compiled blitzmax exe.

can you provide me with your own manifest file? I'd like to try with that.

Sure, don't know if adding the version res first has any impact.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
    version="3.9.8.0"
    processorArchitecture="X86"
    name="Appname"
    type="win32"
/>
<description>description</description>
<dependency>
    <dependentAssembly>
        <assemblyIdentity
            type="win32"
            name="Microsoft.Windows.Common-Controls"
            version="6.0.0.0"
            processorArchitecture="X86"
            publicKeyToken="6595b64144ccf1df"
            language="*"
        />
    </dependentAssembly>
</dependency>
</assembly>


EDIT:

It seems that my exe has a problem. Freshly compiled and manifested exe did work properly.