cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
danjal
Level 5

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?
Labels (1)
0 Kudos
(2) Replies
Not applicable

Where is it failing?

What are the return values of the functions you're calling?
0 Kudos
danjal
Level 5

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.
0 Kudos