Chris Bracken e8b5dd908e [Windows] Set Platform.executable on engine start (flutter/engine#35560)
When setting FlutterProjectArgs.command_line_argv prior to launching the
engine, we were previously setting a placeholder value rather than the
executable name. This resulted in Platform.executable (from dart:io)
returning "placeholder" in application code.

This updates the Windows implementation for consistency with macOS and
guarantees that Platform.executable will return a reasonable value in
Dart code.

Note that this does not affect Platform.resolvedExecutable, which returns
a full, resolved path, and is implemented in the Dart runtime itself.
Previously the code:

   print(Platform.executable);
   print(Platform.resolvedExecutable);

resulted in the following output on Windows:

   flutter: placeholder
   flutter: C:\path\to\project\build\windows\runner\Debug\project.exe

after this patch, it results in:

   flutter: project.exe
   flutter: C:\path\to\project\build\windows\runner\Debug\project.exe

Issue: https://github.com/flutter/flutter/issues/83921
2022-08-20 02:38:49 +01:00
Languages
Dart 75%
C++ 16.5%
Objective-C++ 2.9%
Java 2.8%
Objective-C 0.7%
Other 1.9%