是的。您可以通过在运行该对话框之前将任何网络驱动器值设置为该DirectoryCombo属性来防止这种情况。编写自定义操作以读取网络驱动器并将驱动器值中的任何一个设置为该目录属性并在 InstallUISequence 中安排自定义操作。
[CustomAction]
public static ActionResult CustomAction1(Session session)
{
DriveInfo[] drives = DriveInfo.GetDrives();
foreach (DriveInfo drvInfo in drives)
{
if (drvInfo.DriveType == DriveType.Network)
{
session["SHARED_DRIVE"] = drvInfo.Name;
break;
}
}
return ActionResult.Success;
}
<Binary Id="SharedDrive" SourceFile="TestProject.CA.dll" />
<CustomAction Id="SHAREDDRIVE" BinaryKey="SharedDrive" DllEntry="CustomAction1" Return="check" />
<InstallUISequence>
<Custom Action="SHAREDDRIVE" After="AppSearch">Not Installed</Custom>
</InstallUISequence>