nextcloud-desktop/admin/win/tools/NCNavRemove/exe/main.cpp
Andy Scherzinger 49038ade94
docs(reuse): Migrate to SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2025-04-25 17:27:21 +02:00

45 lines
910 B
C++

/*
* SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <windows.h>
#include "utility.h"
#include "SimpleNamedMutex.h"
#include "NavRemoveConstants.h"
#include "../ConfigIni.h"
using namespace NCTools;
int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
_In_opt_ HINSTANCE hPrevInstance,
_In_ LPWSTR lpCmdLine,
_In_ int nCmdShow)
{
UNREFERENCED_PARAMETER(hInstance);
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
UNREFERENCED_PARAMETER(nCmdShow);
// Mutex
SimpleNamedMutex mutex(std::wstring(MUTEX_NAME));
if (!mutex.lock()) {
return 0;
}
// Config
ConfigIni ini;
if (!ini.load()) {
return 1;
}
Utility::removeNavigationPaneEntries(ini.getAppName());
// Release mutex
mutex.unlock();
return 0;
}