简体   繁体   中英

Uninstaller doesn't delete copied library to System Folder in VS2010 installer project.

I have a windows desktop application. I am preparing msi using microsoft visual studio 2010 installer project. For my purpose I need to copy a certain DLL into System Folder during installation. When I run my uninstaller after installation is done, it doesn't delete that library from system folder.

Is there a way to accomplish this?

Here is my UnInstaller.cpp

int _tmain(int argc, _TCHAR* argv[])
{
    //WinExec("msiexec.exe /i {B49233F8-814D-432F-BE05-D6BA334A0087}", SW_SHOW);
    WinExec("msiexec.exe /i {050E4942-5DF2-4F46-B6BC-1296761DA4C1}", SW_SHOW);
}

If you ever marked that file's properties in the setup as Permanent or SharedLegacyFile and installed it, then it will not be uninstalled. They are not settings you cam change in the project and expect them to change on the system because the system will have marked them for not uninstalling. If you look in HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\SharedDlls and the path to your file is there, for example, then you have unnecessarily marked it shared.

Windows Installer最佳实践指出,应避免将共享资源安装到Windows /系统文件夹,并且在必须将共享资源标记为永久时。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM