PDA

View Full Version : Use Product Launch Conditions before .Net Install



andye54494
04-11-2002, 09:27 AM
When I add .Net support to my project, the .Net installer runs before my product launch conditions are enforced. How can I get my launch conditions to be enforced first?

Art Middlekauff
04-23-2002, 02:06 PM
The .NET installer is a single executable from Microsoft that installs MSI 2.0 and then installs the .NET Framework. It is thus not well suited to be called from within an MSI package as a custom action. That is why our setup.exe installs the .NET Framework first.

In Developer 7.03, you have the option to prompt the end user to ask if he or she actually wants to install the .NET Framework before setup.exe installs it.

We may be able to add a few additional conditions on the installation of the .NET Framework. What kind of conditions did you have in mind? Or do you have any other suggestions?

andye54494
04-23-2002, 02:11 PM
The main conditions we are looking for are the minimum requirements for .Net on Windows 2000, which is:Windows 2000 Service Pack2.

This check is not being done right now by the .Net installer. What happens is that .Net actually installs, but it's kinda hosed. We would like to prevent this situation from happening for our customers.

Art Middlekauff
04-23-2002, 02:12 PM
Would you like setup.exe to silently skip installing the .NET Framework when it sees that the system requiremenets are not met? Or should it give some error to the user? Or an option to continue?

andye54494
04-23-2002, 02:16 PM
It should just stop installing in this case. Our product will not even install correctly without .NET as most of the custom actions are written in .NET. None of the product features work without .NET being installed either.

The user should just get a message that states something like "Service Pack 2 or greater is required for installing this product on Windows 2000"

Art Middlekauff
04-24-2002, 03:17 PM
Please see http://msdn.microsoft.com/downloads/default.asp?url=/downloads/sample.asp?url=/msdn-files/027/001/829/msdncompositedoc.xml

According to this, SP2 of Windows 2000 is recommended but not required. So we do not check for this. We have been able to install the .NET Framework on a vanilla Windows 2000 machine.

Starting with Developer 7.04, or sooner if you download the .NET Framework from the web, the .NET install piece will give this error message:

Setup requires Windows 98 (or later version), or Windows NT 4.0 Service Pack 6a (or later version) with Microsoft(R) Internet Explorer 5.01 (or later version).

Could you provide documentation that we should also include SP2 of Windows 2000 as a requirement?

andye54494
04-24-2002, 04:51 PM
According to the Release Notes for .Net, published on Microsoft's website at http://support.microsoft.com/default.aspx?xmlid=fh;EN-US;netframewk , Windows 2000 with the latest service pack is a requirement. Here's a snippet from that page.



System Requirements
The .NET Framework SDK is supported on the following platforms with a minimum of Microsoft Internet Explorer 5.01 (Internet Explorer 6.0 is available on the installation CD):

Microsoft Windows 2000 with the latest Windows service pack and critical updates available from http://www.microsoft.com/security

Now I am aware that the .NET framework will install without Service Pack 2, but our application requires Service Pack 2. We know of certain things, such as TRIPLE-DES encryption that do not work without Service Pack 2.

It would be nice if we could have the option of telling the user that they need Service Pack 2 before they install .NET. It's possible that it would work to install .Net first and then stop the customer from installing anything else until they install Service Pack 2, but I'm not sure if that will break anything in .NET.

If someone at Microsoft could confirm that you can install Service Pack 2 over .Net without any problems, I would be OK with that solution.

Thanks

Andy

bmorgan
04-25-2002, 11:05 AM
I had a similar situation. Most of the customers of the software that my company develops, do not have internet connections, and many of the computers are 98FE, 98SE, and NT4. In my case I decided that the solution would be to not include the .NET install that is provided with IS, and to code it into the "OnFirstUIBefore" using the downloadable "dotnetfx.exe. As most of these computers have older versions of IE, I first detect their version of IE and then upgrade their version to 6 if they do not have 5.01 or higher on their system. Once I have their IE upgraded, I then check for the existence of .NET on their system. If it does not exist, I then install .NET.

I have to check for many other things as well for other features of our software and install them if necessary. This bloats my cd, but I do not know of any other way of doing it.

I hope this helps with your situation.

andye54494
04-25-2002, 11:30 AM
Do you have any examples or references you can point me to on doing what you did with the "OnFirstUIBefore". I am pretty new to InstallShield.

Thanks

Andy Elmhorst

bmorgan
04-25-2002, 12:31 PM
Hey Andy

I am new to this too, so I may not do things the most efficient way, and I do not have any reference material to referr to. Anyway here is the code that I used. All of this goes right before "Dlg_SdWelcome:".

function OnFirstUIBefore()
NUMBER nReserved, nOperation, nType, nCompareVal, nResult, nSetupType, nvSize, nUser, nNetFramework, nDefault, nAcrobat;
STRING szDir, szJet, szFileName, szOption1, szTitle, szMsg, szQuestion, szFile, szLicenseFile, szAcrobat, szDotNet;
STRING svDir, svVersion, svPath, svResult, svName, svCompany;
LIST list, listStartCopy;
BOOL bCustom, bIEError, bOpt1;

begin
// TO DO: if you want to enable background, window title, and caption bar title
// SetTitle( @PRODUCT_NAME, 24, WHITE );
// SetTitle( @PRODUCT_NAME, 0, BACKGROUNDCAPTION );
Enable( FULLWINDOWMODE );
Enable( BACKGROUND );
PlaceWindow (MMEDIA_AVI, 10, 10, UPPER_LEFT);
szFileName = INSTALLDIR ^ "\\promo.avi";
PlayMMedia (MMEDIA_AVI, szFileName, MMEDIA_PLAYASYNCH | MMEDIA_PLAYCONTINUOUS, 0);
SetColor(BACKGROUND,RGB (0, 99, 126));

SHELL_OBJECT_FOLDER = @PRODUCT_NAME;

// set the root key
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);

//initialize variables
nSetupType = TYPICAL;
szQuestion = "If you do not install .NET Framework, this installation will abort. " +
"Are you sure that you want to abort this installation?";
szDotNet = SourceDir ^ "\\dotnetfx.exe";
LongPathToQuote(szDotNet, TRUE);
szAcrobat = SRCDIR ^ "\\ar405eng.exe";
LongPathToQuote(szAcrobat, TRUE);
szJet = SRCDIR ^ "\\Jet40Sp3_Comp.exe";
LongPathToQuote(szJet, TRUE);
nAcrobat = RegDBKeyExist("Software\\adobe\\Acrobat Reader");
nNetFramework = RegDBKeyExist("Software\\Microsoft\\.NETFramework");


if (!MAINTENANCE) then
if (Is( FILE_EXISTS, FOLDER_STARTUP ^ "TempSetupShortcut.lnk" ) = TRUE)
then
DeleteFile ( FOLDER_STARTUP ^ "TempSetupShortcut.lnk" );
endif;

bIEError = FALSE;

if ( VerGetFileVersion(WINSYSDIR ^ "Shdocvw.dll", svVersion) != 0 )
then
bIEError = TRUE;
else
nCompareVal = VerCompare(svVersion, "5.50.4134.0599",
VERSION);
endif;
if nCompareVal = LESS_THAN then
bIEError = TRUE;
endif;
endif;

if bIEError then
MessageBox("You are Currently using Internet Explorer Version " + svVersion + ", You must upgrade to Internet Explorer 6.0 to run this software. Click OK to install Internet Explorer 6.0", INFORMATION);
SdShowMsg("Launching Internet Explorer 6.0 setup",TRUE);
// Delay for 3 seconds.
Delay (3);
Enable(HOURGLASS);
SdShowMsg("Launching Internet Explorer 6.0 setup",FALSE);
Disable(HOURGLASS);
LaunchAppAndWait ( SourceDir ^ "\\IE\\i386\\en\\ie6\\ie6setup.exe", "" , WAIT );
AddFolderIcon ( FOLDER_STARTUP , "TempSetupShortcut" , SourceDir + "setup.exe", svPath , "" , 0 , "" , REPLACE );
RebootDialog ( "Please Reboot" , "This project needs to reboot in order to continue. Please save all open documents, close all running applications, and press OK to Reboot." , SYS_BOOTMACHINE );
exit;
endif;

// if .NET Framework not installed, ask user to install.
if (nNetFramework < 0) then
MessageBox("Your system does not have .NET Framework installed. For this software " +
"to run properly, you will need to install .NET Framework on your system. ", SEVERE);
endif;

// if select is no for .NET Framework, warn user that this is required.
while (nNetFramework < 0)
LaunchAppAndWait ( szDotNet, "" , WAIT );
nNetFramework = RegDBKeyExist("Software\\Microsoft\\.NETFramework");
if (nNetFramework < 0) then
while AskYesNo ( szQuestion, nDefault );
exit;
endwhile;
endif;
endwhile;

// if OS is WIN 98 First Edition, or Win NT then install Jet40Sp3_Comp
nCompareVal = VerCompare(svVersion, "4.10.2222A",VERSION);
if (SYSINFO.WIN9X.bWin98) then
if nCompareVal = LESS_THAN then
MessageBox("Installing a necessary component needed by Windows 98 First Edition,",INFORMATION);
LaunchAppAndWait ( szJet, "" , WAIT );
endif;
endif;
if (SYSINFO.WINNT.bWinNT4) then
MessageBox("Installing a necessary component needed by Windows NT4,",INFORMATION);
LaunchAppAndWait ( szJet, "" , WAIT );
endif;

// if Adobe Acrobat does not exist, give user option to install.
if (nAcrobat < 0) then
if (AskYesNo("You do not have Adobe Acrobat Reader installed on your computer. " +
"To be able to view MSDS files in PaintLogic, you will need to install this " +
"software. Would you like to install Acrobat Reader now?", YES) = YES) then
LaunchAppAndWait(szAcrobat, "/SMS",WAIT);
endif;
endif;


I hope that you will find this helpfull. Also, if anyone else sees anything in this code that I could optimize, feel free to make suggestions.

Thanks

Bob

Ashari
05-07-2002, 04:39 PM
Originally posted by Art Middlekauff
Would you like setup.exe to silently skip installing the .NET Framework when it sees that the system requiremenets are not met? Or should it give some error to the user? Or an option to continue?

I actually would like to be able to check programmatically for the user clicking on "No" on the .NET installer question (in 7.03), so that I can do some follow up work. Is this currently possible?

TIA,
-Steven

jgeurts
05-29-2002, 11:45 AM
Originally posted by Art Middlekauff
We may be able to add a few additional conditions on the installation of the .NET Framework. What kind of conditions did you have in mind? Or do you have any other suggestions?


I would like to see an option to check to see which version of the .net framework is installed (sp1, sp2, v2.0, etc) and allow the option install based off that. I have looked through the registry at the key: \\hkey_local_machine\software\microsoft\.netframework\policy\v1.0

but that key doesn't change after upgrading to sp1. If anyone knows how this can be accomplished, I'm all ears...

andye54494
05-29-2002, 12:01 PM
When you upgrade to a new version of .NET (Including SP1) , the version number on some of the .NET dlls changes. Microsoft recommends in this KnowledgeBase article ( Q318785) (http://support.microsoft.com/directory/article.asp?ID=kb;en-us;Q318785) to check the version of %windows%\Microsoft.NET\Framework\v1.0.3705\Mscorcfg.dll. If you don't have SP1 installed, it's version is 1.0.3705.0. With SP1, it is 1.0.3705.209.

For a major version release of .NET, Microsoft will create a new folder under %windows%\Microsoft.NET\Framework with a complete new install of .NET so that the old and new versions can run side-by-side.

jgeurts
05-29-2002, 01:18 PM
Originally posted by andye54494
When you upgrade to a new version of .NET (Including SP1) , the version number on some of the .NET dlls changes. Microsoft recommends in this KnowledgeBase article ( Q318785) (http://support.microsoft.com/directory/article.asp?ID=kb;en-us;Q318785) to check the version of %windows%\Microsoft.NET\Framework\v1.0.3705\Mscorcfg.dll. If you don't have SP1 installed, it's version is 1.0.3705.0. With SP1, it is 1.0.3705.209.

For a major version release of .NET, Microsoft will create a new folder under %windows%\Microsoft.NET\Framework with a complete new install of .NET so that the old and new versions can run side-by-side.

Is there any way for IS to get the version though? I would really like an api call, command-line based solution, or something simpler... any thoughts?

singletd
06-24-2002, 09:37 AM
To retrieve a file version using IS, try the InstallShield function VerGetFileVersion.

Hope this helps.

FazalAbbas
07-25-2002, 11:20 AM
The discussion on the original topic diverted but am writing in same thread.

When I install .NET application then it also installs microsoft .NET part prior to actual application installation. I'm checking in my script that is it the right version of OS to install my app as per requirement or not. If its not then I stop installation. But the problem is that it leave .NET installation there on machine.

I'm using 7.2 and dont want to take risk of upgrading at this stage of project to 7.3 or 7.4.

Question is that how can I uninstall microsoft .NET core installation if I dont want to continue with application installation.

Thanks

- Abbas

michaelk
06-16-2003, 06:40 AM
Hi,

Is there anyway to add a condition to the install of the .NET Framework? I do not want to install it if the OS is Windows NT. My application is ASP with an add on ASP.NET module.

As ASP.NET is not supported on Windows NT this doesn't get installed so there's no need for the .NET Framework. I don't want to leave this decision to the end user.

Thanks,
Mike.