Click here to Skip to main content
15,789,698 members
Please Sign up or sign in to vote.
4.29/5 (5 votes)
See more:
I am working on a program that will be distributed on a USB stick (thumbdrive, flashdrive, whatever they're called these days). It's a critical application and must be up and running within 2 minutes of putting the drive in the machine. Unfortunately, the 2 minute requirement didn't get to me until late (yeah, I know.... but let's talk about the programming, not the project management ;-) ).

I timed the installation of .NET 2.0 in a virtual machine today and it took about 8-10 minutes for it to install. My client's not gonna go for that. So I'm wondering if I can just copy all the DLLs that are referenced in my program to the ouput location and distribute those with the application? If not, is there some way I can build a .NET installer that installs only the stuff I've actually used?

I was watching the .NET installation and there's a lot of stuff in there that I just don't use in my program. Any hints you can give would be greatly appreciated.
Updated 19-Dec-10 6:42am

I don't think it can be done. Even if you copy all the registry settings and files and manage to register it all in a new machine in a small time, you still risk having something which won't work properly, and the cost of keeping this "custom installer" updated would be big.

The best way to get that result is not using .NET (or any similar framework), so you can build a standalone executable and have it up and running in seconds. However, since I guess your app is already developed and it would be too expensive to re-build it from scratch, the other options might be using a virtual machine. You can set up a virtual machine with the operating system, .NET and your app installed and configured.

But still you would have to install vmware - unless you demand it to be installed on all machines before you setup your app. But in this case, you can simply demand that .NET is installed prior to using your app, it shouldn't be too much of a problem. I think this is the best way to solve your problem without dropping .NET. Good luck. :)
Share this answer
You might want to look into an option where the framework elements you need are compiled into your application. These are generally fairly expensive though, but they might be just what you want. Take a look at things like Thinstall[^] or Xenocode[^].
Share this answer
Sandeep Mewara 19-Dec-10 11:46am    
There was some UI alignment issue because of some recent change in CP. Modified the answer to correct the UI.
Pete O'Hanlon 19-Dec-10 14:58pm    
Thanks Sandeep.

Hmm, I like what others have posted, but here are some other options you may want to consider:

  1. Mono is an open source and cross platform implementation of .Net. Mind you, though, that it doesn't have everything .Net has, such as WPF. It also has a bunch of bugs (or did last time I looked at it). I think you can compile your project with .Net and then use it on a computer that has Mono installed. You might look into installation times for Mono to see if they are any better than Microsoft's .Net Framework install times.
  2. There is something called the ".Net Compact Framework". It is a subset of the bigger .Net Framework, and so is smaller (i.e., it would have a shorter install time). If you only need the functionality provided by the .Net Compact Framework, then maybe you can use that instead. Not sure how to make the client computer install it though. Maybe you can set all your projects (in Visual Studio project settings) to use .Net CF? I'm not sure of the details, but that is at least one option you can look into.
Share this answer
I believe Remotesoft Salamander[^] will do what you're asking. A warning though, it's pretty expensive at $1249 US.
Share this answer
You could consider using the .net client profile. It's a slimmed down version of the .net framework that comes with most of the general stuff of client apps, but none of the server stuff (like I haven't timed it, but I presume it would install quicker.

Unfortunately 3.5 client profile is pretty rubbish and comes with a load of caveats. (Like you have to use the web installer, and it will default back to the full fat version if it detects any other .net on the PC already, and is for 32bit OSes only).

If you can hang on until 4.0, the 4.0 client profile looks to be much better. It will have a re-distributable download, and won't fall back to the full thing. Check out the table titled "Enhancement in 4.0 Client Profile vs. 3.5 SP1 Client profile:" in this blog post[^].

(For more info on the 3.5 client profile deployment - see here[^])
Share this answer
You could try to use the CrossNet[^] compiler. To quote from their site;

It parses .NET assemblies and generates unmanaged C++ code that can be compiled on any standard C++ compiler.
Share this answer
Use NET Compact Framework
The .NET Compact Framework constitutes the environment in which managed applications run on devices. It provides access to the underlying features of the device.
Share this answer
I know the post is very earlier, but just want to share that, you can use the .Net Framework Client Profile option. It may help you.
Share this answer
I suspect it would be possible, but it is most likely MS will have done several things to stop people from simply doing this.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900