Archive: Get Correct User Dekstop path on uninstall Vista/Win7


Get Correct User Dekstop path on uninstall Vista/Win7
I install

- Program files in the program files folder
- Data in the APPDATA folder (C:\users\user\appdata\roaming\...)
- Shortcut on desktop

this works fine when installing. When uninstalling however, there seems to be no way to get the correct ShellFolderPath (desktop, appdata etc) ... it returns either the admin folder, or the public (all users) folder.

I'm using UAC plugin, RequestExecutionLevel user.
Both calling ${UAC.CallFunctionAsUser} as Call (as admin) don't work.
Have tried UAC::GetShellFolderPath ... doesn't work.
Have tried a console app which returns the vars ... doesn't work.
Have tried method of passing parameters through user/admin process ... doesn't work.

I'm searching for this for 2 days now and I'm about to loose it. :-)

Can you even do this, and how ?


If you install to programfiles & HKLM, you are doing a all users aka machine install and your app can be uninstalled by any user with admin rights. You can use http://nsis.sourceforge.net/GetUserS...erFromRegistry to try to clean up, but there is no guarantee that it will succeed. Since Vista+ will force elevation when the uninstaller is started from Add/Remove Programs (When uninstall entry is in HKLM) there is no way for the UAC plugin to have a "user" context.


Originally posted by Anders
Since Vista+ will force elevation when the uninstaller is started from Add/Remove Programs (When uninstall entry is in HKLM) there is no way for the UAC plugin to have a "user" context.
There is a workaround for this, as Anders posted here: http://forums.winamp.com/showthread.php?threadid=277801