cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
dmalk1
Level 4

How does a program update itself without file sharing issues?

When manually handling updates via code, I'm confused over how the program downloading and executing updates can become updated itself. It seems there would be a file sharing issue. This seems pretty fundamental and I'm sure has been addressed; could someone shed some light for me?

Including the Update Manager in our distribution is not an option, so our current design involves 2 different programs: one that checks, downloads, and updates our core program; and the other is our core program. This isn't the best design though as we have no means for updating our updater program itself.

Thanks for your time!
Damon
0 Kudos
(4) Replies
dmalk1
Level 4

I got a response back from Macrovision support saying that I have right idea to use a separate program for updating, to alleviate the need to reboot or potential FilesInUse dialog. Should the Update Service run-time itself require updating however, I'm told the system would merely require a reboot. I'm unsure whether this is built in or if I need to trap and handle.

Damon
0 Kudos
dmalk1
Level 4

Taken directly from the SDK help...

"If your users will be using your application when you try to update it, you may be trying to overwrite files in use. In that case, your update setup will require a reboot. If your setup is being run silently, your setup will reboot your user's machine without warning."

We happen to be using silent updates and this is indeed what happens -- immediately following OnUpdateComplete(), the system performs a reboot without any warning.

I haven't come upon any means for trapping a reboot condition. I'd hate to post a generic warning before each update since we'll encounter this situation very seldom; however, I know from personal experience that a surprise reboot without any warning or prevention won't go over well with our users 🙂

Has anyone else encountered this predicament?

Damon
0 Kudos
gsinha
Level 2

Hello,

I was reading about how the computer would be rebooted without warning when you are updating some files.

Did you resolve this issue or get some more information on this problem. I am also interested in finding out the solution.

Thanks
0 Kudos
LCottrell
Level 3

Hi there,

We too have a main exe and an updater exe.

How we got around the self update issue was to have "selfUpdate" within the .msp file name. When we loop through the installations and get to an update that has selfUpdate in the filename we launch the update with a GUI showing it is a self update and instantly close down the updater application to avoid the file lock issue. Once the patch has completed it relaunches the updater application to chack for any further updates.

Hope this helps.
0 Kudos