зеркало из https://github.com/nextcloud/desktop.git
WIP: Trying things...
Signed-off-by: Camila Ayres <hello@camilasan.com>
This commit is contained in:
Родитель
b2ce7b38f7
Коммит
256f7f348b
|
@ -49,7 +49,6 @@ HRESULT NCMSIHELPER_API DoExecNsisUninstaller(int argc, LPWSTR *argv)
|
|||
|
||||
// Can't wait for the process because Uninstall.exe (opposed to Setup.exe) immediately returns, so we'll sleep a bit.
|
||||
Utility::waitForNsisUninstaller(appShortName);
|
||||
Utility::removeUsersFromKeychain(appShortName);
|
||||
|
||||
LogResult(S_OK, "Removing the NSIS uninstaller.");
|
||||
|
||||
|
@ -71,6 +70,8 @@ HRESULT NCMSIHELPER_API DoRemoveNavigationPaneEntries(int argc, LPWSTR *argv)
|
|||
|
||||
const auto appName = std::wstring(argv[0]);
|
||||
|
||||
Utility::removeUsersFromKeychain(appName);
|
||||
|
||||
if (appName.empty()) {
|
||||
return HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER);
|
||||
}
|
||||
|
|
|
@ -477,10 +477,12 @@ bool Utility::copy_dir_recursive(std::wstring from_dir, std::wstring to_dir, cop
|
|||
|
||||
void Utility::removeUsersFromKeychain(const std::wstring &appName)
|
||||
{
|
||||
// https://learn.microsoft.com/en-us/windows/win32/api/wincred/nf-wincred-creddeletew
|
||||
// https://github.com/frankosterfeld/qtkeychain/blob/181103549bcda0e4c38988255af64930cfa64ed7/qtkeychain/keychain_win.cpp
|
||||
if (!CredDeleteW(appName.c_str(), CRED_TYPE_GENERIC, 0)) {
|
||||
switch(GetLastError()) {
|
||||
case ERROR_NOT_FOUND:
|
||||
// Password entry not found"
|
||||
// Password entry not found
|
||||
break;
|
||||
default:
|
||||
// Could not decrypt data
|
||||
|
|
Загрузка…
Ссылка в новой задаче