Trouble embedding a manifest into a .exe

Posted: 07-24-2007, 04:11 PM
I am having trouble embedding a manifest file into a .exe created
using Wise Script. When I use mt.exe (from Visual Studio 8 with SP1
installed) to embed the manifest file, the resulting file decreases in
size from 123KB to 23KB and without any surprise doesn't run.

I used the following commandline:
mt.exe -manifest Test1.exe.manifest -outputresource:Test1.exe

I also tried adding the manifest using Resource Hacker, file size
increases in size from 123KB to 124KB, however when I execute
Test1.exe I get the following error: "Could not initialize
installation. File size expected=168640121, size returned=126017"

Anyone have any ideas on how I can embed the manifest into a .exe
created from Wise Script?

Reply With Quote

Responses to "Trouble embedding a manifest into a .exe"

Steve Easton
Guest
Posts: n/a
 
Re: Trouble embedding a manifest into a .exe
Posted: 07-24-2007, 09:56 PM
The embedded manifest will fail to execute if the file size of the manifest in bytes is not "exactly"
divisible by 4 "before" you compile it into a .res file.

Pad the manifest with spaces at the end until the file size is evenly divisible by 4.
Then compile it into a .res file and then import it using Resource Hacker.

--

Steve Easton


<ejmichaud@hotmail.com> wrote in message news:1185289884.404417.64470@q75g2000hsh.googlegro ups.com...
>I am having trouble embedding a manifest file into a .exe created
> using Wise Script. When I use mt.exe (from Visual Studio 8 with SP1
> installed) to embed the manifest file, the resulting file decreases in
> size from 123KB to 23KB and without any surprise doesn't run.
>
> I used the following commandline:
> mt.exe -manifest Test1.exe.manifest -outputresource:Test1.exe
>
> I also tried adding the manifest using Resource Hacker, file size
> increases in size from 123KB to 124KB, however when I execute
> Test1.exe I get the following error: "Could not initialize
> installation. File size expected=168640121, size returned=126017"
>
> Anyone have any ideas on how I can embed the manifest into a .exe
> created from Wise Script?
>

Reply With Quote
ejmichaud@hotmail.com
Guest
Posts: n/a
 
Re: Trouble embedding a manifest into a .exe
Posted: 07-25-2007, 07:13 PM
On Jul 24, 4:56 pm, "Steve Easton" <ad...@95isalive.com> wrote:
> The embedded manifest will fail to execute if the file size of the manifest in bytes is not "exactly"
> divisible by 4 "before" you compile it into a .res file.
>
> Pad the manifest with spaces at the end until the file size is evenly divisible by 4.
> Then compile it into a .res file and then import it using Resource Hacker.
Hi Steve, thanks for the response, still no luck but I may be doing
something wrong. Here is what I did:
1. I padded the manifest with spaces, had a size of 488 bytes.
2. I opened the .exe in Resource Hacker
3. I then selected "Add a new resource" from the Action pull down
menu
4. With the Add a new resource dialog open, selected the manifest
file I created (MyApp.exe.MANIFEST)
5. Set Resource Type to: 24
6. Set Resource Name to: 1
7. Set Resource Language to: 1033
8. Saved the file

When I run the .exe I get "Could not initialize installation. File
size expected=1869181810, size returned=126006

I do something wrong? Any other ideas?

Reply With Quote
ejmichaud@hotmail.com
Guest
Posts: n/a
 
Re: Trouble embedding a manifest into a .exe
Posted: 07-26-2007, 03:47 PM
I found the solution, someone guided me to the answer on the Altiris/
Wise forums. By embedding the manifest into stub32.exe, code I then
compile results with the same manifest I embedded into stub32.exe. I
could not use mt.exe to embed the manifest into stub32.exe but I was
able to do it using resource hacker in the following manner:
1. I opened the stub32.exe in Resource Hacker
2. I then selected "Add a new resource" from the Action pull down
menu
3. With the Add a new resource dialog open, selected the manifest
file I created (MyApp.exe.MANIFEST)
4. Set Resource Type to: 24
5. Set Resource Name to: 1
6. Set Resource Language to: 1033
7. Compiled the script
8. Saved the stub32.exe file

Now anything I compile with Wise Script Editor now has the
MyApp.exe.MANIFEST embedded into the .exe. Thanks for the assistance.


Reply With Quote
 
LinkBack Thread Tools Display Modes
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Manifest not working G. Plante Windows Vista Security 3 02-26-2007 05:03 PM
UAC Manifest for VB6 Apps will f Windows Vista Security 1 02-24-2007 12:32 AM
Embedding clips Rachel Windows XP Movie Maker 3 02-23-2005 02:21 PM
Embedding Big D Windows XP Music 0 08-30-2004 05:33 AM
Embedding Movie Maker 2 wmv in websites Rick Windows XP Movie Maker 1 05-15-2004 06:48 PM


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90