WiX Custom Action - Pass file list

不问归期 提交于 2019-12-12 01:36:33

问题


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?


回答1:


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




回答2:


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"];
    //...
}


来源:https://stackoverflow.com/questions/10949033/wix-custom-action-pass-file-list

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!