FeatureInitialize Example

InstallShield 2015 ยป InstallScript Language Reference

/*--------------------------------------------------------------*\

*

* InstallShield Example Script

*

* Demonstrates the FeatureInitialize function.

*

\*--------------------------------------------------------------*/

 

NUMBER nResult, n;

 

program

 

// Set a target directory.

TARGETDIR = "C:\\temp" ^ MEDIA;

 

// Select features to transfer.

nResult = FeatureDialog ("", "", TARGETDIR,"");

  

   if (nResult < 0) then

   SprintfBox (SEVERE, "FeatureDialog ERROR", "%ld", nResult);

endif;

    

// Transfer files associated with data1.cab (Data Media).

nResult = FeatureMoveData (MEDIA, n, 0);

if (nResult < 0) then

   SprintfBox (SEVERE, "FeatureMoveData ERROR", "%ld", nResult);

endif;

  

// Set up for second media.

MEDIA = "second";

 

// Set a target directory.

TARGETDIR = "C:\\temp" ^ MEDIA;

  

// Associate new media with second1.cab cab file.

nResult = FeatureInitialize (MEDIA, "second1.cab");

   if (nResult < 0) then

   SprintfBox (SEVERE, "FeatureInitialize ERROR", "%ld", nResult);

endif;

 

// Select features to transfer.

   nResult = FeatureDialog ("", "", TARGETDIR,"");

if (nResult < 0) then

   SprintfBox (SEVERE, "FeatureDialog ERROR", "%ld", nResult);

endif;

      

// Reinitialize FeatureMoveData function.

   nResult = FeatureMoveData ("", n ,0);

if (nResult < 0) then

   SprintfBox (SEVERE, "FeatureMoveData ERROR", "%ld", nResult);

endif;

 

// Transfer files associated with second1.cab (second Media).

nResult = FeatureMoveData (MEDIA, n, 0);

if (nResult < 0) then

   SprintfBox (SEVERE, "FeatureMoveData ERROR", "%ld", nResult);

endif;

  

endprogram

 

// Source file: Is5fn628.rul