在卸载日志中找不到 WiX 属性 [英] WiX property not found in uninstall log

查看:29
本文介绍了在卸载日志中找不到 WiX 属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

UI 中的属性更改从卸载日志中消失.

Property change from the UI disappears from uninstall log.

如果我使用默认属性值安装我的应用,然后运行卸载,则卸载日志中会显示该属性.

If I install my app with default property values and then run uninstall the property appears in the uninstall log.

如果我在卸载时从 UI 更改属性值,它不会出现在日志中.

If I change the property value from the UI on uninstall it does not appear in the log.

这就是卸载后apppool和webapp还在IIS中的原因,默认值不是这样.

This is the reason why the apppool and webapp remain in IIS after uninstall, which is not the case with the default values.

这就是财产的样子.

这是我从 UI 控件添加值的地方

This is where I add it a value from the UI control

    <Control Id="PoolNameEdit"
             Type="Edit"
             X="100"
             Y="45"
             Width="160"
             Height="17"
             Property="WEB_APP_NAME"
             Text="{80}"
             Indirect="no" />

这就是我使用它的方式

<!-- Define the directory structure -->
  <Fragment>

    <!--Directory elemens hierarchy always starts with Id="TARGETDIR" Name="SourceDir"-->
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="WEB_APP_FOLDER_LOC" Name="WebInstaller">
        <Directory Id="WEBFOLDER" Name ="[WEB_APP_NAME]" />
      </Directory>
    </Directory>
  </Fragment>

  <Fragment>

    <!--Concatenate user input for folderpath-->
    <SetDirectory Id="WEBFOLDER"
                  Value="[WEB_APP_FOLDER_LOC][WEB_APP_NAME]"
                  Sequence="both" />

    <!--Create new folder-->
    <DirectoryRef Id="WEBFOLDER">
      <Component Id="cmp_WebDir"
                 Guid="{E0CE5051-1419-4997-949F-020BC814ECDA}"
                 KeyPath="yes">
        <CreateFolder />
      </Component>
    </DirectoryRef>

    <!--Components-->
    <ComponentGroup Id="ProductComponents" Directory="WEBFOLDER">

      <!--Client config-->
      <Component Id="cmpWebConfig"
                 Guid="{1C84DF1F-2EA4-46E6-8125-C6FD410AFED9}"
                 KeyPath="yes">
        <Condition>INCLUDECONFIGFILE="1"</Condition>
        <File Source="Configuration\Web.config" />
      </Component>

      <!--Application pool-->
      <Component Id="cmpAppPool"
                 Guid="{00D6ABB1-734F-4788-ADB8-12A30056C513}"
                 KeyPath="yes">

        <iis:WebAppPool Id="MyAppPool"
                        Name="[WEB_APP_NAME]"
                        ManagedRuntimeVersion="v4.0"
                        ManagedPipelineMode="integrated"
                        Identity="applicationPoolIdentity" />
      </Component>

      <!--Website-->
      <Component Id="cmpMyWebsite"
                 Guid="{ECD42015-C067-44F3-94D9-5E713BCB586D}"
                 KeyPath="yes">

        <iis:WebSite Id="website_MyWebsite"
                     Description="[WEB_APP_NAME]"
                     Directory="WEBFOLDER"
                     ConfigureIfExists="no">

          <iis:WebApplication Id="webapplication_MyWebsite"
                              Name="[WEB_APP_NAME]"
                              WebAppPool="MyAppPool" />

          <iis:WebAddress Id="webaddress_MyWebsite"
                          Port="[WEB_APP_PORT]" />
        </iis:WebSite>
      </Component>

我本来希望在 UI 中更改 WEB_APP_NAME 后,卸载程序能够找到它,从而从 IIS 中删除 appool 和 webapp.

I would have expected after the change of WEB_APP_NAME in the UI, the uninstaller to be able to find it and thus remove appool and webapp from IIS.

Property(S): VirtualMemory = 3353
Property(S): UpgradeCode = {A4F9CA9E-4135-4D6F-AF58-FADA49E265DA}
Property(S): ConfigureIIs7Exec = **********
Property(S): StartIIS7ConfigTransaction = **********
Property(S): RollbackIIS7ConfigTransaction = **********
Property(S): CommitIIS7ConfigTransaction = **********
Property(S): WriteIIS7ConfigChanges = **********
Property(S): NETFRAMEWORK45 = #461808
Property(S): WEBFOLDER= C:\inetpub\WebApp\
Property(S): WEB_APP_FOLDER_LOC = C:\inetpub\
Property(S): WEB_APP_NAME = WebApp
Property(S): WEB_APP_PORT = 8080
Property(S): WEB_APP_USERNAME = ******
Property(S): WEB_APP_DOMAIN_NAME = ******
Property(S): WEB_APP_SQLSERVER_NAME = ******
Property(S): INCLUDECONFIGFILE = 1

这是默认卸载日志的样子,如果我将 WEB_APP_NAME 更改为其他内容,则在卸载日志中找不到 WEB_APP_NAME 在上面可以看到的位置?

this is how the default uninstall log looks like, if I change WEB_APP_NAME to something else, WEB_APP_NAME is not found on the uninstall log where it can be seen above?

感谢任何可以解决此问题的想法!

Appreciate any ideas that would resolve this!

推荐答案

注意:请至少在卸载过程中防止属性被更改.我认为您应该只接受期间的更改全新安装?还是大升级?否则解析的目录名称与安装的目录名称不匹配(与您最初遇到的问题相同).

Note: Please prevent the properties from being changeable during uninstall at least. I think you should only accept changes during fresh install? Or major upgrade? Otherwise the resolved directory name does not match the installed one (same problem you originally had).

Persist Properties:当您允许在设置 GUI 中或通过命令行显示和更改相关属性时,您需要保持相关属性.否则,当解析为目录或应用程序名称时,属性将为空白 - 或者您在设置中使用它们的任何容量.保留 MSI 属性不是内置的 Windows Installer 功能(只有少数系统属性会自动保留).通常是 MSI 反模式,但事实就是如此.

Persist Properties: You need to persist the relevant properties when you allow them to be shown and changed in your setup GUI or via command line. Otherwise the properties will be blank when resolved as directory or application names - or whatever capacity you use them for in your setup. Persisting MSI properties is not a built-in Windows Installer feature (just a few system-properties are automatically persisted). Generally an MSI anti-pattern, but that is how it is.

记住模式"示例:对于常规的 PUBLIC 属性(大写属性),您可以使用 Rob Mensching 的记忆模式 用于保存和检索属性值修复、修改、卸载等维护操作.此处使用了此属性持久性模式的一个小示例:WIX UI用于多个目标目录(记住正在使用的模式).

"Remember Pattern" Sample: For regular, PUBLIC properties (UPPERCASE properties) you can use Rob Mensching's remember pattern to save and retrieve property values for repair, modify, uninstall and other maintenance operations. There is a small sample of this property persistence pattern in use here: WIX UI for multiple target directories (Remember Pattern in use).

安装模式:在进行设置时有多种安装模式需要检查:全新安装修复修改自行修复卸载主要升级卸载补丁rollback恢复挂起(重启和其他原因)等等......我至少会测试第一个6 种类型 - 确保分辨率正常工作.

Installation Modes: There are many installation modes to check when you make a setup: fresh install, repair, modify, self-repair, uninstall, major upgrade uninstall, patching, rollback, resume suspended (reboot and other causes), etc... I would test at least the first 6 types - to make sure resolution works properly.

这篇关于在卸载日志中找不到 WiX 属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆