How to delete the .xml and .log file when the premature uninstall is occurred in WIX



I have created Wix installer for service and is working fine. The problem is when the service is not started for any reason For ex: (IP address given wrong, DBscript is wrong or Active MQ problem) during installation time, the roll back is not completely clean the directory structure. Still it contains my explicitly contain .log file and .xml file. But during uninstall it clear every file. The problem is how to delete .xml and .log file in premature uninstall.



<Directory Id="Logs" Name="LfvGatewayLogs">
<Component Id="RemoveLogFiles" Guid="{92669E68-52A1-4B65-90C0-3B2D50470870}" KeyPath="yes" Win64="no" Location="either">
<RemoveFile Id="LogFiles" On="uninstall" Name="*.log" />
<CreateFolder />
</Component>
</Directory>

<Directory Id="LfvGatewayServiceFolder" Name="LfvGatewayService">
<Directory Id="ConfigurationFolder" Name="Configuration">
<Component Id="RemoveXmlFiles" DiskId="1" Guid="{C6189453-2732-43A8-A076-768D4DBEDC41}" KeyPath="no" Location="either">
<CreateFolder />
<RemoveFile Id="XmlFiles" On="uninstall" Name="*.xml" />
</Component>
</Directory>

<Directory Id="DBScriptsFolder" Name="DatabaseScripts">
<Component Id="RemoveLogFilesDBScript" DiskId="1" Guid="{C8B6B12D-3F52-48D4-94DA-DA01DA294BAA}" KeyPath="no" Location="either">
<CreateFolder />
<RemoveFile Id="LogFilesDbScript" On="uninstall" Name="*.txt" />
</Component>
</Directory>
</Directory>

</Directory>
</Directory>
</Directory>
</Directory >

No comments:

Post a Comment