开发者

How can I remove .NET isolated storage setting folders during WiX uninstallation?

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?


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


If anyone is experiencing the same issue, I used a custom .NET action to remove the folders. The WiX documentation provided a good example on how to create the action.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜