This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- FeatureAddCost return -1
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 16, 2010
01:53 AM
FeatureAddCost return -1
HI,
I use this method and feature's size still zero (actually, no files included in it, but I need non zero cost):
function OnBegin()
STRING szRunKey,szProductName,szRunValue,szTemp,szCmd;
NUMBER nvServiceState,nType,nSize,nCostHigh,nCostLow;
begin
// TO DO: you may change default non-UI setting, for example
//
nType=CalculateAndAddFileCost( 0, 250 * 1024 * 1024, TEMPPATH, 0, nCostHigh, nCostLow );
nType=FeatureAddCost( MEDIA, "DefaultFeature", TEMPPATH, nCostHigh, nCostLow );
// You may also perform your custom initialization steps, check requirements, etc.
end;
I use this method and feature's size still zero (actually, no files included in it, but I need non zero cost):
function OnBegin()
STRING szRunKey,szProductName,szRunValue,szTemp,szCmd;
NUMBER nvServiceState,nType,nSize,nCostHigh,nCostLow;
begin
// TO DO: you may change default non-UI setting, for example
//
nType=CalculateAndAddFileCost( 0, 250 * 1024 * 1024, TEMPPATH, 0, nCostHigh, nCostLow );
nType=FeatureAddCost( MEDIA, "DefaultFeature", TEMPPATH, nCostHigh, nCostLow );
// You may also perform your custom initialization steps, check requirements, etc.
end;
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 16, 2010
06:00 PM
I am getting this same problem. Below is the code I used in the OnBegin event.
Am I missing something with the FeatureAddCost function. I've followed what little examples I can find. Sending the install dir before the user actually has a chance to select the install directory seems odd to me
if(0 == GetAndAddFileCost ( SRCDIR^"Exchange Protection Manager.msi", INSTALLDIR, 0, nvCostHigh, nvCostLow )) then
FeatureAddCost ( MEDIA, "EPM_Client", INSTALLDIR, nvCostHigh, nvCostLow );
endif;
Am I missing something with the FeatureAddCost function. I've followed what little examples I can find. Sending the install dir before the user actually has a chance to select the install directory seems odd to me
if(0 == GetAndAddFileCost ( SRCDIR^"Exchange Protection Manager.msi", INSTALLDIR, 0, nvCostHigh, nvCostLow )) then
FeatureAddCost ( MEDIA, "EPM_Client", INSTALLDIR, nvCostHigh, nvCostLow );
endif;
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 07, 2012
03:48 AM
I still have the same problem with InstallShield 2012 Spring.
I want to add some additional size to a feature, because this feature created a volume of a database (in our case the MaxDB from SAP). I tried to add 512 MB with this code in OnBegin():
But I always get a -1 form FeatureAddCost.
Is there a soltion for it or did I something wrong? Unfortunately there are not much examples.
Thanks in advanced,
Thomas
I want to add some additional size to a feature, because this feature created a volume of a database (in our case the MaxDB from SAP). I tried to add 512 MB with this code in OnBegin():
CalculateAndAddFileCost(0, 512 * 1024 * 1024, INSTALLDIR, 0, nCostHigh, nCostLow);
nResult = FeatureAddCost(MEDIA, "Server\\Core\\MaxDB", INSTALLDIR, nCostHigh, nCostLow );
if (nResult < ISERR_SUCCESS) then
SprintfBox(SEVERE, "", "Error: %d", nResult);
endif;
But I always get a -1 form FeatureAddCost.
Is there a soltion for it or did I something wrong? Unfortunately there are not much examples.
Thanks in advanced,
Thomas
![](/skins/images/3B39CE851FDD5528C393F146EB70A2D0/responsive_peak/images/icon_anonymous_message.png)