Re: Re: my kitgen kits drop the modified date from embedded files (windows)

Pat Thoyts <[email protected]> Mon, 14 May 2012 22:49:11 +0100
Newsgroups gmane.comp.lang.tcl.starkit
Message-ID <CABNJ2G+HP=yLhj+c91DtfFJWSFeOyPDOdLWGMSNNAu+ptbaYcw@mail.gmail.com>
On 13 May 2012 22:31, Neil Bryant <[email protected]> wrote:
> Nope. For what it's worth, it seems if I add any type of manifest to the
> file, it mucks up file extractions.
>
> If I use the files from the tclkit goolecode site (eg,
> tclkitsh-8.5.9-win32.upx.exe), file copies are correct. These exe's have no
> manifest, and appear to have been built without need of one.
>
> I've been trying to compile with VC8, which needs a manifest, or it
> complains it can't find the runtimes. With the manifest, it breaks the copy
> datestamps. I can't (I don't think) compile without a manfest, since the exe
> just won't run.
>
> I've been trying to compile in VC6, for comparison--to see if adding the
> manifest changes things--but I'm not having luck getting it to compile at
> all.
>
> Right now, I've stared at this too long, so I'm putting it down while I can
> still form a sentence. I will pick it up later, or look into alternate forms
> of extraction.
>
> If anybody has any thoughts, I would appreciate hearing them. If they are
> simple enough for me to follow, I will attempt them =]

You should not need to rebuild tclkit to update the manifest resource.
However, you need to peform
a couple of steps. The tclkit executable is a Windows PE executable
compressed with upx and
has a metakit database appended to the end. To change the resources
the safest method is to
split the file and decompress:
 sdx mksplit tclkit.exe  # this yields tclkit.head (the exe) and
tclkit.tail (the database)
then
  upx -d tclkit.head
Now you can use the mt tool to merge the manifest update with the
embedded manifest resource;
  mt -inputresource:tclkit.head;#1 -manifest:admin.manifest
-outputresource:tclkit.head;#1
then rejoin the pieces into a tclkit again:
   copy /b tclkit.head + tclkit.tail tclkit-admin.exe
(you could re-compress tclkit.head again here if you want a small exe)

Where admin.manifest contains just the new parts of the manifest required:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel
          level="requireAdministrator"
          uiAccess="false"/>
        </requestedPrivileges>
       </security>
  </trustInfo>
</assembly>

The above steps give me a tclkit executable that requests elevation as
soon as I run it. However, if you are doing this you will
probably need to sign such an executable using a valid authenticode
certificate. You can't do that to a metakit based tclkit but
you can do that using the vlerq based executables. So re-do the steps
above using tclkit-gui.exe if you want to sign the exe.

-- 
You received this message because you are subscribed to the "starkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/starkit?hl=en