开发者

Include NetFx20SP2_x86 as prerequisite for .Net setup project so that it installs correctly on Vista and Windows 7

开发者 https://www.devze.com 2023-03-26 17:14 出处:网络
We are supporting a VB.Net application that gets distributed to various schools that use a wide variety of Windows versions, so the installer for the application needs to support Windows XP, Vista and

We are supporting a VB.Net application that gets distributed to various schools that use a wide variety of Windows versions, so the installer for the application needs to support Windows XP, Vista and Windows 7. We have recently encountered a problem with our application on Windows XP which is solved by installing NetFx20SP2_x86.exe which we downloaded from here: http://www.microsoft.com/download/en/details.aspx?id=1639. I开发者_如何学C also downloaded .NET Frameworks 2.0 SP2 and 3.0 SP2 bootstrapper packages from here http://go.microsoft.com/fwlink/?LinkID=127832. This install adds Framework 2 SP 2 as an option in the prerequisites list of the .Net setup project.

I then created a setup project that has Framework 2 and Framework 2 SP2 selected as prerequisites. This produces a setup file that works fine in XP, but the problem is that when the same setup file is run on Windows Vista or Windows 7, the following error message occurs when trying to install NetFx20SP2: "This action is only valid for products that are currently installed".

How can I produce one setup file that will ensure that Famework 2 and SP2 for framework 2 are correctly installed on all three Windows platforms that we support?


Checked out the above link and found this version of .Net Framework is supported for Windows XP and Windows Server 2003 and not for Windows 7 or Windows Vista. Just google and see, there must be separate packages of .Net Framework for Vista and Windows 7.


I resolved this issue by adding .Net Framework 3.5 SP1 as a dependency on my install file. It seems that Framework 3.5 SP1 includes .Net Framework 2 with SP2 so with this as the dependency the install runs correctly on Windows XP, Windows Vista and Windows 7.

This is not the perfect solution, as I am effectively installing more than the application actually needs, as 3.5 isn't required by the application at all. But it was the only way I could find to get NetFx20SP2_x86 installed where it is needed (namely on XP), but without the install throwing errors when run on a platform where it is not needed (Vista and Windows 7). If someone knows a better way of doing this, I would gladly hear it, but for now this solution gets the job done.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号