C++ Custom Action returns empty string

后端 未结 1 917
梦毁少年i
梦毁少年i 2021-01-14 21:23

We are having problem with a deferred custom action in c++. We simply want the value for a customactiondata property \'apacheconfpath\' which has a dummy value of test at t

相关标签:
1条回答
  • 2021-01-14 22:09

    When the deferred custom action requests the data it ask for it via the well known identifier CustomActionData. You can see that name referenced in the log file at the end of this line:

    MSI (s) (80:C4) [20:59:30:210]: Executing op: CustomActionSchedule(Action=AppendToApacheConfigFile,ActionType=1025,Source=BinaryData,Target=AppendToApacheConfigFile,CustomActionData=/apacheconfpath=test;)
    

    To access the data, you'd change your MsiGetProperty call to look more like:

    MsiGetProperty(hInstall, TEXT("CustomActionData"), TEXT(""), &dActionDataLen);
    

    Note: Since you are already using wcautil, I highly recommend using WcaGetProperty() instead of MsiGetProperty(). You'll want to check the return code from WcaGetProperty() and in doing so your custom action will correctly handle user cancels. Otherwise, your custom action could swallow the user's attempt to cancel the install.

    0 讨论(0)
提交回复
热议问题