cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ChristopheOce
Level 7

uninstall product + deletedir

Hi,

I have a basic msi project who installs some dll dotnet, xml file and so on !
When the product is remove, some file (.exe, .txt, shortcut, ..) are always prensent on the INSTALLDIR at the end of uninstallation !!!

For to try to solve this problem, i've add a installscript function :


....
if (ExistsDir (szPathInstall) = EXISTS) then

nRetDel = DeleteDir(szPathInstall, ALLCONTENTS);
if (nRetDel = 0)then
MessageBox("all was deleted", INFORMATION);
else

NumToStr( val, nRetDel );
MessageBox("UNABLE TO DELETE FILE" + val, SEVERE);

endif;


This custom action is well executed in the sequence before installfinalize with REMOVE="ALL" as condition.

Of course, when i uninstall my product the messagebox appears and contains -1 as the returns value !!!!

If i try to place the format message(nRetDel), the result is empty !

hm hm rather boring :-), someone have some idea for how to find why my file is not remove while the uninstalling sequence and how i can solve this problem ?

Thanks for your idea
Christophe
Labels (1)
0 Kudos
(2) Replies
nmsams
Level 7

My project is an Installscript MSI, so I'm not sure if this will help or not...

But in my code, I have:

DeleteDir ( INSTALLDIR , ALLCONTENTS );

I don't capture a return value for the DeleteDir function or display any message and it seems to work fine. Also as you can see I use the variable INSTALLDIR which is automatically populated with the installation path. I think some of the other project types use TARGETDIR instead.
0 Kudos
ChristopheOce
Level 7

Hi nmsams,

Thanks for you reply, but my variable szPathInstall is INSTALLDIR 🙂

nRetDel = DeleteDir(szPathInstall, ALLCONTENTS);


And i don't know why when i remove the product some file (shortcut, xml, dll, exe) are always present on the target machine !!!!

It s not everytime, i have a machine xp and it's arrives everytime and on my build machine win 2003 it never arrives !!!!

I'd like to understand why it's arrives and why i can do for to solve this problem..

If you have any idea, don't hesitate 🙂

Thanks for all
Christophe
0 Kudos