views:

48

answers:

1

I would like to remove the isolated storage folders that are created by a .NET application when using My.Settings etc. The setting files are stored in a location like

C:\Users\%Username%\AppData\Roaming\App\App.exe_Url_r0q1rvlnrqsgjkcosowa0vckbjarici4

As per this question StackOverflow: Removing files when uninstalling Wix I can uninstall a folder using:

<Directory Id="AppDataFolder" Name="AppDataFolder"> 
    <Directory Id="MyAppFolder" Name="My"> 
        <Component Id="MyAppFolder" Guid="YOURGUID-7A34-4085-A8B0-8B7051905B24"> 
            <CreateFolder />
            <RemoveFile Id="PurgeAppFolder" Name="*.*" On="uninstall" /> 
        </Component> 
    </Directory> 
</Directory>

<!-- LocalAppDataFolder-->

This doesn't support sub-folders etc. Is the only option a custom .NET action or is there a more simple approach for removing these .NET generated setting folders?

A: 

Yep, if you don't know the folders at build time to fill in the RemoveFile table entirely, then you have to create a custom action.

You might also find the WixContrib project useful. It contains RemoveFolderEx extension to address this very problem. As it states, the code is of medium production quality. Never tried it myself, though...

Yan Sklyarenko

related questions