如何在卸载时删除自定义操作二进制文件?

发布于 2024-09-04 02:32:44 字数 1889 浏览 3 评论 0原文

当我卸载放置自定义操作二进制文件的产品目录时。我怎样才能删除它。安装时还会创建奇怪的命名目录 - 卸载:“RSCustomActions.CA.dll-”和“RSCustomActions.CA.dll-0”(我的二进制名称 RSCustomActions.CA.dll)

我的 WIX 代码是

<Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="ProgramFilesFolder">
          <Directory Id="Product.Id" Name="Product">
            <Directory Id="INSTALLLOCATION" Name="Product">
              <!-- TEST -->
              <Directory Id="Installer" Name="Installer">
                <Component Id="InstallerFiles"
                             Guid="{0904DB36-2496-419c-A992-B7D86F068F12}">
                  <File Id="RSCustomActions.CA.dll" Name="RSCustomActions.CA.dll" Source="Binaries\RSCustomActions.CA.dll" />                      
                </Component>
              </Directory>
              <!-- END TEST -->                  
              <?include "Product.Files.wxi" ?>                

            </Directory>
          </Directory>
        </Directory>
        <Directory Id="ProgramMenuFolder" Name="PMenu">
            <Directory Id="ProgramMenuDir" Name="Aspose">
                <?include "Product.ProgramMenu.wxi" ?>
            </Directory>
        </Directory>
        <Component Id="Main" Shared="yes" Guid="{EDD4477A-D188-469c-B8D0-4423377C03C6}" Feature="Main.InstallFeatures">
            <RemoveFolder Id="DeleteProgramMenuDir" Directory="ProgramMenuDir" On="uninstall" />
        </Component>
    </Directory>

“Product.Files.wxi”还包含

<Component Id="Product.Remove" Guid="{C6D9D74C-66E8-442a-8E53-78A8D0E2B24D}">
    <RemoveFolder Id="Product.RemoveFolder.Action" On="uninstall"/>
  </Component>  

请建议如何删除安装程序文件夹和那些具有二进制名称的存储文件夹。

谢谢!

When I'm uninstalling my product directory where custom action binary was placed stays. How can I delete it. Also strange named directory is created on installation - unistallation: "RSCustomActions.CA.dll-" and "RSCustomActions.CA.dll-0" (my binary name RSCustomActions.CA.dll)

My WIX code is

<Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="ProgramFilesFolder">
          <Directory Id="Product.Id" Name="Product">
            <Directory Id="INSTALLLOCATION" Name="Product">
              <!-- TEST -->
              <Directory Id="Installer" Name="Installer">
                <Component Id="InstallerFiles"
                             Guid="{0904DB36-2496-419c-A992-B7D86F068F12}">
                  <File Id="RSCustomActions.CA.dll" Name="RSCustomActions.CA.dll" Source="Binaries\RSCustomActions.CA.dll" />                      
                </Component>
              </Directory>
              <!-- END TEST -->                  
              <?include "Product.Files.wxi" ?>                

            </Directory>
          </Directory>
        </Directory>
        <Directory Id="ProgramMenuFolder" Name="PMenu">
            <Directory Id="ProgramMenuDir" Name="Aspose">
                <?include "Product.ProgramMenu.wxi" ?>
            </Directory>
        </Directory>
        <Component Id="Main" Shared="yes" Guid="{EDD4477A-D188-469c-B8D0-4423377C03C6}" Feature="Main.InstallFeatures">
            <RemoveFolder Id="DeleteProgramMenuDir" Directory="ProgramMenuDir" On="uninstall" />
        </Component>
    </Directory>

"Product.Files.wxi" also contains

<Component Id="Product.Remove" Guid="{C6D9D74C-66E8-442a-8E53-78A8D0E2B24D}">
    <RemoveFolder Id="Product.RemoveFolder.Action" On="uninstall"/>
  </Component>  

Please suggest any way how can I remove Installer folder and those strage folders with binary name.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

甜妞爱困 2024-09-11 02:32:44

为什么需要将 CA DLL 安装为产品的文件?您可以简单地将其放入二进制表中,然后忘记它,如下所示:

  <!-- This is a reference to the DLL where all custom actions reside -->
  <Binary Id="CustomActions" SourceFile="$(var.Root)\CA\CustomActions.CA.dll" />

自定义操作定义如下所示:

  <!-- Sample CA definition  -->
  <CustomAction Id="MyAction" BinaryKey="CustomActions" DllEntry="MyActionMethod" />

请注意,MyActionMethod 应在该 CA 程序集中定义并进行适当标记。 WiX 发行版的 dtf.chm 中有一个很好的示例。

希望这有帮助。

Why do you need installing the CA DLL as a file of the product? You can simply put it to Binary table and forget about it, like this:

  <!-- This is a reference to the DLL where all custom actions reside -->
  <Binary Id="CustomActions" SourceFile="$(var.Root)\CA\CustomActions.CA.dll" />

And the custom action definition is something like this:

  <!-- Sample CA definition  -->
  <CustomAction Id="MyAction" BinaryKey="CustomActions" DllEntry="MyActionMethod" />

Note that MyActionMethod should be defined in that CA assembly and marked appropriately. There's a good sample of this in dtf.chm in WiX distribution.

Hope this helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文