views:

825

answers:

2

if i have an application that requires .net 3.0, what is the proper way to make an install file out of it, that will install the application and then install (activate) the .net 3.0? i tried publishing my project through visual studio 2008 (c#) which created the installer and the .net activator, but it didn't work properly on computers other than my own, when the .net 3.0 was not present.

i though i could bundle http://www.microsoft.com/downloads/details.aspx?FamilyID=10CC340B-F857-4A14-83F5-25634C3BF043&displaylang=en with the application, which would download and install .net 3.0 if needed. this could work ok on non-vista systems, but on vista, the redist package reports an error: you must use turn windows features on or off in the control panel to install or configure microsoft .net framework 3.0

A: 

Windows Vista has already .NET Framework 3.0 installed.

Now if you wanted for example to have .NET Framework 3.5 installed you could create a Setup Project and then right click and go to View->Launch Conditions. There will be a .NET Framework launch condition where you can specify the required version of the framework and an URL to download from.

Here's a post about Launch Conditions in a Setup Project.

Darin Dimitrov
but the application does not work if .net 3.0 is disabled in control panel. how can i activate .net 3.0 in vista, through my application/installer?
avance70
What do you mean by ".net 3.0 is disabled in control panel"?
Darin Dimitrov
in vista, go to control panel >> programs and features >> turn windows features on or off >> there deselect windows .net framework 3.0
avance70
I understand. Could you try with Launch Conditions in a Setup Project to see if it works for you?
Darin Dimitrov
thanks, i will try it tomorrow and report if it works.
avance70
there are a few problems: (1) if i just add a setup project it works ok, but it installs .net 3.5 framework, although i need only 3.0; (2) if i go to launch conditions and select 3.0 from the dropdown instead of 3.5, the setup project fails to build.
avance70
it managed to build when i deletead my release and debug folders, but when i tested it on a computer without framework, the .EXE file offered me to install 3.5, but clicking on .MSI file said that 3.0 wasnt present. maybe the problem is in the link in launch conditions: http://go.microsoft.com/fwlink/?LinkId=76617 - (what should be changed to?)
avance70
+1  A: 

The key is to install the .net framework if it is not there - regardless of the OS. Also, just go ahead and install the .Net 3.5 framework if you are going to install one of them.

Anyway, if you are using the built in installer that comes with Visual Studio, this is a real pain in the butt. You would be better off, and saner if you went with a different installer package. Install Shield, Wise, InstallAware will all do it for you. I believe you can also find better guidance on how to do this with Wix and NullSoft Installer.

http://www.improve.dk/blog/2007/06/10/creating-a-dotnet-bootstrapped-installer-using-nsis

http://stackoverflow.com/questions/682805/how-can-i-detect-net-3-5-in-wix

Chris Brandsma
i want to keep the requirements to minimum, for example if i'm installing it on vista, it should only activate 3.0 if it's disabled through the control panel.
avance70