Skip to content

Commit ff84046

Browse files
committed
Support automatic app restart with WinSparkle
1 parent f2c0ae4 commit ff84046

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/app_updates.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,13 @@ class AppUpdates::impl
213213

214214
static void WinSparkle_Shutdown()
215215
{
216-
auto evt = new wxCommandEvent(wxEVT_COMMAND_MENU_SELECTED, wxID_EXIT);
217-
wxGetApp().QueueEvent(evt);
216+
// Register for Application Restart so that Restart Manager (used by Inno Setup)
217+
// can restart Poedit after it closes us during installation.
218+
// Use empty command line ("") and avoid restarts after crash/hang/reboot.
219+
RegisterApplicationRestart(L"", RESTART_NO_CRASH | RESTART_NO_HANG | RESTART_NO_REBOOT);
220+
221+
// Do NOT shut down here! The installer will close us via Restart Manager and
222+
// restart after installation completes.
218223
}
219224
};
220225

win32/poedit.iss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ WizardStyle=modern
8383
AppPublisherURL=https://poedit.net/
8484
DisableProgramGroupPage=true
8585

86+
RestartApplications=yes
87+
CloseApplications=yes
88+
8689
#ifdef SIGNTOOL
8790
SignTool={#SIGNTOOL}
8891
SignedUninstaller=yes

0 commit comments

Comments
 (0)