mirror of
https://github.com/HackPlan/winsparkle.git
synced 2026-01-12 17:02:51 +08:00
Add API for silent on-demand update checks.
There might be cases where the application would want to check for updates manually. This would override the users request to not perform update checks, if that is enabled, so should be used with care. Add in_sparkle_check_update_without_ui() for this purpose. It is not completely UI-less, as it still shows the "update available" window, but it doesn't show any UI unless there actually is an update.
This commit is contained in:
committed by
Vaclav Slavik
parent
7bffa3d1a3
commit
f692660e34
@@ -238,9 +238,29 @@ WIN_SPARKLE_API int __cdecl win_sparkle_get_update_check_interval();
|
||||
window is shown.
|
||||
|
||||
This function returns immediately.
|
||||
|
||||
@see win_sparkle_check_update_without_ui()
|
||||
*/
|
||||
WIN_SPARKLE_API void __cdecl win_sparkle_check_update_with_ui();
|
||||
|
||||
/**
|
||||
Checks if an update is available.
|
||||
|
||||
No progress UI is shown to the user when checking. If an update is
|
||||
available, the usual "update available" window is shown; this function
|
||||
is *not* completely UI-less.
|
||||
|
||||
Use with caution, it usually makes more sense to use the automatic update
|
||||
checks on interval option or manual check with visible UI.
|
||||
|
||||
This function returns immediately.
|
||||
|
||||
@since 0.4
|
||||
|
||||
@see win_sparkle_check_update_with_ui()
|
||||
*/
|
||||
WIN_SPARKLE_API void __cdecl win_sparkle_check_update_without_ui();
|
||||
|
||||
//@}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -222,4 +222,17 @@ WIN_SPARKLE_API void __cdecl win_sparkle_check_update_with_ui()
|
||||
CATCH_ALL_EXCEPTIONS
|
||||
}
|
||||
|
||||
WIN_SPARKLE_API void __cdecl win_sparkle_check_update_without_ui()
|
||||
{
|
||||
try
|
||||
{
|
||||
// Run the check in background. Only show UI if updates
|
||||
// are available.
|
||||
UpdateChecker *check = new ManualUpdateChecker();
|
||||
check->Start();
|
||||
}
|
||||
CATCH_ALL_EXCEPTIONS
|
||||
}
|
||||
|
||||
|
||||
} // extern "C"
|
||||
|
||||
Reference in New Issue
Block a user