本文介绍了WiX RemoveFolderEx无法正常工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望WiX在卸载时删除AppData文件夹,因此我查看了RemoveFolderEx,并按照几篇文章/指南进行操作.据我所知,我的实现应该可以,但是不能.我正在使用以下内容:

I wanted WiX to remove the AppData folder when uninstalling, so I looked at RemoveFolderEx and followed a few posts/guides on how to get it working. As far as i can tell, my implementation should work, but it does not. I'm using the following:

<Directory Id="TARGETDIR" Name="SourceDir">
    <Directory Id="AppDataFolder">
        <Directory Id="PRIVATEDATAFOLDER" Name="MyApp"/>
    </Directory>
</Directory>
<Property Id="PRIVATEDATAFOLDER">
    <RegistrySearch Root="HKCU" Key="Software\AppCo\MyApp" Type="raw" 
                    Id="APPLICATIONFOLDER_REGSEARCH" Name="PrivateDir" />
</Property>
<DirectoryRef Id='PRIVATEDATAFOLDER'>
    <Component Id="PrivateData" Guid="myGuid">
        <CreateFolder Directory="PRIVATEDATAFOLDER"/>
        <util:RemoveFolderEx Property="PRIVATEDATAFOLDER" On="uninstall"/>
        <RemoveFolder Id="PRIVATEDATAFOLDER" On="uninstall"/>
        <RegistryValue Root="HKCU" Key="Software\AppCo\MyApp" Name="PrivateDir" 
                       Type="string" Value="[PRIVATEDATAFOLDER]" KeyPath="yes"/>
    </Component>
</DirectoryRef>

我在这里做错什么了吗?

Is there something I'm doing wrong here?

检查详细日志后,出现错误:

After checking a verbose log I get the error:

WixRemoveFoldersEx:错误0x80070057 :缺少文件夹属性:PRIVATEDATAFOLDER

WixRemoveFoldersEx: Error 0x80070057: Missing folder property: PRIVATEDATAFOLDER

推荐答案

在您的日志中,"错误0x80070057 :缺少文件夹属性:PRIVATEDATAFOLDER"上方有一条日志行,例如忽略不允许属性PRIVATEDATAFOLDER",如果是这样,您是否尝试过将'secure ="yes"'添加到您的PRIVATEDATAFOLDER属性中?

In your logs, above the 'Error 0x80070057: Missing folder property: PRIVATEDATAFOLDER' is there a log line such as 'Ignoring disallowed property PRIVATEDATAFOLDER' and if so, have you tried adding 'secure="yes"' to your PRIVATEDATAFOLDER property?

这篇关于WiX RemoveFolderEx无法正常工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-23 06:31