PDA

View Full Version : Crash program when call FeaturesSetData() installshield 2013



userdefault
08-09-2013, 03:44 AM
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!

userdefault
08-09-2013, 06:11 AM
Please review above code then tell me what is wrong?

MichaelU
08-09-2013, 08:52 AM
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 (http://support.installshield.com/kb/view.asp?articleid=Q213507)? If not, please apply it and rebuild. If you already have the hotfix, we can look further.

userdefault
08-10-2013, 05:53 AM
Thank you for your support quick!
I apply your suggestion.

userdefault
08-12-2013, 03:07 AM
Thanks you so much, software run well!