feat: add workingDirectory option to shell.openExternal() (#15065)

Allows passing `workingDirectory` to the underlying `ShellExecuteW` API on Windows.

the motivation is that by default `ShellExecute` would use the current working directory, which would get locked on Windows and can prevent autoUpdater from working correctly. We need to be able specify a different `workingDirectory` to prevent this situation.
This commit is contained in:
Milan Burda 2018-10-10 22:46:54 +02:00 committed by Alexey Kuzmin
parent 2d186cb31a
commit a9475f3590
7 changed files with 42 additions and 35 deletions

View file

@ -80,7 +80,7 @@ bool OpenItem(const base::FilePath& full_path) {
return XDGOpen(full_path.value(), false);
}
bool OpenExternal(const GURL& url, bool activate) {
bool OpenExternal(const GURL& url, const OpenExternalOptions& options) {
// Don't wait for exit, since we don't want to wait for the browser/email
// client window to close before returning
if (url.SchemeIs("mailto"))
@ -90,10 +90,10 @@ bool OpenExternal(const GURL& url, bool activate) {
}
void OpenExternal(const GURL& url,
bool activate,
const OpenExternalOptions& options,
const OpenExternalCallback& callback) {
// TODO(gabriel): Implement async open if callback is specified
callback.Run(OpenExternal(url, activate) ? "" : "Failed to open");
callback.Run(OpenExternal(url, options) ? "" : "Failed to open");
}
bool MoveItemToTrash(const base::FilePath& full_path) {