目录 NN 在用户配置文件中,但未在 RemoveFile 表中列出 [英] Directory NN is in the user profile, but is not listed in the RemoveFile table
问题描述
当我尝试创建安装程序时,出现以下错误:
When I am trying to create the installer i am getting the following error:
目录 ProgramMenuDir
位于用户配置文件中,但未列在 RemoveFile
表中.
The directory ProgramMenuDir
is in the user profile but is not listed in the RemoveFile
table.
我该如何解决这个问题?以下是我使用的目录结构:
How do I resolve this issue? Below is the directory structure I am using:
<Directory Id="ProgramMenuFolder" Name="Programs">
<Directory Id="ProgramMenuDir" Name="E">
<Directory Id="Monarch" Name="Monarch">
<Component Id="Monarch" Guid="*">
<RemoveFolder Id='Monarch' On='uninstall' />
<RemoveFolder Id='ProgramMenuDir' On='uninstall' />
<RegistryValue Root='HKCU' Key='Software\[Manufacturer]\[ProductName]'
Type='string' Value='' KeyPath='yes' />
</Component>
</Directory>
</Directory>
</Directory>
推荐答案
据我所知,问题出在
元素的使用上.如果省略 'Directory' 属性,则它采用父组件的目录.在您的情况下,它是一个 Id="EFIMonarch" 的目录.这解释了为什么您会收到针对外部目录 (ProgramMenuDir) 的警告,但不会针对 EFIMonarch 目录收到警告.
As far as I can see, the problem is in the usage of <RemoveFolder/>
element. If the 'Directory' attribute is omitted, it takes the directory of the parent component. In your case, it is a directory with Id="EFIMonarch". This explains why you get the warning for the outer directory (ProgramMenuDir), but don't get it for EFIMonarch directory.
尝试更换:
<RemoveFolder Id='ProgramMenuDir' On='uninstall' />
与
<RemoveFolder Id='RemoveProgramMenuDir' Directory='ProgramMenuDir' On='uninstall' />
此外,最好对每个 RemoveFolder 元素进行明确说明.
Also, it is a good idea to be explicit for every RemoveFolder element.
希望这会有所帮助.
这篇关于目录 NN 在用户配置文件中,但未在 RemoveFile 表中列出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!