使用Wix安装程序的“自定义操作”未在本地磁盘C中创建文件夹。
namespace MyCustomAction
{
public class CustomActions
{
[CustomAction]
public static ActionResult MySimpleAction(Session session)
{
string country = session["COUNTRIES"];
string root = @"C:\Temp";
try
{
if (!Directory.Exists(root))
{
System.IO.Directory.CreateDirectory(root);
File.AppendAllText(@"C:\Temp\country.txt", country);
}
}
catch (Exception)
{
return ActionResult.Failure;
}
return ActionResult.Success;
}
}
}