
skotnicam1.5524898003257354E12 asked a question.
Suite Actions Can't Access System Properties
Hello,
When I try to access properties like "FEATURE[FeatureName].actionState" in suite actions(i.e. Set Property action in Events view or managed code) they are always null. However they work fine when I write the same thing from the UI. How can I access this features from suite actions? I need them in my managed code.
Thank you,
Marek
For our C++ custom action I had to import \SetupSuite.exe
import "..\..\..\Redist\Language Independent\i386\SetupSuite.exe" no_namespace raw_interfaces_only named_guids
...
HRESULT __stdcall MyCustomAction(IDispatch *pAction);
{
BSTR upgradeCode = ::SysAllocStringLen(NULL, 2*iGUID);
BSTR bstrUpgradeCode(_T("UPGRADE_PROPERTY"));
// Create a smart pointer to the IsSuiteExtension COM interface
CComQIPtr spSuiteExtension = pAction;
CComQIPtr spSuiteExtension2 = pAction;
try
{
hRet = SpSuiteExtention->get_Property(bstrUpgradeCode, &upgradeCode);
}...
}
Ooops, my bad. I just realized that you are working with managed code and wanted to eliminate the C++ code.
http://helpnet.flexerasoftware.com/installshield21helplib/helplibrary/SteActionManagedCd.htm
I have not used the managed code only InstallScript and C++. Sorry. The above documents the process though. Unfortunately the documentation seems to indicate that objects for feature state are not exposed.
" DLee65 wrote:
Have you added a reference to the library file in your code? That is the only thing that I can think of.
For our C++ custom action I had to import \SetupSuite.exe
import "..\..\..\Redist\Language Independent\i386\SetupSuite.exe" no_namespace raw_interfaces_only named_guids
...
HRESULT __stdcall MyCustomAction(IDispatch *pAction);
{
BSTR upgradeCode = ::SysAllocStringLen(NULL, 2*iGUID);
BSTR bstrUpgradeCode(_T("UPGRADE_PROPERTY"));
// Create a smart pointer to the IsSuiteExtension COM interface
CComQIPtr spSuiteExtension = pAction;
CComQIPtr spSuiteExtension2 = pAction;
try
{
hRet = SpSuiteExtention->get_Property(bstrUpgradeCode, &upgradeCode);
}...
}
Ooops, my bad. I just realized that you are working with managed code and wanted to eliminate the C++ code.
http://helpnet.flexerasoftware.com/installshield21helplib/helplibrary/SteActionManagedCd.htm
I have not used the managed code only InstallScript and C++. Sorry. The above documents the process though. Unfortunately the documentation seems to indicate that objects for feature state are not exposed. "
The next release of InstallShield does provide a way to get information from certain suite objects, such as features, through new functionality that would allow something like using a set property action to set a property to the value of a feature's action state.