Q:

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);
}

A:

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. 

