none
error 1001: InstallUtillib.dll: Unknown Error

    Question

  • I have a 32 bit dll and have created a 32 bit msi to install this dll. This works correctly on a 32 bit machine. I have then taken the 32 bit dll code and recompiled it as a 64 bit dll. I have created a 64 bit msi to install this dll. I have then used Orca to modify the Binary table so that the InstallUtil information comes from: %WINDIR%\Microsoft.NET\Framework64\v2.0.50727.  I then get the above error when I run the msi. How can I get this to work on a 64 bit machine?
    Wednesday, November 09, 2011 5:59 PM

Answers

  • If you just build everything so that your code files target x86 and the MSI file too it will install just fine. It should work just fine too. Visual Studio 2010 is a 32-bit app that runs on x64 systems. Unless there is a specific reason that some part of your app needs to be native x64 you can just stay with 32-bit. You *may* get into trouble if you keep your code as AnyCpu because that will cause it to run as native 64-bit, and if it tries to call any 32-bit Dlls you may have then it will fail.
    Phil Wilson
    • Marked as answer by Chantilly Lace Friday, November 11, 2011 3:29 PM
    Thursday, November 10, 2011 9:53 PM
    Moderator

All replies

  • You only need to do that if you're calling a managed code custom action and your code is AnyCpu or built for 64-bit, is that the scenario?
    Phil Wilson
    Wednesday, November 09, 2011 6:14 PM
    Moderator
  • The dll was written in c# and is built for 64-bit.
    Wednesday, November 09, 2011 7:11 PM
  • Are you using Visual Studio 2010? If so, that location is incorrect.
    Phil Wilson
    Wednesday, November 09, 2011 9:42 PM
    Moderator
  • I am using Visual Studio 2010. What is the correct location?

    Thursday, November 10, 2011 6:11 PM
  • How about the directory relevant to Visual Studio 2010 .NET 4.0 instead of .NET 2.0? It'll be exactly the same as the one you tried but have a 4.0 version there.
    Phil Wilson
    Thursday, November 10, 2011 6:28 PM
    Moderator
  • When I used  %WINDIR%\Microsoft.NET\Framework64\v4.0.30319 I received the error that I had previously posted:

    Error 1001: An exception ocurred during the Commit phase of the installation. This exception will be ignored and installation will continue. However the application might not function correctly after installation is complete. MOF compilation failed.

    I was able to fix this error in my 32 bit version by removing 3rd party dll's that were included with my dll. Those dll's are not part of the 64 bit version, so I am not sure of what to do now.

     

    Thursday, November 10, 2011 7:18 PM
  • Just an FYI - I can manually use gacutil.exe and the installutil.exe from this directory %WINDIR%\Microsoft.NET\Framework64\v2.0.50727 to manually install the 64 bit dll and it works as expected.

     

    Thursday, November 10, 2011 7:19 PM
  • I'm a bit confused because the original error reported was "Unknown error", and that smells of a .NET mismatch with the install trying to run your 64-bit .NET 4.0 custom action on a NET 2.0 framework InstallUtilLib.dll. But "an exception occurred" is probably just a crash in the custom action code. Without knowing exactly what the calling sequence is it's not easy to see know what's happening. Custom actions run in an environment which is nothing at all like running installutil.exe with your account. They run off an msiexec.exe process, MTA, with the local system account, and a few other restrictions. If your code runs as native 64 it can't call any 32-bit Dlls either. Your code needs to be very defensive and check for errors, null objects etc.

    Do you really need a native 64-bit app? Many many people install and run their 32-bit apps on x64 systems just fine.


    Phil Wilson
    Thursday, November 10, 2011 7:39 PM
    Moderator
  • I don't need a native 64 bit app - I just need to install this dll on a 64 bit machine - it can be the 32 bit dll. But how do I do this? Does the msi not have to target 64 bit?

     

    Thursday, November 10, 2011 8:34 PM
  • If you just build everything so that your code files target x86 and the MSI file too it will install just fine. It should work just fine too. Visual Studio 2010 is a 32-bit app that runs on x64 systems. Unless there is a specific reason that some part of your app needs to be native x64 you can just stay with 32-bit. You *may* get into trouble if you keep your code as AnyCpu because that will cause it to run as native 64-bit, and if it tries to call any 32-bit Dlls you may have then it will fail.
    Phil Wilson
    • Marked as answer by Chantilly Lace Friday, November 11, 2011 3:29 PM
    Thursday, November 10, 2011 9:53 PM
    Moderator
  • Hi Phil,

     

    Thanks - it worked.

    Friday, November 11, 2011 3:29 PM
  • Hi, though this problem is already solved: Is there a solution for installers/programs that NEED to be native x64? I have exactly the same problem with my custom action in C# but there are C++ parts of the project i cant just switch to 32Bit.
    Monday, June 30, 2014 9:25 AM
  • C++ doesn't usually matter, but then you don't say what the C++ code is that you're referring to.

    This thread is about an issue related to managed code, and Windows Installer doesn't support that natively, so there's the InstallUtilLib.dll that's written in C++ to provide a layer between the running install and calling managed code. If you have plain C++ code in a custom, action you don't need any of this.


    Phil Wilson

    Wednesday, July 09, 2014 4:50 PM
    Moderator
  • Yes i know. I have a C++ dll that calls a driver, thats why it has to be a 64Bit dll on a 64Bit system. When the C++ dll is 64Bit i then have to create a 64Bit MANAGED app that calls the dll. My custom action is written in C#, so I DO need the InstallUtilLib.dll. Believe me, I really tried to create a pure 32Bit application, but there seems to be no possibility...

    Sorry for the confusion, i thought the original question was clear so i didnt explain my own problem in detail. 

    To be clear: When i have a 64Bit setup project (installing various stuff) with a custom action written in C#, is there a way to get it work?

    Wednesday, July 09, 2014 5:08 PM
  • This describes the original issue:

    http://blogs.msdn.com/b/heaths/archive/2006/02/01/64-bit-managed-custom-actions-with-visual-studio.aspx

    and I am unsure if this was ever corrected in later VS setups so that x64 builds of an MSI automatically use the 64-bit installutil Dll. It adds to the confusion that the 2.0 and 4.0 runtimes are different, and the setup project settings need to reflect that.  I believe it uses the version of the framework as defined in the NET Framework launch condition to decide which FW to load to call your managed code.


    Phil Wilson

    Wednesday, July 09, 2014 7:00 PM
    Moderator