Skip to content

Commit

Permalink
fix: skip IsFirstRun when both GetLaunchOn[Startup/Exit] are empty
Browse files Browse the repository at this point in the history
This is made to avoid unnecessary operations and mitigate potential issues in creating mutex
  • Loading branch information
Bush2021 committed Nov 13, 2024
1 parent 3476575 commit e9529c7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/portable.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ std::wstring GetCommand(LPWSTR param) {
}

bool IsFirstRun() {
if (GetLaunchOnStartup().empty() && GetLaunchOnExit().empty()) {
return false;
}
HANDLE hMutex =
CreateMutexW(nullptr, TRUE, L"Global\\ChromePlusFirstRunMutex");
if (hMutex == nullptr || GetLastError() == ERROR_ALREADY_EXISTS) {
Expand Down

0 comments on commit e9529c7

Please sign in to comment.