I have a program I’m working on that my company uses internally, but is also sent to vendors. The vendor version will be identical, except that it will be missing some features, and use an installer. I only have to remove 2 lines from an XML file, and it’s good for external use.
Is there some “typical” method to create a project like this without having to maintain separate codebases for each project?
If it makes any difference, program is written in C#, developed using Visual Studio 2010, compiled as a dll, runs on Windows 7.
3
Is there some “typical” method to create a project like this without
having to maintain separate codebases for each project?
More complex approaches (configuration, plugins etc.) have been described. Yet for your relatively simple case you may be better off using a straight forward approach, that is automate what you do manually:
- Maintain one code base
- Add a “config” folder that has /vendor and /internal subdirectories, each one containing the specific XML file to be included in each version.
- Create a build script that accepts -internal or -vendor as a parameter
The build script will then create the shippable software (i.e. the binary plus configuration file) by simply copying the respective XML to the right location.
1
This sounds like a weak approach to including / excluding functionality. All it takes is one customer to backward-engineer your program and figure out which XML elements to add and they have access to the functionality you want to hide.
A better approach is to have a plug-in system, where the software looks for an assembly that includes your extra functionality, but fails gracefully if that assembly isn’t there.
This way you don’t need a separate codebase. You simply install the same software everywhere and your plugin locally.
2
I would have licensing system where based on the Licence you have different modules get loadedactivated.
But the entire code base is always the same.