InstallShield 2016 » InstallScript Language Reference
This script is structured for use in a Basic MSI installation. To call this function in a Basic MSI installation, you must first create a custom action for the entry-point function, execute the custom action in a sequence or as the result of a dialog's control event, and then build the release. To run this code in an InstallScript or InstallScript MSI installation, copy only the code that is in between the begin and end statements and paste it into your script's OnBegin event handler function.
Note • To call this function in a Basic MSI setup, you must first create a custom action for the entry-point function, execute the custom action in a sequence or as the result of a dialog's control event, and then build the release.
/*--------------------------------------------------------------*\
*
* InstallShield Example Script
*
* Demonstrates the GetEnvVar function.
*
* GetEnvVar is called to get the value of the environment
* variable named TEMP.
*
\*--------------------------------------------------------------*/
#define TITLE_TEXT "GetEnvVar Example"
#define ENV_TEMP "TEMP"
// Include Ifx.h for built-in InstallScript function prototypes.
#include "Ifx.h"
export prototype ExFn_GetEnvVar(HWND);
function ExFn_GetEnvVar(hMSI)
STRING svEnvVar;
begin
// Get the value of the environment variable specified by ENV_TEMP.
if (GetEnvVar (ENV_TEMP, svEnvVar) < 0) then
// Report the error.
MessageBox ("Environment variable " + ENV_TEMP + " not found.", SEVERE);
else
// Display the value of the environment variable.
SprintfBox (INFORMATION, TITLE_TEXT, "%s = %s", ENV_TEMP, svEnvVar);
endif;
end;
InstallShield 2016 Help LibraryMay 2017 |
Copyright Information | Flexera Software |