Loading
Problems with DeleteDir
I have a InstallScript MSI Project.

 

I am trying during uninstallation to delete the folder with my product, but it does not work. Here is my script code.

 

STRING szPath, szPath2;

 

…..

 

szPath2 = FOLDER_PROGRAMS;

 

StrRemoveLastSlash(szPath2);

 

ChangeDirectory(szPath2);

 

szPath = INSTALLDIR;

 

StrRemoveLastSlash(szPath);

 

DeleteDir(szPath, ALLCONTENTS);

 

What am I doing wrong?

  • Where is it failing?

     

    What are the return values of the functions you're calling?
  • ChangeDirectory returns 0

     

    DeleteDir returns -1

     

    What is failing is that the directory that I am trying to delete does not get deleted.

     

    I have no problem deleting the directory manually.

     

    The code runs under OnMaintUIAfter.
    Expand Post

Loading
Problems with DeleteDir