是否可以在Installshield 2012 PRQ中使用逻辑OR或否定条件?

时间:2021-11-28 22:39:09

I have a PRQ that installs MS SQL Shared Management Objects. I have a condition that installs the PRQ if this registry key does not exist

我有一个安装MS SQL共享管理对象的PRQ。如果此注册表项不存在,我有条件安装PRQ

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{08ECC740-2B3E-45D7-860C-59B511386286}

This works fine until a user has SMO installed with a different product code - this happens to our dev team all the time when they install SQL2008. The installer the PRQ starts exists with an error.

这个工作正常,直到用户安装了使用不同产品代码的SMO - 这在我们的开发团队安装SQL2008时会发生。 PRQ启动的安装程序存在错误。

I need a better condition. What I'd like to do is: If (Version <= w.x.y.z || No Version found) Then install PRQ

我需要一个更好的条件。我想做的是:If(Version <= w.x.y.z || No Version found)然后安装PRQ

In the InstallShield Prerequisite editor it says

在InstallShield Prerequisite编辑器中,它说

The Following conditions must be met for the prerequisite to run. Here you can define files and registry keys that the prerequisite will look for to determine if it should be run. If there are no conditions, the prerequisite will always run.

运行先决条件必须满足以下条件。在这里,您可以定义先决条件将查找的文件和注册表项,以确定是否应该运行它。如果没有条件,则先决条件将始终运行。

This agrees with my findings - the conditions are ANDed together. Is there some unpublished sauce to OR or negate conditions in the XML? I'm vexed right now because looking to run a prq if the version in the registry is < what I'm installing.

这与我的发现一致 - 条件是一起的。是否有一些未发表的调味品要么OR或否定XML中的条件?我现在很烦,因为如果注册表中的版本是 <我正在安装的东西,那么就要运行prq。< p>

<conditions>
    <condition Type="32" Comparison="2" 
       Path="HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\SharedManagementObjects\CurrentVersion" 
       FileName="Version" ReturnValue="10.1.2531.0">
    </condition>
</conditions>

Type="32" is 'A registry entry has a specified version value' Comparison="2" is 'Data on target system is less than specified data'

Type =“32”是'注册表项具有指定的版本值'Comparison =“2”是'目标系统上的数据小于指定的数据'

Side question: Is there a place where the Types and Comparisons are enumerated?

附带问题:是否存在枚举类型和比较的位置?

This Comparison type doesn't have a comparison to state 'Data on target system is less than specified data or does not exist'. As it is now, if the key exists at a lower version things work - but if the key doesn't exist (i.e. SMO isn't installed) the PRQ isn't installed.

此比较类型没有与状态'目标系统上的数据小于指定数据或不存在'进行比较。就像现在一样,如果密钥存在于较低版本,则可以正常工作 - 但如果密钥不存在(即未安装SMO),则不会安装PRQ。

Is there a way to make this work? The 'A file with certain version exists' condition does have a If the file's version is LESS THAN the version specified above (or the file IS NOT FOUND on the target system) option. But it won't work to check a file installed by SMO - the user may have installed it to some drive other than C:.

有没有办法让这项工作? “具有特定版本的文件存在”条件确实具有如果文件的版本低于上面指定的版本(或目标系统上的文件未找到)选项。但是检查SMO安装的文件是行不通的 - 用户可能已将其安装到C:以外的某个驱动器上。

I'm hoping I'm missing something. What would you do?

我希望我错过了一些东西。你会怎么做?

1 个解决方案

#1


2  

What I typically do is not use abstract things like ARP entries to detect the dependency. I go for the dependency itself. If you need a DLL then look to see if the DLL is there instead of worrying about detecting something that should have installed the DLL.

我通常做的不是使用像ARP条目这样的抽象事物来检测依赖关系。我自己去寻求依赖。如果你需要一个DLL,那么看看DLL是否存在,而不是担心检测应该安装DLL的东西。

#1


2  

What I typically do is not use abstract things like ARP entries to detect the dependency. I go for the dependency itself. If you need a DLL then look to see if the DLL is there instead of worrying about detecting something that should have installed the DLL.

我通常做的不是使用像ARP条目这样的抽象事物来检测依赖关系。我自己去寻求依赖。如果你需要一个DLL,那么看看DLL是否存在,而不是担心检测应该安装DLL的东西。