PDA

View Full Version : scripts???



michaelchien
06-08-2004, 03:00 AM
hi
I'm a new nser for installshield.I have to creat a setup application for wireless,but I don't know how to find the address how to use the scripts function such as below context.Please help,and thanks

michaelchien 6/8/2004


///////////////////////////////////////////////////////////////////////////
//
// Function: RegisterDriverINF
//
// Purpose: This function will be called by the script engine when
// Windows(TM) Installer executes the custom action
//
// To create a custom action for this entry-point function:
// 1. Right-click on "Custom Actions" in the Actions/Scripts view.
// 2. Select "Custom Action Wizard" from the context menu.
// 3. Proceed through the wizard and give the custom action a unique name.
// 4. Select "Run InstallScript code" for the custom action type, and in
// the next panel select "RegisterDriverINF" for the source.
// 5. Click Next, accepting the default selections until the wizard
// creates the custom action.
//
// Once you have made a custom action, you must execute it in your setup by
// inserting it into a sequence or making it the result of a dialog's
// control event.
//
////////////////////////////////////////////////////////////////////////////
function RegisterDriverINF( szFilePath, szFileName, szHWID )
STRING szInfFileName, szDriversPath, szFullInfPath;
NUMBER Err;
begin
szInfFileName = szFileName;
szDriversPath = szFilePath;
szFullInfPath = szDriversPath ^ szInfFileName ;

bRebootRequired = FALSE ;

//Detecter USB H/W
if ( 0 = ExistsDir ( szDriversPath )) then
if (!UpdateDriver4PnP( szHWID, szFullInfPath, bRebootRequired)) then
if (!SetupCopyOEMInfA( &szFullInfPath, NULL, SPOST_PATH, 0, NULL, 0, NULL, NULL)) then
if ( DEBUG_VERSION ) then
Err = GetLastError();
SprintfBox( INFORMATION, "CustomAction: RegisterDriverINF", "SetupCopyOEMInfA Failed: %s",Err);
endif;
endif;
endif;
endif;

if ( bRebootRequired ) then
if ( DEBUG_VERSION ) then
SprintfBox( INFORMATION, "CustomAction: RegisterDriverINF", "UpdateDriverForPlugAndPlayDevices says a Reboot is required!");
endif;
endif;
//return ERROR_SUCCESS;
end;