Click here to Skip to main content
15,885,032 members
Articles / Programming Languages / Visual Basic
Article

All In One Dot Net Deployment

Rate me:
Please Sign up or sign in to vote.
3.05/5 (16 votes)
3 Mar 20033 min read 151.8K   327   36   16
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



Comments and Discussions

 
QuestionProblem when run Setup.exe Pin
Aimica6-Jul-06 14:29
Aimica6-Jul-06 14:29 
GeneralSetup & Deployment Problem Pin
silkkeng24-Aug-05 14:08
silkkeng24-Aug-05 14:08 
GeneralSetup & Deployment Problem Pin
silkkeng24-Aug-05 14:08
silkkeng24-Aug-05 14:08 
GeneralCorExeMai Pin
Anonymous24-Aug-03 10:15
Anonymous24-Aug-03 10:15 
Generalsmiley Pin
Anonymo8-May-03 0:43
Anonymo8-May-03 0:43 
GeneralMerge Modules Pin
mikasa5-Mar-03 8:01
mikasa5-Mar-03 8:01 
GeneralRe: Merge Modules Pin
Jeff Turner5-Mar-03 11:18
Jeff Turner5-Mar-03 11:18 
GeneralRe: Merge Modules Pin
Mark Pitman7-Mar-03 9:57
Mark Pitman7-Mar-03 9:57 
GeneralRe: Merge Modules Pin
Jeff Turner7-Mar-03 13:46
Jeff Turner7-Mar-03 13:46 
GeneralRe: Merge Modules Pin
Mark Pitman13-Mar-03 5:57
Mark Pitman13-Mar-03 5:57 
GeneralRe: Merge Modules Pin
savage_beagle10-Jun-03 22:53
savage_beagle10-Jun-03 22:53 
GeneralRe: Merge Modules Pin
Jeff Turner11-Jun-03 4:10
Jeff Turner11-Jun-03 4:10 
GeneralRe: Merge Modules Pin
Casp12-Mar-03 5:19
Casp12-Mar-03 5:19 
GeneralRe: Merge Modules Pin
Jeff Turner26-Jan-04 11:30
Jeff Turner26-Jan-04 11:30 
GeneralMSDE Pin
erymuzuan4-Mar-03 18:33
erymuzuan4-Mar-03 18:33 
GeneralRe: MSDE Pin
Jeff Turner5-Mar-03 6:32
Jeff Turner5-Mar-03 6:32 

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

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