I have an installer app which is a WinEXE app. And the installation takes around 30 seconds.
As EXE needs arguments, it's recommended to install using Command Prompt or Powershell.
So, when the command is executed, immediately console is available to execute the next command because it didn't till the previous command execution was completed successfully.
As it's a silent installation user will be confused about what's happening in the background and would more likely execute the installation command again.
Other than manually adding a condition in code if EXE is already running, is there any other option available to handle this scenario?
This is reproducible with any sample code.
static void Main(string[] args)
{
for (int i = 0; i < 15; i++)
{
Console.WriteLine(i);
Thread.Sleep(1000);
}
Console.WriteLine("Done!!!");
}
Note : The logs won't be shown for WinEXE. To understand more, it can be converted to Console APP where logs would be shown and it would wait as well.
The app output type is "Windows Application". Please check it in project properties.
The framework is .NET Framework 4.6.1
Assuming the EXE name was MyApp.exe, the command used to execute is -
Command Prompt: MyApp.exe Argument1 Argument2
Powershell: .\MyApp.exe Argument1 Argument2