帮助确保使用引导程序,但升级工作

时间:2010-09-24 18:28:10

标签: wix windows-installer wix3.5 msiexec

我们在WiX 3.5.2030.0中创建了一个MSI,目标是Windows Installer 4.0(支持MSIUSEREALADMINDETECTION)。我们有一个我们在MSI中定义的属性来强制使用引导程序(我说“强制执行”但当然“非常强烈鼓励”):

<Property Id="SETUPEXE"
          Secure="yes" />
<Condition Message="You must run the MSI through the setup program; you cannot run it directly.">
  SETUPEXE = 1
</Condition>

当我们将生成的MSI作为新安装运行时,一切正常。但是,当我们将其作为升级运行时,传入安装程序的属性似乎在某些时候“丢失”。该日志显示以下相关条目:

MSI (s) (2C:8C) [11:27:41:648]: Command Line: SETUPEXE=1 <other properties>

MSI (s) (2C:8C) [11:27:43:055]: PROPERTY CHANGE: Adding SETUPEXE property. Its value is '1'.

MSI (s) (2C:CC) [11:28:11:038]: PROPERTY CHANGE: Adding NETFRAMEWORK20INSTALLROOTDIR property. Its value is 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\'.
Action ended 11:28:11: AppSearch. Return value 1.
MSI (s) (2C:CC) [11:28:11:147]: Doing action: LaunchConditions
Action start 11:28:11: LaunchConditions.
MSI (s) (2C:CC) [11:28:33:662]: Product: <product> -- You must run the MSI through the setup program; you cannot run it directly.

Action ended 11:28:33: LaunchConditions. Return value 3.
Action ended 11:28:33: INSTALL. Return value 3.

Property(N): SETUPEXE = 0

Property(N): SecureCustomProperties = NETFRAMEWORK20INSTALLROOTDIR;NETFRAMEWORK35;NETFRAMEWORK35_SP_LEVEL;NEWERVERSIONDETECTED;OLDERVERSIONBEINGUPGRADED;SETUPEXE

Property(S): SecureCustomProperties = NETFRAMEWORK20INSTALLROOTDIR;NETFRAMEWORK35;NETFRAMEWORK35_SP_LEVEL;NEWERVERSIONDETECTED;OLDERVERSIONBEINGUPGRADED;SETUPEXE

Property(S): SETUPEXE = 1

我已经对此进行了一些搜索并查看了WiLogUtl中的日志,并且至少已经发现Property(N)表示“嵌套”属性,但我不知道嵌套是什么当我通过msiexec直接运行MSI时。然后,我不知道为什么在客户端和服务器值正确时未正确设置嵌套属性。我该如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

我会考虑将该条件更改为(或类似于您的用例)

<Condition Message="Blah blah blah">SETUPEXE or Installed</Condition> 

我做了类似的事情(默认情况下InstallShield setup.exe传递一个SETUPEXEDIR属性)如果你想确保你的安装程序是通过引导程序运行的,那么这不是一件可怕的事情,以确保有必要安装先决条件。但是对于维护/修复/卸载方案,您可能不希望运行setup.exe。