Inno won't terminate elevated procs to overwrite their file during install

20 views
Skip to first unread message

Hattrick

unread,
Nov 4, 2025, 10:17:59 AM (3 days ago) Nov 4
to innosetup
I'm wondering what option I should add in the script file. Thanks!

Screenshot 2025-11-04 171328.pngScreenshot 2025-11-04 170448.png

Gavin Lambert

unread,
Nov 4, 2025, 6:34:05 PM (3 days ago) Nov 4
to innosetup
On Wednesday, November 5, 2025 at 4:17:59 AM UTC+13 Hattrick wrote:
I'm wondering what option I should add in the script file. Thanks!

While Inno does use the Restart Manager functionality to close and restart applications, I've often found this a bit hit or miss, especially if the application doesn't take it into account.

As such, it's generally a good idea to have fallback options in place, such as [Code] in PrepareToInstall that checks if your app is still running and to automatically close it, and/or using AppMutex to advise the user to close the app themselves.  (Both of these may require changes to your app's code.  Which one is preferable depends on whether your app can be in a state where the user has unsaved documents.)

Failing all else, you can slap the "restartreplace" flag on the [Files] entry.  This is not very user-friendly, but might be considered better than an error.
 
Reply all
Reply to author
Forward
0 new messages