为setup.exe和.MSI创建面向未来的.NET 3.5 SP1安装程序先决条件

时间:2021-01-13 22:43:17

I've demanded .NET 3.5 SP1 a la Will a VS2008 setup project update Net 3.5 SP1?. This makes the setup.exe check correctly.

我要求.NET 3.5 SP1和VS2008安装项目更新Net 3.5 SP1吗?这使得setup.exe检查正确。

I've also added a "SP1" launch condition to my MSI so it doesn't let the user install my .NET 3.5SP1 app via launching the MSI (and replaced the [VSDNETMSG] in the Framework condition message with one that actually mentions SP1).

我还为我的MSI添加了一个“SP1”启动条件,因此它不允许用户通过启动MSI来安装我的.NET 3.5SP1应用程序(并将Framework条件消息中的[VSDNETMSG]替换为实际提到的一个) SP1)。

From a future proofing point of view, this feels wrong. I want the condition to be:

从未来的证据来看,这感觉是错误的。我希望条件是:

(NETVer=3.5 AND Net35SPLevel=1) OR (NETVer=>3.5)

not

(NETVer=3.5 AND Net35SPLevel=1)

Is there any way to do that? The framework check doesnt have a condition property to allow me to add a sub-condition...

有没有办法做到这一点?框架检查没有条件属性,允许我添加子条件...

Yes, I could also just not worry my pretty little head about it :P

是的,我也可以不担心我的小脑袋:P

If one of the MS versioning experts out there reads this, if you're going to put stuff that code depends on into SPs, can you please make the installer be able to check for it OOTB.

如果其中一个MS版本专家读到这个,如果你要把代码所依赖的东西放到SP中,你可以让安装程序能够检查它OOTB。

(I really wish they had come up with a better numbering scheme - the world and its dog could see that this was going to get confusing)

(我真的希望他们能够提出一个更好的编号方案 - 世界和它的狗可以看到这会让人感到困惑)

1 个解决方案

#1


Ah, as all but pointed in the article linked to from the other post I referenced, you could use the fact that a registry search that fails will yield a blank string (whereas #0 and #1 will result if 3.5 is actually installed and use the expression:

啊,正如我引用的另一篇文章所链接的文章所指出的那样,你可以使用这样一个事实,即失败的注册表搜索将产生一个空字符串(而如果实际安装了3.5,则会产生#0和#1)表达方式:

(NET35SPLEVEL="") OR NOT (NET35SPLEVEL>>"0")

This makes the check a disjunction, not a conjunction[1]

这使得检查成为一种分离,而不是一种结合[1]

Which solves the problem - the check wont fail on 4.0 with no SP.

这解决了问题 - 在没有SP的情况下4.0检查不会失败。

The remaining issue is that still doesnt cover the case where 4/4.1/4/5/5/6 is installed and there is an unservicepacked 3.5 on the machine... (So unaccepting my response!)

剩下的问题是仍然没有涵盖4 / 4.1 / 4/5/5/6安装的情况,并且机器上有一个未使用的3.5包装......(所以不接受我的回复!)

[1] Aint that right, Adam!

[1]没错,亚当!

#1


Ah, as all but pointed in the article linked to from the other post I referenced, you could use the fact that a registry search that fails will yield a blank string (whereas #0 and #1 will result if 3.5 is actually installed and use the expression:

啊,正如我引用的另一篇文章所链接的文章所指出的那样,你可以使用这样一个事实,即失败的注册表搜索将产生一个空字符串(而如果实际安装了3.5,则会产生#0和#1)表达方式:

(NET35SPLEVEL="") OR NOT (NET35SPLEVEL>>"0")

This makes the check a disjunction, not a conjunction[1]

这使得检查成为一种分离,而不是一种结合[1]

Which solves the problem - the check wont fail on 4.0 with no SP.

这解决了问题 - 在没有SP的情况下4.0检查不会失败。

The remaining issue is that still doesnt cover the case where 4/4.1/4/5/5/6 is installed and there is an unservicepacked 3.5 on the machine... (So unaccepting my response!)

剩下的问题是仍然没有涵盖4 / 4.1 / 4/5/5/6安装的情况,并且机器上有一个未使用的3.5包装......(所以不接受我的回复!)

[1] Aint that right, Adam!

[1]没错,亚当!