Include .Net Framework in the setup

Fuma

Executive Member
Joined
Jul 9, 2007
Messages
5,378
Reaction score
362
Location
Pretoria
I'm not sure if this has been asked before, but..


I haven't done a .net windows applications in a long time.
I have a windows application using Visual Studio 2005 ready to be deployed.

I want to include the .net framework 2.0 when packaging this application.

How do I achieve this?
I hate installing .net framework seperately.

I searched around on the net but with no success.
 
There was a bootstrapper add-in that you used for VS 2003. I'll see if I can find one for 2005.

Perhaps you could include it as a separate file? See below:
the problem with the framework is that there is a different installer for every language and if you install the wrong locale on a machine it could potentially break many things.

EDIT: Found these links for you:
Using Visual Studio 2005 to Redistribute the .NET Framework 2.0
Use the Visual Studio 2005 Bootstrapper to Kick-Start Your Installation
 
Last edited:
I did this quite a long time ago, but here are some links that might help...

Deploying the .NET Framework in a setup package
ClickOnce Deployment for Windows Forms Applications

Hope it helps ;)

Tx

On the Bootstrapper option I didn't understand step number 4.

  1. On the File menu, click New and then click Project.
  2. In the New Project dialog box, expand Other project types and then click Setup and Deployment.
  3. In the templates list, double-click Setup Project.
  4. Add project output, merge modules, files, and assemblies to the project as needed.
  5. In Solution Explorer, right-click the setup project and then click Properties. The Property pages box will appear.
  6. Click Prerequisites and then select Create setup program to install the prerequisite components.
  7. In Choose which prerequisite to install (for example .NET Framework 2.0, and Windows Installer 3.1).
  8. In Specify the install location for prerequisites, choose the appropriate option for your application.

Edit: I just right-clicked the Setup Project and on the popup menu and chose Add and I could see project output, merge modules, files, and assemblies
I'm just not sure if it will solve my prob. I'll give it a try on an application.
 
Last edited:
The easiest is to follow the guidlines in the MSDN documentation. To create installers with VS2005 is very easy though limited.
 
The easiest is to follow the guidlines in the MSDN documentation. To create installers with VS2005 is very easy though limited.
I have to disagree there. I've created a deployment package for our (web-based) solution that deploys the standard web-pages, creates the database, inserts a script full of data into it, creates a Reporting Services folder and datasource, uploads a whole bunch of reports, registers the app for .NET 2.0, sets the necessary security permissions for Integrated Security and adds some necessary permissions in the Windows WMI Control (for our licensing). Oh, and it deploys a maintenance util (windows forms based), creates the necessary shortcuts and sets a few registry entries. All done with Custom Installer Actions.

Now, the problem was getting it all UNINSTALLED... ;)
 
I have to disagree there. I've created a deployment package for our (web-based) solution that deploys the standard web-pages, creates the database, inserts a script full of data into it, creates a Reporting Services folder and datasource, uploads a whole bunch of reports, registers the app for .NET 2.0, sets the necessary security permissions for Integrated Security and adds some necessary permissions in the Windows WMI Control (for our licensing). Oh, and it deploys a maintenance util (windows forms based), creates the necessary shortcuts and sets a few registry entries. All done with Custom Installer Actions.

Now, the problem was getting it all UNINSTALLED... ;)

And that the reason I said limited. You can achieve what you wanted to do with a Visual Studio Setup and Deployment project, but I won't recommend it.

For a basic installer that doesn't do too much, the Visual Studio Setup and Deployment projects is fine, but as soon as you want to go advanced like what you did buy a tool like InstallShield or go the WiX route. You can do alot more with WIX, but I must say that it has got a steep lurning curve but I am using it for more than a year now, and don't look back. I'm even doing my basic setup project with this. Im not a big fan of VS Setup and Deployment at all.

WIX will also be included in the next release of Visual Studio. Although limited functionality, but it will be in.
 
And that the reason I said limited. You can achieve what you wanted to do with a Visual Studio Setup and Deployment project, but I won't recommend it.

For a basic installer that doesn't do too much, the Visual Studio Setup and Deployment projects is fine, but as soon as you want to go advanced like what you did buy a tool like InstallShield or go the WiX route. You can do alot more with WIX, but I must say that it has got a steep lurning curve but I am using it for more than a year now, and don't look back. I'm even doing my basic setup project with this. Im not a big fan of VS Setup and Deployment at all.

WIX will also be included in the next release of Visual Studio. Although limited functionality, but it will be in.

What about NSIS?

NSIS (Nullsoft Scriptable Install System) is a professional open source system to create Windows installers. It is designed to be as small and flexible as possible and is therefore very suitable for internet distribution.
Free, small, quick, and flexible.
 
..or go the WiX route. You can do alot more with WIX, but I must say that it has got a steep lurning curve but I am using it for more than a year now, and don't look back. I'm even doing my basic setup project with this. Im not a big fan of VS Setup and Deployment at all.

WIX will also be included in the next release of Visual Studio. Although limited functionality, but it will be in.

How do I use WiX?
I downloaded & installed it on my machine. So what now? :)
 
How do I use WiX?
I downloaded & installed it on my machine. So what now? :)
If you downloaded WIX3, project templates should be created so you should be able to create a new WIX project when going to File->New->Project.

The best way to get started with WIX is to have a look at he documentation that is shipped with it and then to have a look at the tutorial online. The tutorial is focused at WIX 2, but you should be able to get started on that.
 
What about NSIS?

Never heard of it. Will have a look at it.

Whats nice about WIX is that its a Micrsoft Product and support for it is really good! I have built quite a bit of installer with it and its stable and works. Intergrates very easily with the build process of .Net projects and that is one of the reasons I will stick with it.
 
Never heard of it. Will have a look at it.

Whats nice about WIX is that its a Micrsoft Product and support for it is really good! I have built quite a bit of installer with it and its stable and works. Intergrates very easily with the build process of .Net projects and that is one of the reasons I will stick with it.
Never heard of it. Will have a look at it. ;)

NSIS is a stable product, tutorials abound, and it is open source.

Both products work - it may well end up as a personal preference.
 
The reason I stick with VS Setup & Deployment projects, is that it integrates nicely with Xenocode. After obfuscating your code with Xenocode, you can dump it all back into a .msi file (created with your S&D project). I'm not trying to hijack the thread now, but Xenocode is by far one of the best code obfuscation utilities around. Well worth the price of admission... :)
 
The reason I stick with VS Setup & Deployment projects, is that it integrates nicely with Xenocode. After obfuscating your code with Xenocode, you can dump it all back into a .msi file (created with your S&D project). I'm not trying to hijack the thread now, but Xenocode is by far one of the best code obfuscation utilities around. Well worth the price of admission... :)
HIJACK ALERT! :p

I just write spaghetti code. Best obfuscation by far. :D Heck, it even confuses me!

[DISCLAIMER]The author was looking for his mind (which had gone wandering) while writing this post, and under no circumstances does the author support bad coding standards.[/DISCLAIMER]
 
Last edited:
HIJACK ALERT! :p

I just write spaghetti code. Best obfuscation by far. :D Heck, it even confuses me!


Do you do it on PURPOSE?! :D Seriously though, Xenocode obfuscates it quite nicely AND adds in spaghetti code... I recommend you give it a try! You can also add it into your build-routine in VS to let it automatically obfuscate the code after a build. It's also very flexible - you can specify which classes, methods or variables to exclude from obfuscation. It even obfuscates string values!
 
The reason I stick with VS Setup & Deployment projects, is that it integrates nicely with Xenocode. After obfuscating your code with Xenocode, you can dump it all back into a .msi file (created with your S&D project). I'm not trying to hijack the thread now, but Xenocode is by far one of the best code obfuscation utilities around. Well worth the price of admission... :)
I like Dotfuscator that ships with Visual Studio because I don't have the money to pay for a more proper obfuscating tool...
 
The problem with Dotfuscator is that it struggles to properly obfuscate complex applications. Our product has a very complex code-base and hence Dotfuscator throws some nice exceptions when trying to obfuscate it. After fiddling with it for a while, I got it to obfuscate, but then we couldn't get the binaries running - MAJOR exceptions abound. We tried several free AND proprietary obfuscation tools, but Xenocode was the only one that was able to handle our solution...
 
I also had problems with Dotfuscator. The better obfuscation I'm performing on the code, then my app starts to through exceptions, so now I'm using the default settings.

I'll have to save the $1500 to get something proper I guess!
 
Top
Sign up to the MyBroadband newsletter
X