I have a custom installer that places a program's shortcut on a desktop using the following code sequence:
I should also say that the installer is running elevated.Code:SHGetSpecialFolderLocation(hWnd, CSIDL_DESKTOPDIRECTORY, &pidl); SHGetPathFromIDList(pidl, path); CString pPathLinkTo; pPathLinkTo = path + LinkName; //Use 'path' to create a shortcut IShellLink* psl; CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, reinterpret_cast<void**>(&psl)); psl->SetPath(pPathLinkTo); IPersistFile* ppf; psl->QueryInterface(IID_IPersistFile, reinterpret_cast<void**>(&ppf)); ppf->Save(pSaveLinkTo, TRUE); ppf->Release(); psl->Release();
Now, when the uninstaller runs (also elevated) it attempts to delete the shortcut created above using the following code:
It succeeds and removes the link from the Admin account's desktop, but what it fails to do is to remove the same shortcut from [another] standard user's desktop on the same system. For some reason the installer creates a copy of the shortcut for the standard user as well.Code:SHGetSpecialFolderLocation(hWnd, CSIDL_DESKTOPDIRECTORY, &pidl); SHGetPathFromIDList(pidl, path); CString pPathLinkTo; pPathLinkTo = path + LinkName; DeleteFile(pPathLinkTo);
How do I make uninstaller remove the shortcut from a standard user's desktop too?




Reply With Quote