This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- How to detect SQL Server Reporting Services during the setup
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 09, 2008
01:26 PM
How to detect SQL Server Reporting Services during the setup
I am working on a Basic MSI project. One of the features in my setup needs Reporting Services (2005 or 2008) to operate. I would like to be able to detect the installation of SSRS during my setup and show a warning/error if it was not instlled.
Your help is appriciated.
Your help is appriciated.
(3) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 09, 2008
03:03 PM
Here is a function I use
function CheckPrerequisites(hMSI)
begin
PREREQUISITE_MISSING = FALSE; //if its missing at least one, it will be set to true in the sub function
PREREQ_NAME = "Microsoft SQL Server 2005 Reporting Services or greater";
REGISTRY_KEY = "SOFTWARE\\Microsoft\\Microsoft SQL Server\\Reporting Services";
REGISTRY_KEY_FIELD = "Version";
REGISTRY_KEY_VALUE_TO_CHECKFOR = "9.00.3042.00";
TestIfRegKeyFieldExistsAndHasASpecificValueOrGreater(hMSI);
end;
function TestIfRegKeyFieldExistsAndHasASpecificValueOrGreater(hMSI)
STRING szKey, szFieldName, szValue, svFieldValue_output;
STRING svFieldExpectedValue, strPrereqName;
NUMBER nType, nSize, nvType, nvFieldSize_output;
begin
szKey = REGISTRY_KEY;
szFieldName = REGISTRY_KEY_FIELD;
svFieldExpectedValue = REGISTRY_KEY_VALUE_TO_CHECKFOR;
strPrereqName = PREREQ_NAME;
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
//Check to see if the key exists.
if (RegDBKeyExist (szKey) < 0) then
PREREQUISITE_MISSING = TRUE;
MsiSetProperty(hMSI, "PREREQS_MISSING", "1");
ListAddString(LIST_OF_MISSING_PREREQS, strPrereqName, AFTER);
else
// Retrieve key value information.
if (RegDBGetKeyValueEx(szKey, szFieldName, nvType, svFieldValue_output, nvFieldSize_output) < 0) then
PREREQUISITE_MISSING = TRUE;
MsiSetProperty(hMSI, "PREREQS_MISSING", "1");
ListAddString(LIST_OF_MISSING_PREREQS, strPrereqName, AFTER);
else
if (svFieldValue_output >= svFieldExpectedValue) then
ListAddString(LIST_OF_EXISTING_PREREQS, strPrereqName, AFTER);
else
PREREQUISITE_MISSING = TRUE;
MsiSetProperty(hMSI, "PREREQS_MISSING", "1");
ListAddString(LIST_OF_MISSING_PREREQS, strPrereqName, AFTER);
endif;
endif;
endif;
end;
function CheckPrerequisites(hMSI)
begin
PREREQUISITE_MISSING = FALSE; //if its missing at least one, it will be set to true in the sub function
PREREQ_NAME = "Microsoft SQL Server 2005 Reporting Services or greater";
REGISTRY_KEY = "SOFTWARE\\Microsoft\\Microsoft SQL Server\\Reporting Services";
REGISTRY_KEY_FIELD = "Version";
REGISTRY_KEY_VALUE_TO_CHECKFOR = "9.00.3042.00";
TestIfRegKeyFieldExistsAndHasASpecificValueOrGreater(hMSI);
end;
function TestIfRegKeyFieldExistsAndHasASpecificValueOrGreater(hMSI)
STRING szKey, szFieldName, szValue, svFieldValue_output;
STRING svFieldExpectedValue, strPrereqName;
NUMBER nType, nSize, nvType, nvFieldSize_output;
begin
szKey = REGISTRY_KEY;
szFieldName = REGISTRY_KEY_FIELD;
svFieldExpectedValue = REGISTRY_KEY_VALUE_TO_CHECKFOR;
strPrereqName = PREREQ_NAME;
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
//Check to see if the key exists.
if (RegDBKeyExist (szKey) < 0) then
PREREQUISITE_MISSING = TRUE;
MsiSetProperty(hMSI, "PREREQS_MISSING", "1");
ListAddString(LIST_OF_MISSING_PREREQS, strPrereqName, AFTER);
else
// Retrieve key value information.
if (RegDBGetKeyValueEx(szKey, szFieldName, nvType, svFieldValue_output, nvFieldSize_output) < 0) then
PREREQUISITE_MISSING = TRUE;
MsiSetProperty(hMSI, "PREREQS_MISSING", "1");
ListAddString(LIST_OF_MISSING_PREREQS, strPrereqName, AFTER);
else
if (svFieldValue_output >= svFieldExpectedValue) then
ListAddString(LIST_OF_EXISTING_PREREQS, strPrereqName, AFTER);
else
PREREQUISITE_MISSING = TRUE;
MsiSetProperty(hMSI, "PREREQS_MISSING", "1");
ListAddString(LIST_OF_MISSING_PREREQS, strPrereqName, AFTER);
endif;
endif;
endif;
end;
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 10, 2008
06:09 PM
Thank you for your reply Mike Wiz. Unfortunately I am not familiar with InstallScript. I want my setup to show an error after the user selected a certain feature that needs Reporting Services if it was not installed. I am not sure how to use the above script to accomplish this.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 11, 2011
01:41 PM
As an alternative to Mike's advice you can also check for the URL of the reporting services web service availability with a simple vbscript, a lot of time the SSRS is in a different computer. And a lot of times you are developing reports deployment tools instead of real installers so checking for the URL works also.
On Error Resume Next
URL = WScript.Arguments(0)
Set oXMLHTTP = CreateObject("MSXML2.XMLHTTP.6.0")
oXMLHTTP.open "GET", URL, false
oXMLHTTP.send
Result="URLNotFound"
If oXMLHTTP.status = 200 Then
Result="URLFound"
End If
wscript.echo Result
On Error Resume Next
URL = WScript.Arguments(0)
Set oXMLHTTP = CreateObject("MSXML2.XMLHTTP.6.0")
oXMLHTTP.open "GET", URL, false
oXMLHTTP.send
Result="URLNotFound"
If oXMLHTTP.status = 200 Then
Result="URLFound"
End If
wscript.echo Result
![](/skins/images/8C9D13A71C7F7695F3262372C0172D68/responsive_peak/images/icon_anonymous_message.png)