问题描述
我有一个延迟的自定义操作,该操作使用Customactiondata获取属性,它包含不应在日志中显示的password值.
I have a deferred custom action which fetches a property using Customactiondata, it contains the value of password that should not be displayed in the log .
使用的打包工具:WIX
Packaging tool used: WIX
用C ++编写的自定义操作
Custom action written in C++
我尝试了以下变通办法,似乎没有任何作用.
I have tried the below workarounds nothing seems to be working.
-
将属性和CA名称标记为隐藏
Marked the property and CA name as hidden
在CA定义中隐藏目标=是
Hidetarget = yes in CA definition
需要做什么?
代码:
<CustomAction Id="CASETLOGINFORRCSERVICES" Return="check" HideTarget="yes" Execute="deferred" Impersonate="no" TerminalServerAware="no" DllEntry="SetLoginForRCServices" BinaryKey="CA_Dll" />
日志:
MSI (s) (7C:CC) [18:35:39:011]: Executing op: CustomActionSchedule(Action=CASETLOGINFORRCSERVICES,ActionType=3073,Source=BinaryData,Target=SetLoginForRCServices,CustomActionData=Deps@@@151232323)
MSI (s) (7C:B0) [18:35:39:038]: Invoking remote custom action. DLL: C:\WINDOWS\Installer\MSIEB69.tmp, Entrypoint: SetLoginForRCServices
推荐答案
MsiHiddenProperties :您可以设置一个属性来隐藏属性值以免被写入日志: MsiHiddenProperties属性(其中还有更多链接有关防止MSI中的机密信息的信息.
MsiHiddenProperties: There is a property you can set to hide property values from being written to the log: MsiHiddenProperties property (there are further links in there to more information on preventing confidential information in your MSI).
自定义操作 :为自定义操作设置属性 HideTarget ="yes"
将设置高于您的财产价值.但是,此功能似乎并未在日志中隐藏您在属性表中进行硬编码的任何值-因此,如果您在属性表中为属性设置了实际值,则还需要将属性本身设置为隐藏(您可以设置以编程方式或通过GUI设置值,而无需在属性表中进行设置).这里是示例:
Custom Action: Setting the attribute HideTarget="yes"
for the custom action will set the above property value for you. However this feature does not seem to hide any value you hard-code in the property table from the log - so if you set an actual value for the property in the property table you need to set the property itself hidden as well (you can set a value programmatically or via the GUI without setting it in the property table). Here are samples:
HideTarget =是"
:
<CustomAction Id="ReadProperyDeferred" HideTarget="yes" ... />
隐藏的属性=是"
:
<Property Id="MYPROPERTY" Hidden="yes" Secure="yes">Text</Property>
示例 :此处的示例WiX源: https://github.com/glytzhkof/WiXDeferredModeSample .
这是延迟模式的另一个示例-它使用DTF类CustomActionData轻松将属性发送到延迟模式: https://github.com/glytzhkof/WiXDeferredModeSampleDTF
Here is another sample for deferred mode - it uses the DTF class CustomActionData to easily send properties to deferred mode: https://github.com/glytzhkof/WiXDeferredModeSampleDTF
请记住,如果可以的话,请避免自定义操作:
Remember to avoid custom actions if you can: Why is it a good idea to limit the use of custom actions in my WiX / MSI setups?
代码提取 :更喜欢打开上述示例.但是,这是压缩的"消息.延迟模式自定义操作从集合属性自定义操作中检索数据所需的WiX构造序列:
Code Extract: Prefer to open the above sample. However, here is a "compressed" sequence of WiX constructs needed for deferred mode custom actions retrieving data from a set-property custom action:
<Property Id="MYPROPERTY" Hidden="yes" Secure="yes">Send this text to deferred mode</Property>
<Binary Id="CustomActions" SourceFile="$(var.CustomActionSample.TargetDir)$(var.CustomActionSample.TargetName).CA.dll" />
<CustomAction Id="SetProperty" Return="check" Property="ReadProperyDeferred" Value="[MYPROPERTY]" />
<CustomAction Id="ReadProperyDeferred" HideTarget="yes" BinaryKey="CustomActions" Execute="deferred" DllEntry="TestCustomAction" />
<InstallExecuteSequence>
<Custom Action='SetProperty' Before='InstallInitialize'></Custom>
<Custom Action='ReadProperyDeferred' Before='InstallFinalize'></Custom>
</InstallExecuteSequence>
链接 :
这篇关于如何在MSI日志中隐藏customactiondata的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!