Visual studio Installer Issue : Error 1001. Error 1001. InstallUtilLib.dll: Unknown error
Asked Answered
F

2

10

There are lot of threads and question out there. But the error I am facing is in quite different scenario. So let me explain here. With the help of this article Installer Class and Custom Actions

I have added project primary output(Having Installer Class) as custom action inside Commit. with the custom action condition : NOT REMOVE. But when I try to run the MSI, It gives me an error in a popup, Error 1001. Error 1001. InstallUtilLib.dll: Unknown error.

Below is my code and logs of the installer :

Project Build's Target platform is ANY CPU and installer's is x86 bit.

InstallHelper.cs

[RunInstaller(true)]
public partial class InstallHelper : System.Configuration.Install.Installer
{
    public InstallHelper()
    {
        InitializeComponent();
    }

    public override void Install(IDictionary stateSaver)
    {
        base.Install(stateSaver);
    }

    public override void Commit(IDictionary savedState)
    {
        base.Commit(savedState);
        //configrureAppAfterInstallation();
    }
}

Primary output of the project is inlcuded as custom action under Commit action with following parameters :

CustomActionData : /targetDir="[TARGETDIR]\", /srcDir="[SOURCEDIR]\"

Conditions : NOT REMOVE

And the logs snapshot in eventviewer :

The description for Event ID 11001 from source MsiInstaller cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event:

Product: MyApp -- Error 1001. Error 1001. InstallUtilLib.dll: Unknown error.

(NULL)

(NULL)

(NULL)

(NULL)

(NULL)

the message resource is present but the message is not found in the string/message table

And the logs generated in %TEMP% folder :

Error 1001. Error 1001. InstallUtilLib.dll: Unknown error.

=== Logging stopped: 11/16/2017 19:43:53 ===

No Matter What i change be it custom action condition, or adding the custom action under install or commit or both. I got same error and the same logs. Sometimes It work with the same configuration, but then custom action doesnot get called. To avoid the error I had to remove custom action. But that's not the requirement. I am not able to understand, what this error means?

I tried to create a fresh similar project from scratch and add custom action. it worked. But not with the current project. What would be the possible cause?

I would appreciate any help. I am really got stuck at this. Thanks in advance.

========EDIT=========

we are using add-in express (v8.2.4371) framework to develop office-addin. It automatically adds adxRegistrator.exe as customAction (for Install, Rollback and Uninstall Mode) to perform some action such as registering the add-in etc.

The system is 64 bit type. Project is targeted at 4.0 .net framework version.

And I am adding my own customAction for Install, commit custom action mode. Is it possible to add two custom action? If it is what are the things I should/must care of? e.g. like conditions or entry point parameters of them.

Frawley answered 17/11, 2017 at 7:9 Comment(8)
Is your project or the installer targeted at x64 by any chance?Accommodating
Project build's target platform is any CPU. And installer's is x86 bit CPU.Frawley
Try it without the CustomActionData - sometimes that can cause issues. That at least gives you a place to start to fix this.Phycomycete
It works if i remove the cutom action, but i have to write an installer class to perform some action.Frawley
@pancham: I did not say to delete the custom action, I suggested deleting the CustomActionData to see if that corrects it. The internal parsing of that string sometimes fails, which is why I suggested it.Phycomycete
@Phycomycete I tried doing that too. still no luckFrawley
Is this a 64-bit system?Phycomycete
Yes the system is of tyle 64 bit.Frawley
B
9

For anyone else with InstallUtilLib.dll: Unknown error when trying to install an .MSI built with the Visual Studio Setup & Deployment project types:

I recently had this error after migrating a Visual Studio Setup & Deployment project to a new machine and new version of Visual Studio (where the installed .NET frameworks were likely different). In my case, removing my .NET custom action from the Setup project got rid of the error just like the OP, but my code was NOT THE ROOT CAUSE.

The root cause was forgetting to check the Launch Conditions (View->Launch Conditions) of the Setup Project, where I needed to change the .NET Framework Launch Condition to match what was actually installed on the machine I migrated to (and not what was on the old development PC). Also, you'll need to change the prerequisites by right clicking on your Setup & Deployment project and clicking Properties. Then click the Prerequisites button and make sure the .NET Framework prerequisite matches what version your application targets and what version you used for the Launch Condition.

Bennir answered 21/3, 2023 at 15:4 Comment(0)
P
2

I can't reproduce this with those custom action parameters, so I'll list things you should look at:

  1. Be consistent on the architecture. If you have an install TargetPlatform of x86 use custom action code targeted with x86. The internals of InstallUtilLib will load a FW version and then try to load your classes with reflection, and an architecture mismatch can cause failures in that hosting Dll.

  2. Make sure you have the .NET FW installed for your custom actions.

  3. You don't need a NOT REMOVE condition on your commit CA. By definition it will be called only at the commit stage of the install.

  4. You must have the custom action on all the nodes of custom actions: install, commit, rollback, uninstall. There is some internal state carried between them and they are all necessary. Also, your code does not show any uninstall or rollback methods. It looks like you added this code manually rather than adding the installer class using a wizard.

Phycomycete answered 22/11, 2017 at 19:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.