Fog Creek Software
Discussion Board




Welcome! and rules

Joel on Software

.NET deployment

So I'm thinking of writing a shrinkwrap desktop app in .NET -- my first .NET app, actually.  I don't expect to do online delivery (I may make it available as an option, but the target market is government and nonprofit social service agencies, which tend toward the lower end of the tech-savviness spectrum).

Assuming that none (or close to none) of the users will have the .NET runtime, how difficult is it to deliver a .NET app on CD?  Can a single setup program install the .NET runtime, copy the files over, and create shortcuts?  Is there somewhere in the VS.NET online help where I should go to RTFM?  (=

Sam Gray
Friday, January 10, 2003

Not hard. A single app can do it all.

However - not easy to do using just the tools in the VS.NET package. The issue is that the setups it builds themselves have a runtime dependency on the Framework. So there's a chicken and egg problem.

With a more professional tool, such as InstallShield Express (or Developer), you can bootstrap everything, including the Installer and the Framework, from a single setup.

Mike Gunderloy
Friday, January 10, 2003

I have a somewhat related question: if a .Net program uses "old" ActiveX controls, what do you need to install
on the target machine (in addition to the .Net Framework and the executable) ?

More specifically, my C# app uses the WebBrowser control.  In addition to the executable, there are two files created by the compiler: Interop.SHDocVw.dll and AxInterop.SHDocVw.dll - so, do I need to copy them both ?
(I did, and it all works just fine).

Mike
Friday, January 17, 2003

Yes, as well as the Interop assemblies you will need the actual ActiveX/COM components also.

Duncan Smart
Sunday, January 19, 2003

Yes, of course the control DLL should be there, no questions about it (in my case, the web browser control
already was there).

As for the interop dlls, why are there two of them ?

Mike
Monday, January 20, 2003

The AxInterop one contains the "ActiveX" hostable control (i.e. the control you drag and drop onto a form) whereas the plain old Interop one contains the "OLE automation" server stuff (i.e. you can instantiate and automate an IE window). You will need both.

Top Tip: with those methods with lots of optional parameters... which aren't actually optional in C#, use "System.Reflection.Missing.Value" e.g.:
  browser.Navigate("http://...", Missing.Value, Missing.Value, Missing.Value, Missing.Value)

In addition, if you want to navigate into the DOM of the hosted document import "Microsoft HTML Object Library (MSHTML.TLB)" which get you interfaces such as mshtml.HTMLDocument, mshtml.HTMLParaElement etc... e.g.
  using mshtml;
  ...
    HTMLDocument doc = (HTMLDocument)browser.Document;
    string html = doc.body.innerHTML;

Duncan Smart
Monday, January 20, 2003

Yes, I know about the DOM, but thanks anyway. As for the
missing value, is it faster/better than using  ref(nullObject),
where nullObject is defined as

Object nullObject = 0;

Speaking of the web browser control, it really sucks that you cannot handle its events in C# (I am talking about things like OnBeforeNavigate, NavigateComplete, etc.). Supposedly this will be  fixed in the next release of the framework.

Mike
Wednesday, January 22, 2003

*  Recent Topics

*  Fog Creek Home