Click here to Skip to main content
Licence 
First Posted 3 Mar 2003
Views 126,293
Downloads 125
Bookmarked 36 times

All In One Dot Net Deployment

By | 3 Mar 2003 | Article
Installing .NET framework with your application.

Introduction

I recently ran into a problem when it came around to deploying my first .NET application. When you create a MSI setup file, you can't have it install .NET framework with it. I did some research and found that Microsoft does have some C++ code that you can modify to install the .NET framework for you. Me not knowing much C++ code did get it to compile and install .NET framework before the MSI file, but I needed it to do more.

  • Check that the computer had minimum requirements to install the .NET framework.
  • Install ADO 2.7 SP1.
  • Install the .NET Framework SP2.

The Code

So, I fired up the old Visual Studio 6 and started to right a VB .exe to install these programs. I knew most of my audience would have the VB6 run time because there are some applications that most people use on which are systems that were written in VB6.

To make my job a little easier, I looked around for an object that I could use that would detect the OS for me. I found one written by Eswar Santhosh here, which I have asked him if I could include it with my posting.

I then went ahead and grabbed some code snips from Google Groups to read the registry using only API calls. I did this because I wanted to not be dependent on anything besides the VB run time. I also grabbed some code to execute command line strings using the Windows API calls.

I then wrote a series of if statements checking to make sure they were running Windows 98 or above. I checked to make sure they were running IE 5.01 or higher. I checked to make sure that if they were running Windows 2000, that they had SP2 or higher. The last check was if they are running NT4, then they are running SP6.

After that, it was easy to right a couple of statements to execute the install code. To make it all run, you need to have these downloads including the source code for this article.

Go in and create your MSI file. Once that is complete, copy everything it creates (InstMsiA.Exe, InstMsiW.Exe, Setup.Exe, Setup.Ini) into an empty directory. Rename the Setup.exe to MsiSetup.exe. Rename the Setup.ini file to MsiSetup.ini. Now copy the setup.exe file that comes with my source code into the directory. You should now be able to run the setup.exe file and it will install everything you need.

Some extras

I went back after testing the install a couple times and added some code for debugging. I added one flag /T for testing. It will just do the checks and alert you what it would have installed if it were going to run. I also added a display form flag /D so you could see the current status of the install.

Summary

That's about, it I wanted to share it with everyone. I felt there might be other people who were frustrated with this. A couple of things that I want to add are, if it's an earlier version of IE, just upgrade it. This might help the Help Desk people who are going to have to go around to 400+ workstations and install it. The code has not been fully tested on Windows 98 or Windows XP. If you find any problems, please email me.

Thanks for listening to me ramble on.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Jeff Turner

Web Developer

United States United States

Member

I am a 29-year-old programmer now living in San Diego, California. I grew up in Boulder, Colorado, and then went into the USMC right out of high school. Been programming most of my life in basic, so you can say I am a self-taught programmer. For that last 7 years I have been programming using ASP, ASP.Net, VB.Net/VB, C#/C++, and SQL.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
QuestionProblem when run Setup.exe PinmemberAimica14:29 6 Jul '06  
GeneralSetup & Deployment Problem Pinmembersilkkeng14:08 24 Aug '05  
GeneralSetup & Deployment Problem Pinmembersilkkeng14:08 24 Aug '05  
GeneralCorExeMai PinsussAnonymous10:15 24 Aug '03  
Generalsmiley PinsussAnonymo0:43 8 May '03  
GeneralMerge Modules Pinmembermikasa8:01 5 Mar '03  
GeneralRe: Merge Modules PinmemberJeff Turner11:18 5 Mar '03  
GeneralRe: Merge Modules PinmemberMark Pitman9:57 7 Mar '03  
GeneralRe: Merge Modules PinmemberJeff Turner13:46 7 Mar '03  
GeneralRe: Merge Modules PinmemberMark Pitman5:57 13 Mar '03  
GeneralRe: Merge Modules Pinmembersavage_beagle22:53 10 Jun '03  
GeneralRe: Merge Modules PinmemberJeff Turner4:10 11 Jun '03  
GeneralRe: Merge Modules PinmemberCasp5:19 12 Mar '03  
GeneralRe: Merge Modules PinmemberJeff Turner11:30 26 Jan '04  
GeneralMSDE Pinmembererymuzuan18:33 4 Mar '03  
GeneralRe: MSDE PinmemberJeff Turner6:32 5 Mar '03  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web04 | 2.5.120517.1 | Last Updated 4 Mar 2003
Article Copyright 2003 by Jeff Turner
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid