Re: Building EXE Twice Produces Different Files
- From: Greg <nothing@xxxxxxxxxxx>
- Date: Thu, 09 Nov 2006 10:40:16 -0600
Charles,
I think I sometimes see differences with my application because of a
status bar control. It think the status bar control pulls in the latest
time and compiles that time into the exe. Same goes for the current
status of the num lock, caps locks, and insert statuses. At least I
think it does. Do you have anything similar in the app that could pull
in the current status of something? Perhaps a third party control?
Just an idea - I haven't really verified it.
Also do you have any public classes that your application exposes? Is
so, it may be creating a new clsid each time you compile. Is your
project type an Active EXE or Standard EXE under the properties?
Greg
Hi Ralph.
Thanks for the reply. Yes, I am using VB6 with SP6.
I have just tried building the EXE, closing the IDE, re-opening and
building, but I get the same effect. Both files are 1,875,968 bytes long,
but the first third of the files are peppered with differences.
I am using the hex viewer in Beyond Compare to make the comparison (it
re-aligns after a difference), so I can see exactly what genuine differences
there are. In a lot of places each occasion of a difference is a group of
three bytes (occasionally four bytes). That seems to be significant to me.
Could they be addresses? Further down the file each difference is a group of
between 16 and 24 bytes.
The problem I have is that my client wants to be able to rebuild the
software to prove to himself that he has the ability to do so if I fall
under a bus. Not only does his build produce a different file from the one I
gave him, but it also produces different files every time he builds it. How
can I prove to him that the software that I tested is the same as the
software he builds each time?
Charles
"Ralph" <nt_consulting64@xxxxxxxxx> wrote in message
news:VrednViRR-OBsc7YnZ2dnUVZ_rKdnZ2d@xxxxxxxxxxxxxxx
"Charles Law" <blank@xxxxxxxxxxx> wrote in message
news:erMhY2$AHHA.4672@xxxxxxxxxxxxxxxxxxxxxxx
I have just built my code twice, on the same machine, with auto-incrementstart
off (I did not change the code in any way). I also did not close the IDE
between builds, but now I have two different EXE files. If I perform a
hex
comparison on the files, they are quite different, and not just at the
but throughout.and
How can I be sure that the executable code is the same in the two EXEs,
if it isn't then why isn't it?
Thanks for any insights.
Charles
Are you using VB6? (Just to make sure. <g>)
This is a common phenomenon - repeatedly compiling a VB application will
produce a file of ever increasing size. (I think the increment is around
2k)
I have heard numerous explanations, some plausible, some rather
incredulous.
MS did have an article on this subject but can't find it at the moment
(likely on the wayback machine somewhere). This perhaps indicates there is
no ONE source/cause for the increase.
The best explanation is that VB does some quick caching of metadata that
it
includes in its 'pre-processed' object files that are submitted to the C2
compiler. It doesn't remove or compare with data already written in this
cache - so this data just gets appended. Duplicate information is ignored
by
the C2 compiler, but it ends up in the finished executable.
Using a Hex editor to isolate the exact changes is difficult because as
you
noted the 'increase' appears to be distributed through-out the executable.
(Due to the absence of 'lines' once a comparison gets out of synch - it
stays out of synch.)
However, AFAIK, the differences are benign. If you shut-down the IDE, open
and recompile, the executable will be squeezed back to its original size.
hth
-ralph
- Follow-Ups:
- Re: Building EXE Twice Produces Different Files
- From: Charles Law
- Re: Building EXE Twice Produces Different Files
- References:
- Building EXE Twice Produces Different Files
- From: Charles Law
- Re: Building EXE Twice Produces Different Files
- From: Ralph
- Re: Building EXE Twice Produces Different Files
- From: Charles Law
- Building EXE Twice Produces Different Files
- Prev by Date: Re: Pinter Size
- Next by Date: Calling a VB6 DLL from Magic8.3
- Previous by thread: Re: Building EXE Twice Produces Different Files
- Next by thread: Re: Building EXE Twice Produces Different Files
- Index(es):
Relevant Pages
|