I have an installer that I had written a simple custom action to the count of a certain process type in a property ( AppSearch extension ) and then use that in LaunchConditions to gate the installer. The customer now wants a richer experience so I was trying to rewrite that a little to trigger the FilesInUse dialog.
[CustomAction]
public static ActionResult DetectRunningProgram(Session session)
{
var record = new Record(2);
record[0] = null;
record[1] = "Calc.exe";
record[2] = "Calculator";
session.Message(InstallMessage.FilesInUse, record);
MessageBox.Show("TEST");
return ActionResult.Success;
}
I scheduled this after AppSearch. I see the FilesInUse dialog get displayed but it doesn't go modal. As soon as I dismiss the TEST messagebox, FilesInUse goes away and I get my InstallWelcome dialog.
What am I missing? I am not using an External UI... native UI only.
The CostFinalize
action is going to be necessary to initialize significant state in the Windows Installer. That fact that the Windows installer doesn't process FilesInUse
until InstallValidate
is a good hint. Scheduling your custom action after CostFinalize
should get everything working. For example, the RestartResource
custom action in the WiX toolset that adds records to the Restart Manager is scheduled just before InstallValidate
.