Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
198 views
in Technique[技术] by (71.8m points)

windows - How to prevent restart dialog caused by MSI 1610 error

I have a setup created with InstallShield. During upgrade or uninstall, after Install validate process, I get a alert dialog box with the following message:

"The setup must update files or services that cannot be updated while the system is running. If you choose to continue, a reboot will be required to complete the setup".

I found the following in the MSI log file:

MSI (s) (4C:78) [18:17:52:182]: RESTART MANAGER: Detected that application with id 4, friendly name 'System', of type RmCritical and status 1 holds file[s] in use. MSI (s) (4C:78) [18:17:52:182]: RESTART MANAGER: Did detect that a critical application holds file[s] in use, so a reboot will be necessary. MSI (s) (4C:78) [18:17:52:182]: Note: 1: 1610

I want to understand why I get this message and how to avoid this.

( I already checked the following registry key and it had oldmsedge.exe, I don't think it is related to this issue)

HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSession ManagerFileRenameOperations

question from:https://stackoverflow.com/questions/65951507/how-to-prevent-restart-dialog-caused-by-msi-1610-error

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Pending File Renames: The FileRenameOperations key holds a list of files and resources that are waiting to be updated (and / or renamed) upon reboot / restart. This is indeed something that can trigger the warning you see. The setup found files in use that your setup tried to replace, and hence wants to restart the computer to put the new file versions in place after all locks are released (via the restart).

Windows Service: There are many things that can prevent files from being replaceable. One common problem is running services that you don't shut down properly in your setup before trying to replace files that the service has in use. Fix this to have the service in question shut down by your setup. There are mechanisms in MSI to do so (provided the service works as it should - not at all guaranteed).

Running Applications: It is common advice to shut down all normal Windows applications (not just services) that are running when you install a setup. This is to release similar file and resource locks that would cause file overwrite or registry updates to fail.

Other Locks: Files can also be locked by other mechanisms, such as malware scanners, anti virus or similar security processes. Or several other things such as backup mechanisms, ad-hoc locked files opened manually by the user (if the app actually locks the file), ACL permission problems, and worst of all: real malware. And a number of further technicalities.

Restart Manager: Windows has the Restart Manager feature to deal with this problem - files and resources that are locked and can't be updated. It is essentially a way for applications to shut themselves down in a standardized way - via an API (method calls) - so that setups and system processes can instruct the applications in question: "shut yourself down" - and then the system will restart the applications when appropriate.

Technicalities: Advanced Installer - makers of leading deployment software - has a primer on the technical aspects of making your application support the Restart Manager feature. And there is: more on RestartManager here.


Links:


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...