首先 在安装包中先添加自定义操作  如添加(主输出来自MyInstaller)

然后 右键“主输出来自MyInstaller”-属性

        设置CustomActionData属性

        如 /ProductCode=[ProductCode] /Solution="Solution1"

最后 在MyInstaller(继承自System.Configuration.Install.Installer)中获取参数

    [RunInstaller(true)]
    public class MyInstaller : System.Configuration.Install.Installer

    {

        private void GetParams()
        {
            //获取从安装程序“自定义操作”的CustomActionData属性中传过来的参数
            string szProductCode = Context.Parameters["ProductCode"];//获得 产品编号
            string szSolution = Context.Parameters["Solution"]; //获得 "Solution1"

        }

    }

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-27
  • 2022-02-06
  • 2021-10-20
  • 2021-11-22
  • 2022-01-17
  • 2021-11-04
  • 2021-07-30
相关资源
相似解决方案