Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compile two versions of C# program automatically

Tags:

c#

compilation

I have to make the same program for two different companies (different logo, different name). I would like to have this done automatically when I do a release.

I am thinking to use a resource file or a satellite assembly, but I am not sure how to proceed.

Which way do you think is the best?

Thanks.

EDIT:

  • The differences are only one image and one string.
  • I would like to have everything generated in one click.
  • We might get more clients in the future.
  • I must also add that I use SmartAssembly to merge all my dependencies into one exe file.
like image 486
John Avatar asked May 25 '12 19:05

John


2 Answers

You could create a class library that contains 99% of the code, and then have two projects which each reference the common library with the 1% that differs for each company. Then a build of the whole solution will generate an executable for each company. Use this if the differences between what each company wants is just enough that you need to have [slightly] different code.

Alternatively, you could make the sections that vary dependent on data, not code. In this case, it might mean getting the logo from a file, rather than embedding it in the executable, and having a configuration xml file with the company name. This would allow you to have just a single executable for both companies.

like image 196
Servy Avatar answered Nov 15 '22 08:11

Servy


Resource string in separate assembly would be the easiest distribution.

But honestly, I'd have it be a customization feature. Last thing you want is to maintain everyone's logo changes due to: legal reasons, copywrite cases, whimsical artistic license, etc.

Which is short for.... have them provide a formatted image, and have them assign the company name during installation and store that off in the registry or in a meta file of some type (XML, manifest, etc.)

like image 2
Lee Louviere Avatar answered Nov 15 '22 09:11

Lee Louviere