Windows Vista Forums
Vista Forums Home Join Vista Forums Tech Publications Windows 7 Forum Vista Tutorials Webcasts Tags

Welcome to Vista Forums we are your forum for Windows Vista help and discussion. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Vista Newsgroups > Vista security

Trouble embedding a manifest into a .exe

Update your Vista Drivers
Reply
 
Thread Tools Display Modes
Old 07-24-2007   #1 (permalink)
ejmichaud@hotmail.com
Guest


 

Trouble embedding a manifest into a .exe

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?


My System SpecsSystem Spec
Old 07-24-2007   #2 (permalink)
Steve Easton
Guest


 

Re: Trouble embedding a manifest into a .exe

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.googlegroups.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?
>



My System SpecsSystem Spec
Old 07-25-2007   #3 (permalink)
ejmichaud@hotmail.com
Guest


 

Re: Trouble embedding a manifest into a .exe

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?

My System SpecsSystem Spec
Old 07-26-2007   #4 (permalink)
ejmichaud@hotmail.com
Guest


 

Re: Trouble embedding a manifest into a .exe

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.


My System SpecsSystem Spec
Reply
Update your Vista Drivers

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
embedding pictures into email message kholcomb8 Vista mail 2 07-27-2008 05:27 AM
Re: Embedding stationery scripts . . . . Re: Font Size in Windows Mail La Divine Vista mail 0 04-15-2008 01:27 PM
embedding picture in word pad document RosWa Vista music pictures video 1 03-26-2008 12:12 AM
Embedding images Failure Shirlanne Vista mail 5 11-13-2007 08:14 PM
Embedding an .exe in a gadget? Marco Shaw Vista General 0 04-20-2007 01:20 AM


Complimentary Industry Resources

Vista Forums has joined forces with TradePub.com to offer you a new, exciting, and entirely free professional resource. Visit http://vistax64.tradepub.com today to browse our selection of complimentary Industry magazines, white papers, webinars, podcasts, and more across 34 industry sectors. No credit cards, coupons, or promo codes required. Try it today!




Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

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