
danjal1.5524898945672556E12 asked a question.
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?
What are the return values of the functions you're calling?
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.