cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
userdefault
Pilgrim

Crash program when call FeaturesSetData() installshield 2013

Dear everybody in community,

I have a big issue with installshield premier 2013, details below:
----------
1. Create a new project
2. When i use below code then crash program:
//===========================================================================
//
// File Name: Setup.rul
//
// Description: Blank setup main script file
//
// Comments: Blank setup is an empty setup project. If you want to
// create a new project via. step-by step instructions use the
// Project Assistant.
//
//===========================================================================

// Included header files ----------------------------------------------------
#include "ifx.h"

prototype ShowProgramsOptions(STRING , STRING , STRING , NUMBER );
function OnBegin()
STRING svBuffer;
begin
ShowProgramsOptions("Title", "Message", svBuffer, 1);
MessageBox("test", WARNING);
end;

function ShowProgramsOptions(szTitle, szMsg, svResultPrograms, nStyle)
LIST listPrograms;
STRING svSelected, szMedia;
STRING svFeatureName;
NUMBER nDataSize, nResult;
STRING szData, szBuffer;
STRING szKey;
begin
szMedia = "MyMedia12";
nDataSize = 0;

listPrograms = ListCreate(STRINGLIST);

MEDIA = szMedia;
nDataSize = 100;
szBuffer = "C:\\bbb";

szKey = "Option\\Option1";
nResult= FeatureAddItem(szMedia, szKey, nDataSize, TRUE);
szKey = "Option\\Option1";
nResult= FeatureSetData (szMedia,szKey, FEATURE_FIELD_VISIBLE, TRUE, "");// CRASH PROGRAM HERE

// Set selected option
FeatureListItems(MEDIA, "", listPrograms);

nResult = ListGetFirstString(listPrograms, svSelected);
// For every selected item i install relative feature
while (nResult != END_OF_LIST)
if (FeatureIsItemSelected(MEDIA, "FeatureOpt1")) then
FeatureGetData(MEDIA, svSelected, FEATURE_FIELD_MISC, nResult, svFeatureName);
endif;

nResult = ListGetNextString(listPrograms, svSelected);
endwhile;

ListDestroy(listPrograms);
MEDIA = "DATA"; // Ripristino il media originale.

return 0;
end;




----------
Please help meeeee fix this issue!
Labels (1)
0 Kudos
4 Replies
userdefault
Pilgrim

Re: Crash program when call FeaturesSetData() installshield 2013

Please review above code then tell me what is wrong?
0 Kudos
Flexera MichaelU
Flexera

Re: Crash program when call FeaturesSetData() installshield 2013

In general, short of badly defined or invoked external DLL calls, InstallScript code shouldn't crash. First things first, have you applied the hotfix from Q213507? If not, please apply it and rebuild. If you already have the hotfix, we can look further.
0 Kudos
userdefault
Pilgrim

Re: Crash program when call FeaturesSetData() installshield 2013

Thank you for your support quick!
I apply your suggestion.
0 Kudos
userdefault
Pilgrim

Re: Crash program when call FeaturesSetData() installshield 2013

Thanks you so much, software run well!
0 Kudos