Hot-Swap updates question

180 views
Skip to first unread message

zam...@gmail.com

unread,
Mar 21, 2013, 3:24:15 PM3/21/13
to nappu...@googlegroups.com
I think I already know the answer to this question but here it is anway:

Is there a way for currently running app to perform hotswap update of it self?

What I am noticing is that with hotswap FileUpdateTask fails to delete the app (during ApplyUpdates) (because it is running), and triggers cold update.
Is there any way around this?

Itamar Syn-Hershko

unread,
Mar 21, 2013, 4:04:27 PM3/21/13
to nappu...@googlegroups.com
No. IIRC the only way to replace a running file is via one of the flags passed to MoveFileEx, but since it wasn't supported on XP (again, IIRC) I didn't use it. Either way, the change won't take effect unil it is run again.


--
You received this message because you are subscribed to the Google Groups "NAppUpdate" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nappupdate+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

zam...@gmail.com

unread,
Mar 21, 2013, 4:14:54 PM3/21/13
to nappu...@googlegroups.com
That is what I thought as well - I thought it was worth asking just to make sure...

MoveFileEx approach with MOVEFILE_REPLACE_EXISTING flag) is also mentioned here:

section: File Replacement and Extraction

"One little-publicized trick for deleting a DLL or EXE that is in use is to rename the file to a temporary file name, and then copy the new file over the old name. You can then use the MoveFileEx Win32 API to log the file for deletion when you reboot the system, or include logic in your application that will search for each of the temporary files and delete them."


However API does say that is available since XP (requirements section towards bottom)

Itamar Syn-Hershko

unread,
Mar 21, 2013, 4:22:52 PM3/21/13
to nappu...@googlegroups.com
I didn't use BITS on purpose. The framework assumes the most minimum requirements possible by design - .NET 2.0 and any Windows version, although I must admit Windows XP has been around long enough for NAU to drop support of any version prior to it. This will make life much easier since it would mean dropping the updater exe - I probably will go this route once I get some free time. I just need to verify it does work on XP.
Reply all
Reply to author
Forward
0 new messages