0
votes

Overview

I have an Application running under .NET Framework 3.5. As the clients use Windows 7 (default: .NET 3.5) and Windows 8 / 8.1 (default: .NET 4.5). At the moment the .NET Framework (3.5) gets installed if not available on the system.

The application itself is able to run under .NET 4.5, thus I'd like to remove the dependency to .NET Framework 3.5.

Problem

In the Setup Project, I have to define the 'Launch Conditions' where .NET Framework is listed and can't be removed. When configured with Version 3.5 it will run on Windows 7 and gives an error on Win 8. When changed to Version 4.5 it will run on Win 8 but not 7. When I change the version to 'Any' it installs on Win 7 but throws an error during installation on Win 8, saying: "Error 1001 InstallUtilLib.dll. unknown error".

Question

How can a setup project check for a version higher than .NET Framework 3.5 instead of 'Any' and if I have to use 'Any' how to get it working under Win 8?

Details

I'm using VS2013 with the 'Visual Studio Installer Projects' Extension v1.0.0

Solution structure:

  • Custom_Action (NET 3.5, x86)
  • MyProject (NET 3.5, x86)
  • SetupProject (Property 'TargetPlatform' set to x86)

The app.config of the Custom_Action and MyProject is set like this: <configuration> <startup> <supportedRuntime version ="v2.0.50727"/> <supportedRuntime version ="v4.0"/> </startup> </configuration>

When I start the setup on Win 7 everything works. When I start the setup on Win 8 I get through the Configuration Dialogs of the Setup. It will halt with the Error "Error 1001 InstallUtilLib.dll. unknown error"

1
Unticking the .NET Framework dependency from the Prerequisites works just fine, pretty unclear why you cannot unselect it. All you need is an app.exe.config file that declares your program compatible with .NET v4, using the <supportedRuntime> element.Hans Passant
The .NET Framework Dependency is unticked from Prerequisites. In the Setup Project under 'Launch Conditions' I cannot remove '.NET Framework'. If I try to delete it I get: "This launch condition is required and cannot be deleted because a dependency on the .NET Framework is present.". Furthermore the Custom_Action project as well as the main project have an app.config file specifying supportedRuntime.user3270103
Okay, select the Launch condition and change the Version property to "Any".Hans Passant
I tried that as well. I get the above mentioned error under Win8 then: "Error 1001 InstallUtilLib.dll. unknown error" but not under Win7.user3270103
According to the project page, there was an update released on May 27th of this year that is supposed to address that error. Be sure to update. If that doesn't help then try tinkering with the Setup project's TargetPlatform property.Hans Passant

1 Answers

0
votes

A bunch of things, not sure if there is a specific answer.

There's no such thing as an "Any" install. You have to build one for each architecture:

http://blogs.msdn.com/b/heaths/archive/2008/01/15/different-packages-are-required-for-different-processor-architectures.aspx

because I think the InstallUtilLib error might be related to 64 vs 32-bit. Your custom action is called by InstallUtilLib.dll, and that Dll is specific to the bitness (it's inside your MSI file) so you don't want any attempts at cross-architecture calls, which will fail, so everything your installer class uses must also match the bitness of the install. So if you built an x86 install make all the code and installer classes used by the install 32-bit too.

Make sure your VS Installer extension is the latest one - earlier ones had that InstallUtilLib error.

There isn't a way to say "at least this NET level" in VS setup projects. I'd recommend making sure you don't have a cross-architecture calling issue and fixing the basic InstallUtilLib error to make it all work. Did you post the specifics of that issue anywhere with details to see if it could be solved?