在延迟的自定义操作中获取CustomActionData [英] Getting CustomActionData in deferred custom action

查看:99
本文介绍了在延迟的自定义操作中获取CustomActionData的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试从c ++ dll中的CustomActionData属性获取数据,但是在延迟序列中它始终为空。如果我在UI序列中执行的CA中使用完全相同的代码,那么一切都很好。

I try to get data from the CustomActionData property in a c++ dll, but it's always empty during the deferred sequence. If I use the exact same code in a CA executed during the UI sequence it all works great.

        UINT iCASize = 0;
        UINT uiStat = MsiGetProperty(hInstall, TEXT("CustomActionData"), TEXT(""), &iCASize);
        if (uiStat == ERROR_MORE_DATA)
        {
            // this means there are data to read. Allocate array for all data and read it (+1 for null termination)
            pCustData = new WCHAR[iCASize + 1];
            uiStat = MsiGetProperty(hInstall, TEXT("CustomActionData"), pCustData, &iCASize);
        }

你们中的任何人都知道有什么问题吗?

Any of you out there have an idea what could be wrong?

推荐答案

此C ++代码存在问题(我已经二十年没有使用c ++了),或者更有可能您未设置CustomActionData正确。

Either there is something wrong with this C++ code (I haven't done c++ in twenty years) or more likely you not setting the CustomActionData correctly.

您需要先执行在立即上下文中安排的自定义操作,然后再执行延迟的自定义操作。

You need to a custom action scheduled in the immediate context before your deferred custom action. The property it sets is the name of the deferred CA.

Customaction名称:SetSomething属性:Something =值:FOO(不是CustomActionData = FOO)

Customaction Name: SetSomething Property: Something = Value: FOO ( Not CustomActionData = FOO )

自定义名称:Something MsiGetProperty(... CustomactionData ...);

Customaction Name: Something MsiGetProperty( ... "CustomactionData" ... );

这篇关于在延迟的自定义操作中获取CustomActionData的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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