View Full Version : Files aren't being updated correctly on an upgrade

05-24-2004, 03:15 PM
I setup the component such that they overwrite the files always. All of a sudden I've noticed that on an upgrade the file (in this case a Java jar) hasn't been overwritten.

This problem is detected at runtime by our software because it's trying to access a class from this java jar which isn't there in the previous version of software.

HELP!!!!!!!! How do I get this to work? I didn't change anything and this used to work before.

If I don't do an upgrade but do an installation from scratch then then everything works fine.

05-27-2004, 01:29 PM
I had a similar problem with my upgrades. If the jar file is in use while trying to upgrade it, then Windows locks the file and IS can't replace it.

By default, IS should detect this, set the BATCH_INSTALL flag and present you with a Finish Reboot dialog box which should solve the problem (unfortunately it requires a reboot). Have you diabled this in OnUpdateUIAfter? The code should appear in this funciton as:

if ( BATCH_INSTALL ) then
SdFinishReboot ( szTitle , szMsg1 , SYS_BOOTMACHINE , szMsg2 , 0 );
SdFinish ( szTitle , szMsg1 , szMsg2 , szOpt1 , szOpt2 , bOpt1 , bOpt2 );

05-27-2004, 02:01 PM
Thanks for your resplonse.

All the processes which use these jar's have been shutdown at this time. How do I know for sure... I update the timestamp on the jar's in OnMoved(). The jar's have the latest timestamp so I'm sure they aren't being locked by anyone.

I don't implement OnUpdateUIAfter() so I could be wrong....

I thought if the file hasn't been copied by the time OnMoved() is executed then it will never be copied... That's the reason why I didn't pursue further debugging....

06-02-2004, 12:41 PM
Changing the timestamp on a file has nothing to do with file ownership. It's a directory property which is being changed not the file property. So eventhough the files were being used by the application I was able to change the timestamp.

The application was started as a service and didn't go down when we used ServiceStopService(). All I did was to call additional ServiceStopService() if the service was detected as not stopped.

All the new files from the upgrade install are getting copied now. Problem solved.