PDA

View Full Version : OnIISCheckRequirements



Birnbauer
12-17-2004, 05:37 AM
Hi,

I have a InstallScript project, and I won’t to determine the version of IIS. The version of IIS must be equal or greater than 6.
Ok, I know how to get the IIS version from registry. But my problem is, if I get the version from registry and store it in a property, that the property has the value (e.g.) “#6”. So I can’t use it in a launch condition.
In a other forum I have read a post, that it gives a event “OnIISCheckRequirements”, and there I can make the version check.

But how to I register to this event? :confused:
What project settings do I need for this event? :confused:


Thanks
David

Perucho
12-22-2004, 01:10 PM
InstallShield X - InstallScript Project:

IS X checks for the IIS version if you use the IIS IDE and create a Website and a Virtual Directory. By using the IIS IDE to create a virtual directory, it triggers the detection of IIS on the target machine. The function event OnIISCheckRequirements() is called.

On IS X to display the function/event OnIISCheckRequirements() in your InstallScript project:
go to "Installation Designer"
go to "Behavior and Logic" --> "InstallScript"
on the top of the code editor, where it says "Initialization"
click on the drop-down list and select "Before Move Data"
then right next to it select "OnIISCheckRequirements()"
it should display the function/event code on your project

read this post:
http://community.installshield.com/showthread.php?t=141355

Here is the function code (IS X):

//---------------------------------------------------------------------------
// OnIISCheckRequirements
//
// The OnIISCheckRequirements event is called by Preprogram to make sure
// that the requirements for IIS runtime are met
//---------------------------------------------------------------------------
function OnIISCheckRequirements()
STRING szMsg;
begin

// if the version is not adequate, display messagebox and abort
if ( IISRTGetIISVersion( IIS_GET_VERSION_MAJOR ) < IIS_VERSION_MAJOR_MIN_SUPPORT ) then
szMsg = SdLoadString( IDS_IFX_IIS_INADEQUATE_VERSION );
MessageBox(szMsg, SEVERE);
abort;
endif;

end;

Detect version 6.0 or above:

// if the version is not adequate, display messagebox and abort
if ( IISRTGetIISVersion( IIS_GET_VERSION_MAJOR ) < 6 ) then
szMsg = SdLoadString( IDS_IFX_IIS_INADEQUATE_VERSION );
MessageBox(szMsg, SEVERE);
abort;
endif;