2017-08-31 14:37:12 +00:00
|
|
|
// Copyright (c) 2017 GitHub, Inc.
|
|
|
|
// Use of this source code is governed by the MIT license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2019-06-19 20:56:58 +00:00
|
|
|
#ifndef SHELL_BROWSER_UI_COCOA_ATOM_BUNDLE_MOVER_H_
|
|
|
|
#define SHELL_BROWSER_UI_COCOA_ATOM_BUNDLE_MOVER_H_
|
2017-08-31 14:37:12 +00:00
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "native_mate/persistent_dictionary.h"
|
|
|
|
|
2019-06-19 21:23:04 +00:00
|
|
|
namespace electron {
|
2017-08-31 14:37:12 +00:00
|
|
|
|
2019-07-15 16:34:20 +00:00
|
|
|
// Possible bundle movement conflicts
|
|
|
|
enum class BundlerMoverConflictType { EXISTS, EXISTS_AND_RUNNING };
|
|
|
|
|
2017-08-31 14:37:12 +00:00
|
|
|
namespace ui {
|
|
|
|
|
|
|
|
namespace cocoa {
|
|
|
|
|
|
|
|
class AtomBundleMover {
|
|
|
|
public:
|
|
|
|
static bool Move(mate::Arguments* args);
|
|
|
|
static bool IsCurrentAppInApplicationsFolder();
|
|
|
|
|
|
|
|
private:
|
2019-07-15 16:34:20 +00:00
|
|
|
static bool ShouldContinueMove(BundlerMoverConflictType type,
|
|
|
|
mate::Arguments* args);
|
2017-08-31 14:37:12 +00:00
|
|
|
static bool IsInApplicationsFolder(NSString* bundlePath);
|
|
|
|
static NSString* ContainingDiskImageDevice(NSString* bundlePath);
|
|
|
|
static void Relaunch(NSString* destinationPath);
|
|
|
|
static NSString* ShellQuotedString(NSString* string);
|
|
|
|
static bool CopyBundle(NSString* srcPath, NSString* dstPath);
|
2018-04-18 01:44:10 +00:00
|
|
|
static bool AuthorizedInstall(NSString* srcPath,
|
|
|
|
NSString* dstPath,
|
2017-08-31 14:37:12 +00:00
|
|
|
bool* canceled);
|
|
|
|
static bool IsApplicationAtPathRunning(NSString* bundlePath);
|
|
|
|
static bool DeleteOrTrash(NSString* path);
|
|
|
|
static bool Trash(NSString* path);
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace cocoa
|
|
|
|
|
|
|
|
} // namespace ui
|
|
|
|
|
2019-06-19 21:23:04 +00:00
|
|
|
} // namespace electron
|
2017-08-31 14:37:12 +00:00
|
|
|
|
2019-06-19 20:56:58 +00:00
|
|
|
#endif // SHELL_BROWSER_UI_COCOA_ATOM_BUNDLE_MOVER_H_
|