The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Jackal on December 13, 2007, 10:40:40 PM

Title: Vista and RemoveDirectory in StartMenu..
Post by: Jackal on December 13, 2007, 10:40:40 PM
I am creating an uninstall app for my install wizard and almost done. I have run into a problem however. I am able to delete the shortcuts placed in the start menu leaving my start menu folder empty however my remove directory will not work. The code i am using is


        Invoke SHGetSpecialFolderPath, NULL, addr StartMBuff, CSIDL_STARTMENU, 0
        Invoke lstrcat, addr StartMBuff, addr ProgFolder
        Invoke lstrcat, addr StartMBuff, addr StartPathBuff

        Invoke lstrcpy, ADDR Buffer, ADDR StartMBuff
        Invoke lstrcat, addr Buffer, addr szUninstlnk
        Invoke DeleteFile, addr Buffer

        Invoke lstrcpy, ADDR Buffer, ADDR StartMBuff
        Invoke lstrcat, addr Buffer, addr IconPath
        Invoke DeleteFile, addr Buffer

        Invoke RemoveDirectory, addr StartMBuff


Anyone removed folders from the start menu in vista without taking away from it working in previous OS's? If i use removedirectory and place the path to the folder it will remove it. The problem is vista using a roaming profile setup and the path you get from SHGetSpecialFolderPath is that of the roaming folder. The thing i dont understand is why it will work to remove the .lnk files but not remove the diretory.
Title: Re: Vista and RemoveDirectory in StartMenu..
Post by: Jackal on December 16, 2007, 02:25:16 PM
i take it no one has an idea?
Title: Re: Vista and RemoveDirectory in StartMenu..
Post by: hutch-- on December 16, 2007, 02:35:14 PM
I don't run Vista so I don't have a way of testing the problem but vaguely I remember that Vista controls all of the directories that are defined as system based so it may not allow you to delete the directory if its in a tree that starts as a system defined directory.
Title: Re: Vista and RemoveDirectory in StartMenu..
Post by: Jackal on December 19, 2007, 05:13:25 PM
i think you are correct as GetLastError is telling me Access is Denied.. I guess i need to find out how to get access. It will let me delete the link files just not the directory. Sometimes i dont understand microsofts reasonings for things.