|
-
September 1st, 2010, 02:13 AM
#1
Installer/uninstaller issue
I have a custom installer that places a program's shortcut on a desktop using the following code sequence:
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();
I should also say that the installer is running elevated.
Now, when the uninstaller runs (also elevated) it attempts to delete the shortcut created above using the following code:
Code:
SHGetSpecialFolderLocation(hWnd, CSIDL_DESKTOPDIRECTORY, &pidl);
SHGetPathFromIDList(pidl, path);
CString pPathLinkTo;
pPathLinkTo = path + LinkName;
DeleteFile(pPathLinkTo);
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.
How do I make uninstaller remove the shortcut from a standard user's desktop too?
Last edited by ahmd; September 1st, 2010 at 02:16 AM.
-
September 1st, 2010, 03:25 AM
#2
Re: Installer/uninstaller issue
I guess you could avoid this problem if you placed the shortcuts in CSIDL_COMMON_DESKTOPDIRECTORY rather than CSIDL_DESKTOPDIRECTORY folder.
Victor Nijegorodov
-
September 1st, 2010, 12:38 PM
#3
Re: Installer/uninstaller issue
 Originally Posted by VictorN
I guess you could avoid this problem if you placed the shortcuts in CSIDL_COMMON_DESKTOPDIRECTORY rather than CSIDL_DESKTOPDIRECTORY folder.
Victor, unfortunately I cannot change that installer (it's an old version of the software that has to be removed before a new one is installed). So my question is, how do I remove all those shortcuts now?
-
September 1st, 2010, 12:52 PM
#4
Re: Installer/uninstaller issue
Then you can be in trouble!
Try to search for the shortcuts in all subdirectories of C:\Documents and Settings and permanently delete them.
Victor Nijegorodov
-
September 1st, 2010, 01:45 PM
#5
Re: Installer/uninstaller issue
 Originally Posted by VictorN
Then you can be in trouble!
Try to search for the shortcuts in all subdirectories of C:\Documents and Settings and permanently delete them.
Yeah, that's what I thought. Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|