cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Marek22
Pilgrim

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
Labels (1)
Tags (2)
0 Kudos
4 Replies
Marek22
Pilgrim

Re: Suite Actions Can't Access System Properties

Anyone knows how to acces properties like "FEATURE[FeatureName].actionState" from the suite actions? It is just not working for me and I have to use the old C++ CustomActions that I wanted to get rid off.
0 Kudos
DLee65
Pilgrim

Re: Suite Actions Can't Access System Properties

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.
0 Kudos
Marek22
Pilgrim

Re: Suite Actions Can't Access System Properties

Thank you for the suggestion. The feature state properties are not working in all suite actions. I've tried to create simple SetProperty Action in the UI and the result was the same. I wonder why is that. In the C++ custom actions that were introduced in IS 2012 it is working correctly.

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.
0 Kudos
joshstechnij
Pilgrim

Re: Suite Actions Can't Access System Properties

Feature "properties" are not suite engine based properties. They are implemented by the UI DLL in suite projects, and as such, are generally only available through the suite UI. Unfortunately, attempting to access these through ISuiteExtension::get_Property (in InstallScript, DLL, or Managed actions) or any other place outside of the UI (such as in a UI DLL action) won't work.

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.
0 Kudos