From 09f17698793e2545bd2e13f66c16bc611d765cdb Mon Sep 17 00:00:00 2001 From: fxliang Date: Tue, 11 Jun 2024 18:09:58 +0800 Subject: [PATCH] installer: ensure old ime/dll files deleted by running `WeaselSetup.exe /u` before installing. --- WeaselSetup/imesetup.cpp | 7 ------- output/install.nsi | 2 ++ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/WeaselSetup/imesetup.cpp b/WeaselSetup/imesetup.cpp index f5a7b01f8..e93363b34 100644 --- a/WeaselSetup/imesetup.cpp +++ b/WeaselSetup/imesetup.cpp @@ -234,12 +234,6 @@ int uninstall_ime_file(const std::wstring& ext, if (is_wow64()) { retval += func(imePath, false, true, false, false, silent); PVOID OldValue = NULL; - // PW64DW64FR fnWow64DisableWow64FsRedirection = - // (PW64DW64FR)GetProcAddress(GetModuleHandle(_T("kernel32.dll")), - // "Wow64DisableWow64FsRedirection"); PW64RW64FR - // fnWow64RevertWow64FsRedirection = - // (PW64RW64FR)GetProcAddress(GetModuleHandle(_T("kernel32.dll")), - // "Wow64RevertWow64FsRedirection"); if (Wow64DisableWow64FsRedirection(&OldValue) == FALSE) { MSG_NOT_SILENT_BY_IDS(silent, IDS_STR_ERRCANCELFSREDIRECT, IDS_STR_UNINSTALL_FAILED, MB_ICONERROR | MB_OK); @@ -676,7 +670,6 @@ int uninstall(bool silent) { HKEY hKey; LSTATUS ret = RegOpenKey(HKEY_CURRENT_USER, KEY, &hKey); if (ret == ERROR_SUCCESS) { - WCHAR value[MAX_PATH]; DWORD type = 0; DWORD data = 0; DWORD len = sizeof(data); diff --git a/output/install.nsi b/output/install.nsi index df0eb8b96..8679e2792 100644 --- a/output/install.nsi +++ b/output/install.nsi @@ -287,6 +287,8 @@ program_files: IfErrors +2 0 StrCpy $R2 "/t" + ; ensure old file deleted, avoid IPC issue + ExecWait '"$INSTDIR\WeaselSetup.exe" /u' ExecWait '"$INSTDIR\WeaselSetup.exe" $R2' ; Write the uninstall keys for Windows