vspacer
 
vspacer
 

Deploying a C# program

 

ByDave Goodall

In order for our newly minted C# program to run, we need to decant onto the client

*The .NET Framework.
*The Common Language Runtime (CLR).
*The C# .exe itself.
*Any supporting files.

The Visual C# IDE offers a special project type called 'Custom Setup' which you can use to generate an install for your C# program. Sounds wonderful...


Generating a Custom Setup

'Custom Setup' is VERY un-intuitive. The SAMS book was essential to figuring it out. Without external instructions you are simply not going to get a 'setup' program built.

The key thing to know about 'Custom Setup' is that this is installation the Microsoft way.

It is not intended to cater to those poor deluded fools who are simple minded enough to expect a 'setup' file you can just click on and go.

Instead, the 'Custom Setup' creates a .msi (Microsoft Installer) file.

Before this can be used you must have installed Microsoft Windows Installer on the client machine.

The .msi file is generated with this warning:

   'This setup does not contain the .NET Framework ,which must be
   installed on the target machine by running dotnetfx.exe before
   this setup will install. You can find dotnetfx.exe on the
   Visual Studio .NET 'Windows Components Update' media.
   Dotnetfx.exe can be redistributed with your setup.'

So essentially using 'Custom setup' immediately creates the requirement for (at least) two pre-requisite setups!

In fact the complete list is

*1. Microsoft Windows Installer.
*2. NT Service Pack 6a or higher. (Mandatory .NET pre-requisite).
*3. MSIE 5.01 or higher. (Mandatory .NET pre-requisite).
*4. MDAC 2.6 or later. (Required if you're doing database access).
*5. WMI 1.5 or later (Optional Windows Management Instrumentation).
*6. The .NET Framework. (dotnetfx.exe)
*7. The .msi file (Which includes by default the CLR but NONE of the above)

Somehow this is all getting slightly less attractive.

Perhaps after all it would be easier just to get the Framework and CLR onto the client, and copy the C# executable onto the client by hand.


   


Back to top | ZDS Home | This article updated September 12, 2002.