如何防止在InstallShield中记录自定义操作的执行步骤? [英] How to prevent to log execution steps of Custom Action in InstallShield?

查看:93
本文介绍了如何防止在InstallShield中记录自定义操作的执行步骤?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用InstallShield制作了一个安装程序.我已经在其中编写了一些自定义操作.
在安装此安装程序时,这些CustomActions的日志(执行步骤)会打印在日志文件中.但是我想防止将某些CustomActions的数据(执行步骤)记录到日志文件中.我不想让用户知道自定义操作"到底出于安全目的在做什么.

I have made one installer using InstallShield. I have written some Custom Actions in that.
While installing this installer, the logs (execution steps) of those CustomActions gets printed in log file. But I want to prevent to log some CustomActions's data (execution steps) into log file. I don't want to let user know what exactly the Custom Action is doing for security purpose.

那么,如何防止某些CustmAction将其执行步骤记录到日志文件中?我想防止整个CustomAction的日志.
还是我们可以在InstallShield中安装时将日志记录暂停一段时间?

So how I can prevent some CustmAction to log their execution steps into log files ? I want to prevent whole CustomAction's logs.
Or can we pause a logging for some duration time while installation in InstallShield ?

推荐答案

这将提出一个有趣的功能请求!也许可以教导InstallShield在即时操作时或计划了延迟操作时尊重(理论上的)ISSuppressLogging属性的值,该值是非空的.但这现在不可用,并且需要对InstallShield的自定义操作进行基于代码的更改.

That would make an interesting feature request! Perhaps InstallShield could be taught to respect the value of a (theoretical) ISSuppressLogging property that is non-empty at the time of an immediate action, or when a deferred action is scheduled. But that's not available now, and would require code-based changes to InstallShield's custom actions.

回到现在. InstallShield没有提供任何抑制其日志记录语句的选项,至少在它明确尝试支持的几种方案之外,因此您将获得以下可能无法满足您需求的选项:

Back to the present. InstallShield does not offer any option to suppress its logging statements, at least beyond a few scenarios that it explicitly attempts to support, so you are left with the following options that probably don't cover your needs:

  • 使用MsiHiddenProperties明确禁止记录特定属性的值.请注意,一些操作将格式化字符串,并且这样做会丢失对组成结果值的属性的跟踪,因此不要尊重MsiHiddenProperties.

  • Use MsiHiddenProperties to explicitly prevent the logging of specific property's values. Note that several actions will format strings, and in doing so lose track of what properties comprise the resulting value, so do not respect MsiHiddenProperties.

使用自定义操作类型标志0x2000/8192 自定义操作隐藏目标选项可防止记录延迟操作的CustomActionData属性值.同样,这不会传播到基于自定义操作从该属性提取的值的任何进一步的日志记录.请注意,您必须将8192值添加(从技术上按位进行或"运算)到CustomAction表的类型"列中的现有值;该值的其他位也包含重要信息,例如其基本类型及其执行选项.

Use the custom action type flag 0x2000 / 8192 Custom Action Hidden Target Option to prevent logging the value of a deferred action's CustomActionData property, for example. Again this does not propagate to any further logging based on values the custom action extracts from this property. Note that you must add (technically bitwise OR) the value 8192 to the existing value in the Type column of the CustomAction table; the other bits of that value contain important information as well, such as its base type and its execution options.

(请参阅链接的防止机密信息被写入日志文件,以获取有关此行的更多建议,但这些建议都无济于事.)

(See the linked Preventing Confidential Information from Being Written into the Log File for some more suggestions along this line, none of which will help here.)

从ControlEvent运行自定义操作.这一点有点疯狂,对于大多数用途来说绝对是不切实际的,因为您可能希望隐藏修改细节的项目的日志记录详细信息,并且需要以提升的特权运行.但是,如果不是这种情况,请在 DoAction控件事件可以防止所有日志消息都记录到日志中.

Run the custom action from a ControlEvent. This one is a little wild, and definitely impractical for most uses, as you probably desire to hide logging detail from items that modify the system and need to run with elevated privileges. But if that's not the case, a quirk in the DoAction control event happens to prevent all log messages from making it to the log.

作为一般性评论,我经常看到有关将字符串以纯文本格式存储在另一个文件中的自定义操作的请求.在那种情况下,我不清楚为什么必须遮盖日志文件的字符串副本.如果数据特别敏感,则最好以某种方式加密其值,并仅存储加密后的值.然后,也许借助MsiHiddenProperties和项目符号中描述的隐藏目标标志的帮助,日志将仅包含加密值.

As a general comment, I often see this request with regards to custom actions that store strings in plain text in another file. In those cases I'm very unclear why the log file's copy of the string must be obscured. If the data is particularly sensitive, it may be better to somehow encrypt its value, and store only the encrypted value. Then, perhaps with help from MsiHiddenProperties and the hidden target flag as described in the bullets, the log would contain only the encrypted value.

这篇关于如何防止在InstallShield中记录自定义操作的执行步骤?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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