{"action":"created","issue":{"url":"https://api.github.com/repos/jrsoftware/issrc/issues/145","labels_url":"https://api.github.com/repos/jrsoftware/issrc/issues/145/labels{/name}","comments_url":"https://api.github.com/repos/jrsoftware/issrc/issues/145/comments","events_url":"https://api.github.com/repos/jrsoftware/issrc/issues/145/events","html_url":"https://github.com/jrsoftware/issrc/issues/145","id":54727259,"number":145,"title":"Enable the RmForceShutdown option for Restart Manager","user":{"login":"Elusive138","id":1674237,"avatar_url":"https://avatars.githubusercontent.com/u/1674237?v=3","gravatar_id":"","url":"https://api.github.com/users/Elusive138","html_url":"https://github.com/Elusive138","followers_url":"https://api.github.com/users/Elusive138/followers","following_url":"https://api.github.com/users/Elusive138/following{/other_user}","gists_url":"https://api.github.com/users/Elusive138/gists{/gist_id}","starred_url":"https://api.github.com/users/Elusive138/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Elusive138/subscriptions","organizations_url":"https://api.github.com/users/Elusive138/orgs","repos_url":"https://api.github.com/users/Elusive138/repos","events_url":"https://api.github.com/users/Elusive138/events{/privacy}","received_events_url":"https://api.github.com/users/Elusive138/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-01-19T05:20:52Z","updated_at":"2015-08-07T16:36:45Z","closed_at":"2015-01-20T11:15:38Z","body":"[Currently](https://github.com/jrsoftware/issrc/blob/fcd29a583579acfe092e0c0bbf5503872d3957ec/Projects/Install.pas#L2775), InnoSetup's use of Restart Manager calls [`RmShutdown`](http://msdn.microsoft.com/en-us/library/windows/desktop/aa373667.aspx) without specifying any options.\r\n\r\nUnfortunately, it seems that the [shutdown process](http://msdn.microsoft.com/en-us/library/windows/desktop/aa373651.aspx) will not work on a GUI application that does not process messages (e.g. does not have a window). <sup>This is my guess at the reason for the failure: I haven't confirmed the reason yet, but the solution works in any case.</sup> This will cause `RmShutdown` to return a `ERROR_FAIL_SHUTDOWN`, and InnoSetup gets stuck in the \"unable to automatically close all applications\" loop.\r\n\r\nThe application I'm currently trying to install and update with InnoSetup includes a browser component based on Chromium, which starts several render GUI processes that do not have a main window attached, and therefore will not respond to the shutdown messages. In my scenario, Restart Manager will *never* work as it is currently implemented.\r\n\r\nPassing `RmForceShutdown` (`0x1`) as the second argument for `RmShutdown` solves this by forcibly terminating all applications after a timeout, including those that do not respond to window messages. This is of course somewhat risky, as it effectively kills processes that do not cooperate. On the other hand, processes that do not process `WM_ENDSESSION` will be forcibly terminated in the same fashion on logoff, so it's probably no more dangerous than a system restart. <sup>Possible edge case: a worker process belonging to some other process, e.g. a service - in a normal logoff sequence the parent process would close the workers properly. I don't think the Restart Manager can detect this scenario, and would just end up terminating the worker...</sup>\r\n\r\nI believe InnoSetup should implement one of the following:\r\n\r\n* Always pass `RmForceShutdown`. After all, the user has already been prompted with the list of processes (unless in silent mode...).\r\n\r\n* Provide either a setup script option or command-line option to enable force-shutdown. This would leave it up to the setup-creator to decide whether it's a safe action.\r\n\r\n* Add a \"force close\" to the abort-retry-ignore dialog, or just replace the retry with a \"force close\". This would give the user the choice, at the expense of annoying them more."},"comment":{"url":"https://api.github.com/repos/jrsoftware/issrc/issues/comments/128758623","html_url":"https://github.com/jrsoftware/issrc/issues/145#issuecomment-128758623","issue_url":"https://api.github.com/repos/jrsoftware/issrc/issues/145","id":128758623,"user":{"login":"joaomoreno","id":22350,"avatar_url":"https://avatars.githubusercontent.com/u/22350?v=3","gravatar_id":"","url":"https://api.github.com/users/joaomoreno","html_url":"https://github.com/joaomoreno","followers_url":"https://api.github.com/users/joaomoreno/followers","following_url":"https://api.github.com/users/joaomoreno/following{/other_user}","gists_url":"https://api.github.com/users/joaomoreno/gists{/gist_id}","starred_url":"https://api.github.com/users/joaomoreno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joaomoreno/subscriptions","organizations_url":"https://api.github.com/users/joaomoreno/orgs","repos_url":"https://api.github.com/users/joaomoreno/repos","events_url":"https://api.github.com/users/joaomoreno/events{/privacy}","received_events_url":"https://api.github.com/users/joaomoreno/received_events","type":"User","site_admin":false},"created_at":"2015-08-07T16:36:45Z","updated_at":"2015-08-07T16:36:45Z","body":"@Elusive138 did you ever get Inno to restart your Chromium based application?"}}