安装程序不卸载文件

发布于 2024-10-31 04:38:07 字数 1528 浏览 1 评论 0原文

我有一个非常简单的安装项目:

  <Product Id="*" UpgradeCode="$(var.UpgradeCode)" Name="$(var.ProductLongName)" Language="1033"
         Version="$(var.ProductVersion)" Manufacturer="$(var.Manufacturer)">

    <Package InstallerVersion="200" Compressed="yes" />

    <Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />

    <!-- Installation Parts -->
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="WindowsFolder">
        <Component Id="ProductComponent" Guid="b3250107-4859-4d5f-857c-1756af65ec32">
          <File Id='SomeFile' Name='SomeFile.scr'
                Source='SomeFile.scr' Vital='yes' />
           <!-- Other files -->
        </Component>
      </Directory>
    </Directory>

    <Feature Id="ProductFeature" Title="$(var.ProductShortName)" Level="1">
      <ComponentRef Id="ProductComponent" />
      <!-- Note: The following ComponentGroupRef is required to pull in generated authoring from project references. -->
      <ComponentGroupRef Id="Product.Generated" />
    </Feature>

    <!-- Prerequisites -->
    <PropertyRef Id="NETFRAMEWORK40CLIENT"/>

    <Condition Message="This application requires .NET Framework 4.0. Please install the .NET Framework then run this installer again.">
      <![CDATA[Installed OR NETFRAMEWORK40CLIENT]]>
    </Condition>

  </Product>

它安装正常,卸载似乎也正常完成,但所有文件仍然存在。它们不会被删除。
有什么想法吗?

I have a very simple setup project:

  <Product Id="*" UpgradeCode="$(var.UpgradeCode)" Name="$(var.ProductLongName)" Language="1033"
         Version="$(var.ProductVersion)" Manufacturer="$(var.Manufacturer)">

    <Package InstallerVersion="200" Compressed="yes" />

    <Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />

    <!-- Installation Parts -->
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="WindowsFolder">
        <Component Id="ProductComponent" Guid="b3250107-4859-4d5f-857c-1756af65ec32">
          <File Id='SomeFile' Name='SomeFile.scr'
                Source='SomeFile.scr' Vital='yes' />
           <!-- Other files -->
        </Component>
      </Directory>
    </Directory>

    <Feature Id="ProductFeature" Title="$(var.ProductShortName)" Level="1">
      <ComponentRef Id="ProductComponent" />
      <!-- Note: The following ComponentGroupRef is required to pull in generated authoring from project references. -->
      <ComponentGroupRef Id="Product.Generated" />
    </Feature>

    <!-- Prerequisites -->
    <PropertyRef Id="NETFRAMEWORK40CLIENT"/>

    <Condition Message="This application requires .NET Framework 4.0. Please install the .NET Framework then run this installer again.">
      <![CDATA[Installed OR NETFRAMEWORK40CLIENT]]>
    </Condition>

  </Product>

It installs ok and uninstall seem to finish ok too, but all files remain. They are not deleted.
Any ideas?

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

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

发布评论

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

评论(2

青巷忧颜 2024-11-07 04:38:07

因此,当我将组件 guid 更改为新生成的时,这个问题就消失了。实在不明白为什么。诡异的。

So, this problem is gone when I changed component guid to a freshly generated. Don't really understand why. Weird.

与之呼应 2024-11-07 04:38:07

OP中的组件GUID全部为小写。按照惯例,MSI 更喜欢 GUID 全部大写,以防万一您需要将 GUID 作为(公共)属性跨服务边界传递。您的新 GUID 是否全部为大写?

The component GUID in the OP was all in lower case. By convention MSI prefers GUIDs to be all in upper case just in case you need to pass the GUID across the service boundary as a (public) property. Was your new GUID all in upper case, by any chance?

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