Skip to content

Commit 60d2ecb

Browse files
committed
[Notification] change the shortcut to update if it existed
1 parent 7628a18 commit 60d2ecb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/api/app/app.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#if defined(OS_WIN)
2929
#include "base/strings/utf_string_conversions.h"
3030
#include "base/files/file_path.h"
31+
#include "base/files/file_util.h"
3132
#include "base/win/shortcut.h"
3233
#include "base/path_service.h"
3334
#include "content/nw/src/common/shell_switches.h"
@@ -162,7 +163,10 @@ void App::Call(Shell* shell,
162163
base::FilePath processPath;
163164
PathService::Get(base::FILE_EXE, &processPath);
164165
props.set_target(processPath);
165-
result->AppendBoolean(base::win::CreateOrUpdateShortcutLink(base::FilePath(path), props, base::win::SHORTCUT_CREATE_ALWAYS));
166+
167+
base::FilePath shortcutPath(path);
168+
result->AppendBoolean(base::win::CreateOrUpdateShortcutLink(shortcutPath, props,
169+
base::PathExists(shortcutPath) ? base::win::SHORTCUT_UPDATE_EXISTING : base::win::SHORTCUT_CREATE_ALWAYS));
166170
#else
167171
result->AppendBoolean(false);
168172
#endif

0 commit comments

Comments
 (0)