After update both applications are running

149 views
Skip to first unread message

Andrej Viktorovich

unread,
Oct 14, 2014, 10:19:40 AM10/14/14
to winsp...@googlegroups.com
Hello,

I have two problems.

1. After update both applications are running - that was executed and downloaded one. I was expecting that first application will be closed, overwritten with new one and executed once again.

2. I have updated executable on server with new one, but after winsparkle update download procedure took no time and previous version that was on server was executed. Looks like it holds previous download and offers that instead of downloading from server one.

Václav Slavík

unread,
Oct 14, 2014, 10:41:09 AM10/14/14
to winsp...@googlegroups.com

On 14 Oct 2014, at 16:19, Andrej Viktorovich <viktorov...@gmail.com> wrote:
> 1. After update both applications are running - that was executed and downloaded one. I was expecting that first application will be closed, overwritten with new one and executed once again.

You have to implement such behavior yourself. WinSparkle can't magically know what the right thing for your app is. See win_sparkle_set_can_shutdown_callback() and win_sparkle_set_shutdown_request_callback().

> 2. I have updated executable on server with new one, but after winsparkle update download procedure took no time and previous version that was on server was executed. Looks like it holds previous download and offers that instead of downloading from server one.

You have wrongly configured server and are not setting caching-related HTTP headers correctly — that's your responsibility to do right. Better yet, just use versioned download URLs and avoid the problem altogether.

Vaclav


Andrej Viktorovich

unread,
Oct 15, 2014, 2:10:07 AM10/15/14
to winsp...@googlegroups.com

Hello, 

Thank you for replay. 

On Tuesday, 14 October 2014 17:41:09 UTC+3, Václav Slavík wrote:

On 14 Oct 2014, at 16:19, Andrej Viktorovich <viktorov...@gmail.com> wrote:
> 1. After update both applications are running - that was executed and downloaded one. I was expecting that first application will be closed, overwritten with new one and executed once again.

You have to implement such behavior yourself. WinSparkle can't magically know what the right thing for your app is. See win_sparkle_set_can_shutdown_callback() and win_sparkle_set_shutdown_request_callback().  

I have set win_sparkle_can_shutdown_callback_t functon. And this function is called, but  both applications are running anyway. Updated application is running from some random temporary place. I'm expecting that main application will be shut downed and new version would be updated (overwritten) with new one. What is missing in my code?



int __cdecl allowShutdown(){
return 1;
}

void ShutdownRequest(){
}


int main(array<System::String ^> ^args)
{
// Enabling Windows XP visual effects before any controls are created
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false); 

win_sparkle_set_appcast_url("http://gedas.t15.org/appcast.xml");
win_sparkle_set_can_shutdown_callback( &allowShutdown);
win_sparkle_set_shutdown_request_callback( &ShutdownRequest );
win_sparkle_init();
win_sparkle_check_update_with_ui();
Application::Run(gcnew Form1());
win_sparkle_cleanup();

return 0;
}


Václav Slavík

unread,
Oct 15, 2014, 3:49:02 AM10/15/14
to winsp...@googlegroups.com

On 15 Oct 2014, at 08:10, Andrej Viktorovich <viktorov...@gmail.com> wrote:
I have set win_sparkle_can_shutdown_callback_t functon. And this function is called, but  both applications are running anyway. Updated application is running from some random temporary place. I'm expecting that main application will be shut downed and new version would be updated (overwritten) with new one. What is missing in my code?

The actual implementation of ShutdownRequest() that would terminate your app.

And I'm guessing, an installer that would install the update. Direct replacement of a single exe file is not supported, only installers (patches to change this would be most welcome).

Regards,
Vaclav
Reply all
Reply to author
Forward
0 new messages