Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Distributing a C# application

Status
Not open for further replies.

Mike Lewis

Programmer
Jan 10, 2003
17,516
Scotland
I am completely new to C#, so please bear with me. I have downloaded C# Express and have proudly created a nice little HelloWorld.EXE.

My question is: If I wanted to distribute this masterpiece to other users, what runtime files or other components would I need to distribute?

For example, does the user need the .Net framework? If so, how can I check if they have it? Can I distribute it myself, or should I just tell 'em to download it from Microsoft?

I know these are basic questions, but I can't find any information on this point anywhere else.

Thanks in advance.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
mikelewis said:
what runtime files or other components would I need to distribute?
helloworld.exe, any associated assemblies and resources (examples .config, .jpg, .resx)

mikelewis said:
does the user need the .Net framework
yes. if you create an install package (not sure if it's avialable in c# express) you can include the .net framework. otherwise they can download it.

in it's simplest form you can copy/paste exes onto a coputer, double click and it's running. this is probally the case with your hello world app.
it could also be a complex install process creating directories, shortcuts, registry keys etc. this requires an installer package.

i believe there is code to determine if the .net framework is installed. however this must be done durning installation (can't use copy/paste) since you can't use .net to check for .net.
chicken & egg scenario.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Hi Jason,

Thanks for your helpful reply.

In this case, I just have a simple EXE file to distribute. I can see that I can just copy this to a PC that already has the .NET framework, and it works fine. But it won't run if the framework isn't yet installed.

I've now discovered something called the .NET Bootstrap Loader which seems to be what I want. (It tests for the presence of the framework, and installs it if is missing.)

What I now need to figure out is how to create an install package which includes the loader. I can't see any obvious way of doing that in C# Express.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
i'm not fimilar with the Express version. With Professional there is an install project type which adds the components.

I haven't used it though. I use xcopy to deploy.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Jason,

The install project type doesn't seem to be present in the Express version. I guess that's not too big a problem. I can always use InstallShield or Inno Setup to create an install set.

That said, I wonder if I can download other project types -- other than those that come with C# Express. I see there is a link (in the New Project window) to "Search Online Templates", but that only takes me to a Help page, with a message saying there's Help topics to display.

It's all a bit confusing at the moment, but no doubt it'll fall into place.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
I know the Express versions are a subset of the full functionality of the $$$ suites. It may be that Express doesn't offer this feature.

I know plug-ins are not suppose to work with express. and I think solutions are limited to single projects. (or you can't create isolated dlls.)

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Jason,

That makes sense.

Right now, I'm only using Express to help me decide if I want to go further with C#. If I do, I'll shell out for the full product.

So far, I really like what I see. My main development tool is Visual FoxPro, which has a fantastic development environment. C# looks to be at least as good in most areas, and perhaps even better in some.

My main reason for looking for a new language is because I want to create small command-line utilities that people can download from a web site. FoxPro has too much overhead for that. I was hoping I could just offer a small EXE for download, but the need to distribute the full framework puts the kibosh on that. Still, I'll carry on with my learning for the time being.

Thanks very much for your input. I'm sure to be stopping by here again as the need arises.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Using the publishing wizard in C# express (haven't used express in a while, but pretty sure it was still under Build --> Publish ) I was able to create a small installer file that I emailed to people.

I don't have any computers without the framework installed, but one of my friends (still running windows 2000 at my old work at the time) told me that it automagically tried to to download the framework from the internet for him. So if people are downloading your app from a web site, the installer might know where to go on the internet to get the framework for itself.

Only one way to find out (do you have access to a PC with windows 2000 or earlier?)

Good Luck,

Alex

[small]----signature below----[/small]
I can't compete with you physically, and you're no match for my brains.
You're that smart?
Let me put it this way. Have you ever heard of Plato, Aristotle, Socrates?
Yes.
Morons!
 
Alex,

This looks promising.

I just tried Build / Publish HelloWorld. It created a directory full of files, including a SETUP.EXE. When I ran SETUP.EXE on my main computer, it went ahead and installed the executable and put a shortcut in the Start menu, with no prompts or messages of any kind.

I then tried it on a machine that doesn't have the framework installed. First, it prompted me to accept the licence terms for the framework, which was a good sign. Then my firewall kicked it and told me that it wanted to access the Interet. That suggests that it was about to download the framework. I quit at the point, but I will investigate further when I have more time.

Many thanks for your reply.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top