Sign in to follow this  

[.net] How to deploy .NET framework & your app in ONE .MSI setup file?

This topic is 3035 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a .NET 2.0 application, and I want to have one setup (preferably a .MSI file) that the user can download from my web page and install. Visual Studio 2008 creates a Setup Project for me that makes a .MSI installer, but when I try to run it on a fresh copy of Windows XP with SP2, it complains that the .NET framework is not installed. I've read that deploying .NET is as simply as including a .NET .exe setup file with your application. The problem is I am trying to keep the setup program in one file that the user can download. Is there an elegant way to have my .MSI file download .NET 2.0 from Microsoft.com and install it if it's not already installed?

Share this post


Link to post
Share on other sites
If they're using MSI, and I suspect they are, then no. MSIs can't run at the same time, so a bootstrap EXE of some type is required, and if you're keeping count we're up to three files. I have two solutions, which are essentially pretty similar:
1) Make a self-extracting ZIP file via WinRAR that does everything in the user's temp folder (SlimDX SDK continues to be shipped this way.)
2) Use an InnoSetup installer as the parent bootstrapper, and let it integrate the dependent files into itself.

Share this post


Link to post
Share on other sites
Quote:
Original post by Promit
If they're using MSI, and I suspect they are, then no. MSIs can't run at the same time, so a bootstrap EXE of some type is required, and if you're keeping count we're up to three files. I have two solutions, which are essentially pretty similar:
1) Make a self-extracting ZIP file via WinRAR that does everything in the user's temp folder (SlimDX SDK continues to be shipped this way.)
2) Use an InnoSetup installer as the parent bootstrapper, and let it integrate the dependent files into itself.


I know that installing multiple MSIs at the same time is not supported, but a bootstrapping EXE would require multiple files to be present. I've considered distributing the program as a .zip file, but your self extracting option seems good... I'll try it. I would use Nullsoft Install System (NSIS) or InnoSetup as a last resort for a bootstrapper.

I'll try the self extractor!

Share this post


Link to post
Share on other sites
A bootstrapping exe would usually contain the individual MSI files as embedded resources. It could then simply extract the MSIs and run them one by one (as needed).

That's basically how self-extracting ZIP files work anyway.

Share this post


Link to post
Share on other sites
Quote:
Original post by Codeka
A bootstrapping exe would usually contain the individual MSI files as embedded resources. It could then simply extract the MSIs and run them one by one (as needed).

That's basically how self-extracting ZIP files work anyway.


Wrong.

The bootstrapper that Visual Studio generates for me is one setup.exe file and several other setup .msi files along side that it runs in sequence. The problem is that it doesn't embed them into the main setup.. and I need everything to be installed from one exe... .net, all of the dependencies.

Share this post


Link to post
Share on other sites
Quote:
Original post by andreib
Wrong.

The bootstrapper that Visual Studio generates for me is one setup.exe file and several other setup .msi files along side that it runs in sequence. The problem is that it doesn't embed them into the main setup.. and I need everything to be installed from one exe... .net, all of the dependencies.
Er, I didn't say "the bootstrapper that Visual Studio generates", I said a bootstrapping executable. You can create one yourself that does whatever you like.

Share this post


Link to post
Share on other sites
Quote:
Original post by andreib
Quote:
Original post by Codeka
A bootstrapping exe would usually contain the individual MSI files as embedded resources. It could then simply extract the MSIs and run them one by one (as needed).

That's basically how self-extracting ZIP files work anyway.


Wrong.

The bootstrapper that Visual Studio generates for me is one setup.exe file and several other setup .msi files along side that it runs in sequence. The problem is that it doesn't embed them into the main setup.. and I need everything to be installed from one exe... .net, all of the dependencies.

So you put it all in a self-extracting zip, or even a regular zip. Most extractors will run the setup.exe once it's done extracting.

Share this post


Link to post
Share on other sites
The setup wizard has an option to include the .net install with the delivery.

But, the easiest way is to employ Click once web page and it will install the .net if needed. Or at least we have it setup that way. There's an option in the publish I believe, if not use the setup wizard project and you can check the checkbox for it.

Share this post


Link to post
Share on other sites
yeah, check out clickonce for the most simple deployment method (and auto-update/patch management..).

love it. other than that, you could create your setup exe + msi files, and take f.e. winrar to create a solid archive at highest compression (just for the fun), that runs setup.exe when opening.. done this before, works great.

not the fine way, but it works :)


now i only use clickonce for deployment. on the web, on local servers, even on disks/usb sticks, if needed. awesome it is.

Share this post


Link to post
Share on other sites
I tried ClickOnce once. Tested it for a couple weeks. I found that normal people actually found it more confusing. For the simple reason that its not what they are used too. They have been trained for years on wizard installs and anything else is not 'real' or 'professional'.

Personally, I also find it lacking if you want minute control on how the software is updated and installed. If you want easy uninstall ability, ability for user to customize install and control over updates and download, especially for a commercial product. Then it comes up quite lacking.

Writing an inno script to check user versions, 32 or 64 bit , installing appropriately (writable stuff in {userdocs} ) and pulling required software as needed in as simple a manner as an install can be is fairly simple.

Share this post


Link to post
Share on other sites
Thanks for all the replies people... but I've opted to use Delphi instead of .NET... because the .NET installer is like 22 MB and I don't the use to have to download that because some of them are on a slow connection.

So now I'm using Delphi for the DLL code and Microsoft WiX for the installer.

Share this post


Link to post
Share on other sites

This topic is 3035 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this