Click here to Skip to main content
12,697,545 members (26,390 online)
Click here to Skip to main content
Add your own
alternative version

Stats

136.8K views
248 downloads
36 bookmarked
Posted

All In One Dot Net Deployment

, 3 Mar 2003
Rate this:
Please Sign up or sign in to vote.
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

Share

About the Author


You may also be interested in...

Pro
Pro

Comments and Discussions

 
QuestionProblem when run Setup.exe Pin
Aimica6-Jul-06 15:29
memberAimica6-Jul-06 15:29 
GeneralSetup & Deployment Problem Pin
silkkeng24-Aug-05 15:08
membersilkkeng24-Aug-05 15:08 
GeneralSetup & Deployment Problem Pin
silkkeng24-Aug-05 15:08
membersilkkeng24-Aug-05 15:08 
GeneralCorExeMai Pin
Anonymous24-Aug-03 11:15
sussAnonymous24-Aug-03 11:15 
Generalsmiley Pin
Anonymo8-May-03 1:43
sussAnonymo8-May-03 1:43 
GeneralMerge Modules Pin
mikasa5-Mar-03 9:01
membermikasa5-Mar-03 9:01 
GeneralRe: Merge Modules Pin
Jeff Turner5-Mar-03 12:18
memberJeff Turner5-Mar-03 12:18 
GeneralRe: Merge Modules Pin
Mark Pitman7-Mar-03 10:57
memberMark Pitman7-Mar-03 10:57 
GeneralRe: Merge Modules Pin
Jeff Turner7-Mar-03 14:46
memberJeff Turner7-Mar-03 14:46 
GeneralRe: Merge Modules Pin
Mark Pitman13-Mar-03 6:57
memberMark Pitman13-Mar-03 6:57 
GeneralRe: Merge Modules Pin
savage_beagle10-Jun-03 23:53
membersavage_beagle10-Jun-03 23:53 
GeneralRe: Merge Modules Pin
Jeff Turner11-Jun-03 5:10
memberJeff Turner11-Jun-03 5:10 
GeneralRe: Merge Modules Pin
Casp12-Mar-03 6:19
memberCasp12-Mar-03 6:19 
GeneralRe: Merge Modules Pin
Jeff Turner26-Jan-04 12:30
memberJeff Turner26-Jan-04 12:30 
GeneralMSDE Pin
erymuzuan4-Mar-03 19:33
membererymuzuan4-Mar-03 19:33 
GeneralRe: MSDE Pin
Jeff Turner5-Mar-03 7:32
memberJeff Turner5-Mar-03 7: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.

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