Without knowing more the only way I could really suggest, is that you have app1.exe run and then depending on the configuration flags use either a case statment to determine the executable to run:
int configFlag = 1; switch (configFlaf) { case 1: process.start("app2.exe"); break; case 2: Console.WriteLine("app3.exe"); break; default: Console.WriteLine("Invalid Config Flag"); break; }
or you could use an if statement:
if(configFlag1 && configFlag2) process.start("app2.exe") else process.start("app3.exe");
If you provide more information I'll gladly put some more information and detail into this explanation.
Expansion on your update 1 information The only way I can see around getting around the missing config issues (especially if the executables aren't going to be in the same folder when deployed) would be to launch app2.exe and app3.exe with an argument of either:
- The directory of the configuration files.
- The working directory of app1.exe
So you would launch app2.exe like so:
process.start("app2.exe", "c:\config\");
or
process.start("app2.exe", Directory.GetCurrentDirectory());
Then in app2.exe:
class app2. { static void Main(string[] args) { if (args.Length > 0")) Environment.CurrentDirectory = (args[0]); } }
You can find more information on using command line arguments here: https://msdn.microsoft.com/en-us/library/aa288457%28v=vs.71%29.aspx