WiX Custom Action - Pass file list

2019-08-27 04:13发布

I am preparing installation packages for a plugin which replace some files of other application. I need make a backup of that files, so I prepared CustomAction which will do that.

How can I pass as argument to my custom action locations of all files which will be copied during installation? Do I need to make that list manually?

2条回答
forever°为你锁心
2楼-- · 2019-08-27 04:14

You can pass parameters to custom actions by setting properties in your installer. Then access those properties in your custom action like so (C# example):

[CustomAction]
public static ActionResult DoWork(Session session)
{
    session.Log("Begin DoWork");
    string propertyValue = session["PROPERTYNAME"];
    //...
}
查看更多
贪生不怕死
3楼-- · 2019-08-27 04:33

Instead of creating a custom action, why not use the WiX CopyFile element to back up those files.

查看更多
登录 后发表回答