[wix-users] Delete logs folder at uninstall

Hoover, Jacob Jacob.Hoover at greenheck.com
Tue Jan 4 10:45:24 PST 2022


That error isn't from RemoveFile / RemoveFolder, as it's a .Net exception, and vanilla windows installer doesn't have such a dependency. My guess is they wrote an uninstall managed CA.  (I believe RemoveFolderEx would handle this as well, scheduling the removal of files if in use).

From: wix-users <wix-users-bounces at lists.wixtoolset.org> On Behalf Of Bevan Weiss via wix-users
Sent: Saturday, December 18, 2021 7:22 PM
To: 'WiX Toolset Users Mailing List' <wix-users at lists.wixtoolset.org>
Cc: bevan.weiss at gmail.com
Subject: Re: [wix-users] Delete logs folder at uninstall

Are you using the RemoveFile element?
https://wixtoolset.org/documentation/manual/v3/xsd/wix/removefile.html<https://wixtoolset.org/documentation/manual/v3/xsd/wix/removefile.html>

https://stackoverflow.com/questions/195919/removing-files-when-uninstalling-<https://stackoverflow.com/questions/195919/removing-files-when-uninstalling->
wix

You'll need to provide more information in regards to how you're trying to
do the deletion of the file/folder.
I suspect that the service itself is still running at the time.

I expect that RemoveFile / RemoveFolder are by default scheduled in the
right order to be after the stopping / removal of services.
But if you're using these elements already, then you may want to confirm
this for yourself.


Regards,
Bevan

-----Original Message-----
From: wix-users <wix-users-bounces at lists.wixtoolset.org<mailto:wix-users-bounces at lists.wixtoolset.org>> On Behalf Of
Racheli Ganon via wix-users
Sent: Sunday, 19 December 2021 11:46 AM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org<mailto:wix-users at lists.wixtoolset.org>>
Cc: Racheli Ganon <r05458410430 at gmail.com<mailto:r05458410430 at gmail.com>>
Subject: [wix-users] Delete logs folder at uninstall

Hi,
I have a service that logs to a newly created folder, on the onStart() and
onStop() of the service.

In the uninstall scenario I want to delete the logs folder but the
uninstall fails, using verbose logging I'm getting this error:
*System.IO.IOException: The process cannot access the file 'Service.log'
because it is being used by another process.*

Any suggestions?
Any help will be appreciated,
Thanks!!

____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant
http://www.firegiant.com/<http://www.firegiant.com>


____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/<http://www.firegiant.com/>
NOTE: This email was received from an external source. Please use caution when opening links or attachments in the message.


More information about the wix-users mailing list