News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Vista and RemoveDirectory in StartMenu..

Started by Jackal, December 13, 2007, 10:40:40 PM

Previous topic - Next topic

Jackal

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.

Jackal


hutch--

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.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Jackal

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.