Hello Guys,
We have an application built using Installshield 8.0 where some components require .NET to be installed on the computer so that those services associated with these components work fine when started after installation. As of now during installation, all the components get installed fine but when we try to start these services, it just crashes the computer since this component requires the .NET Framework to be installed on the machine. So I was wondering if there is any way for Installshield to check the presence of .NET on the machine when such components are installed. I wouldn't like to provide the .NET framework installation as part of our setup. All I want to do is check if .NET is present if such components are installed and if not present, then it should warn the user that .NET is not installed on their machines and it should be installed for that component to work.
I will really appreciate it if someone can help me with this.
Thanks,
Nitin
This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Presence of .NET
Started by
nitinp
, Jan 27 2005 19:08
4 replies to this topic
Posted 29 January 2005 - 10:28
Use System Search to read the .NET version from registry, and exit with an error message if it's not found.
Stefan Krüger
InstallSite.org twitter facebook
Posted 31 January 2005 - 17:18
Thanx for your reply Stefan. You have been very helpful as always. I am not sure though about how to use system search to check for .NET information and then to display it in a dialog box. Can you please give me the steps to do it if you can? That would be really very helpful.
Thanx,
Nitin
Thanx,
Nitin
Posted 02 February 2005 - 10:16
Stefan Krüger
InstallSite.org twitter facebook
Posted 18 March 2005 - 14:32
Hi,
You can also use a property --> MsiNetAssemblySupport
With it You get the version number from the Fusion.dll.
This advice is from InstallShield"Adding .Net Framework Support to Installation Projects", InstallShield X
André
An example:
////////////////////////////////////////////////////////////////////////////////
// Function: TEST_Get_DotNetFramework
// Purpose: Shows some .Net Framework information.
//
////////////////////////////////////////////////////////////////////////////////
function TEST_Get_DotNetFramework( hInstall )
STRING sResult, sValue;
NUMBER nResult;
begin
nResult = GEN_Get_Property(hInstall, "MsiNetAssemblySupport", sValue);
sResult = sResult + "\nMsiNetAssemblySupport (Version .Net Framework): " +
sValue;
MessageBox( sResult, INFORMATION );
return 0;
end;
////////////////////////////////////////////////////////////////////////////////
// Function: GEN_Get_Property
// Purpose: Get a value for the property with retrieving the buffer
// and error handling.
////////////////////////////////////////////////////////////////////////////////
function GEN_Get_Property( hInstall, sProperty, sValue )
STRING sEMsg;
NUMBER nBuffer;
NUMBER nResult;
begin
// Prepare message.
sEMsg = "Fct: GEN_Get_Property\n" ;
sEMsg = sEMsg + "\nProperty: " + sProperty;
// First get buffer size.
nBuffer = 0;
sValue = "";
nResult = MsiGetProperty(hInstall, sProperty, sValue, nBuffer);
switch(nResult)
case ERROR_INVALID_HANDLE:
sEMsg = "MyCompany Error:\n" + sEMsg + "\nError: Invalid Handle";
case ERROR_INVALID_PARAMETER:
sEMsg = "MyCompany Error:\n" + sEMsg + "\nError: Invalid Parameter";
case ERROR_SUCCESS:
// OK, now get value.
nResult = MsiGetProperty(hInstall, sProperty, sValue, nBuffer);
switch(nResult)
case ERROR_SUCCESS:
// OK.
//sEMsg = sEMsg + "\nValue: " + sValue;
//MessageBox( sResult, INFORMATION );
return 0;
case ERROR_INVALID_HANDLE:
sEMsg = "MyCompany Error:\n" + sEMsg + "\nError: Invalid Handle";
case ERROR_INVALID_PARAMETER:
sEMsg = "MyCompany Error:\n" + sEMsg + "\nError: Invalid Parameter";
endswitch;
endswitch;
// Error occured.
sEMsg = sEMsg + "\nValue: " + sValue;
MessageBox( sEMsg, INFORMATION );
return -1;
end;
You can also use a property --> MsiNetAssemblySupport
With it You get the version number from the Fusion.dll.
This advice is from InstallShield"Adding .Net Framework Support to Installation Projects", InstallShield X
André
An example:
////////////////////////////////////////////////////////////////////////////////
// Function: TEST_Get_DotNetFramework
// Purpose: Shows some .Net Framework information.
//
////////////////////////////////////////////////////////////////////////////////
function TEST_Get_DotNetFramework( hInstall )
STRING sResult, sValue;
NUMBER nResult;
begin
nResult = GEN_Get_Property(hInstall, "MsiNetAssemblySupport", sValue);
sResult = sResult + "\nMsiNetAssemblySupport (Version .Net Framework): " +
sValue;
MessageBox( sResult, INFORMATION );
return 0;
end;
////////////////////////////////////////////////////////////////////////////////
// Function: GEN_Get_Property
// Purpose: Get a value for the property with retrieving the buffer
// and error handling.
////////////////////////////////////////////////////////////////////////////////
function GEN_Get_Property( hInstall, sProperty, sValue )
STRING sEMsg;
NUMBER nBuffer;
NUMBER nResult;
begin
// Prepare message.
sEMsg = "Fct: GEN_Get_Property\n" ;
sEMsg = sEMsg + "\nProperty: " + sProperty;
// First get buffer size.
nBuffer = 0;
sValue = "";
nResult = MsiGetProperty(hInstall, sProperty, sValue, nBuffer);
switch(nResult)
case ERROR_INVALID_HANDLE:
sEMsg = "MyCompany Error:\n" + sEMsg + "\nError: Invalid Handle";
case ERROR_INVALID_PARAMETER:
sEMsg = "MyCompany Error:\n" + sEMsg + "\nError: Invalid Parameter";
case ERROR_SUCCESS:
// OK, now get value.
nResult = MsiGetProperty(hInstall, sProperty, sValue, nBuffer);
switch(nResult)
case ERROR_SUCCESS:
// OK.
//sEMsg = sEMsg + "\nValue: " + sValue;
//MessageBox( sResult, INFORMATION );
return 0;
case ERROR_INVALID_HANDLE:
sEMsg = "MyCompany Error:\n" + sEMsg + "\nError: Invalid Handle";
case ERROR_INVALID_PARAMETER:
sEMsg = "MyCompany Error:\n" + sEMsg + "\nError: Invalid Parameter";
endswitch;
endswitch;
// Error occured.
sEMsg = sEMsg + "\nValue: " + sValue;
MessageBox( sEMsg, INFORMATION );
return -1;
end;