Wierd Happenings while overwriting exe file

S

SD

Hi,

I have an application on WinXP Embedded that once in a while connects to
a remote server and updates itself. The update process takes place as:

1) Download update File
2) Run Update File
3) Close App
4) Update File overwrites old file
5) Update File runs new file
6) update file closes
7) new file deletes update file

However this process does not work (It works on a regular XP box but not
in Xp Embedded)

This process seems to work though because the updated file does run.
However no changes are made to the hard disk. Initially I thought this
might be the work of EWF, but I have not included that in my Build at
all. I can overwrite other files, but just not the exe file.

Any ideas?

TIA
SD
 
K

KM

SD,

What fiels are you trying to update that way? System files, files in use, etc.?

When the updated files are gone - after a reboot?
Did you trace the procedure - at what step does it fail at run time?

Is this SP1 or SP2 based image? Do you have SFC included?
 
S

SD

KM said:
SD,

What fiels are you trying to update that way? System files, files in use, etc.?

My application has one exe file and a bunch of config files all in the
same directory as the exe file. I'm trying to update all these files.
When the updated files are gone - after a reboot?

The updated exe file is gone if I close and restart the application! So
a reboot will definitely not help.
Did you trace the procedure - at what step does it fail at run time?

As far as the application goes, it doesn't even know it has failed.
Is this SP1 or SP2 based image? Do you have SFC included?
SP2. I'm not sure if have SFC included.
 
K

KM

SD,
As far as the application goes, it doesn't even know it has failed.

Well.. there is not enough information for me to help you out with the issue.

What the "update file" is? Batch file, script, or exe app?
In case of any of the above you can put some "debug messages" there (MessageBox'es, etc) to trace how far it goes without
errors.
If you do a batch file, always check "errorlevel" result.
If exe, GetLastError will be a help to you. What APIs do you use?
Are you sure you are updating file in the right folder?

How did you make sure that steps #2 and #3 do not overlap? Do you have a "wait" code in the "update file" to wait until the main app
has closed? (if you would have a named mutex or named event or etc. in the main app if might be easier to trace the app state).

To get more data about the problem, put Sleep( 10000) in both application after every step to make sure it is not timing issue due
to wrong procedure design.
SP2. I'm not sure if have SFC included.

Check if your Configuration includes "Primitive: Sfc" and ""Primitive: Sfcfiles"". Although it must be irrelevant to the issue if
you are only trying to update your own application files.
 
S

SD

THanks for all your help. I figured out the solution to my problem! In
Win2k/XP I was using the Startup menu to start the application and in
XPe I was using the registry. If I run "c:\program files\blah\abc.exe"
in Run in the registry, the working path of the application is My
Documents!! All I had to do was change my app to use its own directory.

SD
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top