从System.Configuration.Install.Installer设置MSI属性 [英] Set MSI properties from System.Configuration.Install.Installer

查看:76
本文介绍了从System.Configuration.Install.Installer设置MSI属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我已经创建了一个Vistual Studio安装项目(输出= MSI)来部署我的程序集.

此安装项目有2个安装"目录,自定义操作:
-第一个操作由安装程序类完成(=>我已将自定义操作的属性设置为"InstallerClass" = True).
-第二个操作将由安装程序类完成外部工具(=>我将"Custome Action"的属性设置为"SourcePath" = < Path/FileName.exe> ).

我的安装项目也有2个相关的回滚"自定义操作.

但是,如果第一个安装"操作失败,它将无法运行第二个安装"动作,因此我不想执行第二个回滚"行动.

我打算使用自定义操作的属性条件"以避免运行此第二回滚"消息.动作.

但是,我是有关MSI和设置项目的真正初学者.并且,如果我找到了如何将属性从自定义操作传递到安装程序类(使用"CustomActionData" =/MyParam = [MyProperty]),则找不到从安装程序类中撤回MSI属性的方法. >
如果我的安装程序类在安装失败时可以设置这样的属性,则可以在第二个回滚"条件下使用该属性.行动....

您能帮我找到如何做的吗?还是可能建议其他解决方案?

提前很多感谢

V.

Hello,

I have created a Vistual Studio setup project (output = MSI) to deploy my assemblies

This setup project has 2 "Install" Custom Actions:
- the first action is to be done by an Installer Class (=> I have set the Custom Action's property "InstallerClass" = True).
- the second action is to be done by an external tool (=> I set the Custome Action's property "SourcePath" = <Path/FileName.exe>).

My Setup Project has also the 2 related "Rollback" Custom Actions.

However, if the first "Install" action failed, it won't run the second "Install" action and therefore I don't want to execute the second "Rollback" action.

I intend to use the Custom Action's property "Condition" to avoid runing this second "Rollback" action.

However, I am a real beginner regarding MSI and setup projects. And if I found how to pass a property from a custom action to an Installer Class (using "CustomActionData" = /MyParam=[MyProperty]) I don't find how to set back a MSI property from the Installer Class.

If my installer class could set such a property when it fails the installation, I could use this property in the condition of the second "Rollback" action....

Could you help me to find how to do this ? Or possibly suggest another solution ?

Thanks a lot in advance

V.

推荐答案

我没有找到如何返回传递给安装程序类的属性的新值.因此,我更改了设计.

现在,我的安装程序类还通过其Install方法运行外部工具(实际上是命令行).对于由Install方法成功执行的所有操作,我将状态存储到InstallState中.这样做,现在很容易管理回滚.

现在仅保留一个"Install"(安装)目录.自定义操作和一个回滚"我的安装项目中的自定义操作.

V.
I didn't found how to return a new value for a property passed to the installer class. So, I change my design.

Now, my installer class also runs the external tool (a command line actually) from its Install method. For all operations successfully executed by the Install method, I store a status into the InstallState. Doing so, it's now very easy to manage the rollback.

It remains now only one "Install" Custom Action and one "Rollback" Custom Action in my Setup Project.

V.


这篇关于从System.Configuration.Install.Installer设置MSI属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆