When ever there is an update patch of files that have to be replaced with the existing files and if one of the files is being used by any of the processes, then a file in use dialog box pops-up.I wanna avoid that dialog box and get that file queued up for installation so that it can be installed at the time of system reboot. I have read that the queuing the files for update at the time of reboot is the inbuilt functionality of windows installer. Can someone suggest me the way to remove that FileInUse Dialog box. I tried setting up the "MsiRMFilesInUse" property to "0" but it didn't work.
相关问题
- How does the setup bootstrapper detect if prerequi
- Wix: How can I set, at runtime, the text to be dis
- Mysql-installer showing error : Memoy could not be
- Cancel installation from my custom action
- WiX: Multiple MSI files?
相关文章
- chained msi's/Bootstrapper/prerequisite?
- How to prevent WiX bundle with same UpgradeCode/Ve
- Running msiexec from a service (Local System accou
- Set InstallPath registry key using Visual Studio S
- Looking for a flexible windows installer product w
- Can I use msilib or other Python libraries to extr
- WIX 3.8 msiexec.exe /quiet Error 1603
- Setup Project for Visual Studio
"Short" Answer
Below is a little drill-down of files-in-use issues and the Restart Manager - intended as a quick review for files-in-use and reboot issues.
In terms of your actual problem. I wouldn't mess with the
FileInUse dialog(s)
. It won't really solve your problem. Maybe consider these pointers:HKLM\Software\Policies\Microsoft\Windows\Installer
.I suppose you could also abort the install if locked files are detected, or you could require users to log off before the installation is run - if you have a distribution system.
Please at least skim the rest of the answer for more details and context.
Restart Manager
Your applications and services should be prepared to be shut down by the Restart Manager and save user data and state information that are needed for a clean restart. This requires updates and changes to the application / service to adhere to standards for shutdown and restart of the application.
The Restart Manager: is a new C-style API available beginning with Windows Vista and Windows Server 2008. Restart Manager consists of a single DLL that applications can load to access the Restart Manager API. The idea is that the Restart Manager will auto-magically shut down and restart your applications during installations / updates, by having the application / service follow a set of guidelines:
the crucial tech-read
)More Technical stuff:
Restart Manager Configuration: There are a number of properties that will affect how the Restart Manager will operate with Windows Installer:
When Restart Manager is used, the MsiRMFilesInUse dialog is used instead of the FileInUse dialog to show a list of applications that have locked files.
N.B! The whole Restart Manager feature can also be disabled by policy:
HKLM\Software\Policies\Microsoft\Windows\Installer
.FileInUse
If you don't have the time or resources to implement proper interoperability with the Restart Manager (which is frankly the only sane thing to spend your resources on at this point in Windows's development), then there are a few things that might be good to know:
FileInUse
dialog if you install the setup in silent mode. However, this could trigger a system reboot unless you specify theREBOOT=ReallySuppress property
.built-in MSI constructs
toshut down services
during upgrades - the Service Control table.App.exe -shutdown
, despite not having been written to be interoperable with the Restart Manager. Maybe system tray applications that save no data for the user?WiX
: Kill windows service forcefully in WIX.VBScript
: Close an application using VBScript.Advanced Installer
: How to detect or stop a process.Installshield
: Kill process. Kill process documentation.REINSTALLMODE="amus"
to force overwrite files during installation?repair
andmodify
scenarios.Some Further Links:
Hopefully not repeating too much here, but I'll start by pointing out that the reason for that dialog is to avoid reboots. You didn't say why you want to wait for a reboot instead of using the in-use functionality that lets you avoid rebooting in the first place. It's also unclear about when your next reboot is expected, the issue being that the install of the app is not complete until all the files have been completely replaced and updated. It's not unusual for an incompletely installed app to crash because its current state is some set of old and new files mixed together.
There is no MsiRMFilesInUse property, so setting it has no effect.
The MSIRESTARTMANAGERCONTROL property tells Windows whether to use the older FilesInUse behavior or the new Restart Manager FilesInUse methods of in-use detection. It does not turn off files-in-use behavior detection, it's just a switch between old and new methods. Because the detection methods differ you may see different behavior depending on what files are actually in use (only apps with open windows are detected by the old methods).
You should say which tool you are using to build your MSI file because they have different capabilities. Visual Studio setups have virtually no support for automatic shutdown, except that if you are installing services with installer classes then your Uninstall method could be extended to stop the service at uninstall time. If you are using WiX then there are util::CloseApplication capabilities.
The supported Windows shutdown method is to integrate your apps with Restart Manager, and Stein has links. For services, the "normal" service install with MSI ServiceInstall/ServiceControl takes care of this, but not for Visual Studio setup projects with installer classes.
Finally, create an MSI verbose log and look for in use entries, usually with a 1603 error (the file in use flavor, not the install crashed flavor). You may not need this log if the dialogs tell you the apps that need shutting down, so just focus on a way to get them stopped on an update, because that's a better solution rather than attempting to suppress the default Windows behavior.
Assuming you are the package author, I would suggest following the norms, which are to use the MsiRMFilesInUse dialog. But if you want to attempt to disable things anyway, start by understanding the guidance for package authors on Using Windows Installer with Restart Manager:
Setting
MSIRESTARTMANAGERCONTROL=Disable
, possibly removing the FilesInUse and MsiRMFilesInUse dialogs from your package, and optionally tweaking further settings discussed on System Reboots (such as setting theREBOOT
orREBOOTPROMPT
properties) may have the effect you desire.If you are not the package author, you are probably asking in the wrong forum. The DisableAutomaticApplicationShutdown policy sounds like it could do most of what you describe, and would apply to all packages installed on your machine. It is intended for use by systems administrators instead of package authors. Alternately you could create transforms (or specify properties on the installation command line) to effectively alter the package like the package author would have.