Community Forums
Results 1 to 2 of 2

Thread: Error 1001. Installer Was Not Working

  1. #1
    Join Date
    Oct 2017
    Posts
    3

    Post Error 1001. Installer Was Not Working

    I created Visual Studio 2013(Professional) Windows Application with .Net 4.5 frame work. In This solution I added new class file Installer class file.
    Sample Code:
    namespace WindowsFormsApplication1
    {
    [RunInstaller(true)]
    public class AddinInstaller : Installer
    {
    #region Base Implementation
    private System.ComponentModel.IContainer components = null;
    protected override void Dispose(bool disposing)
    {
    if (disposing && (components != null))
    {
    components.Dispose();
    }
    base.Dispose(disposing);
    }
    private void InitializeComponent()
    {
    components = new System.ComponentModel.Container();
    }
    #endregion

    public AddinInstaller()
    {
    InitializeComponent();
    }
    public override void Install(IDictionary stateSaver)
    {
    try
    {
    base.Install(stateSaver);
    Debugger.Launch();

    Assembly Asm = Assembly.GetExecutingAssembly();
    FileInfo asmFile = new FileInfo(Asm.Location);


    }
    catch (InstallException ex)
    {
    throw new InstallException(ex.Message);
    }
    catch
    {
    throw new InstallException("Error installing addin!");
    }
    }

    public override void Uninstall(IDictionary savedState)
    {
    try
    {

    }
    catch
    {

    }

    base.Uninstall(savedState);
    }
    }
    }


    Now I created new Install Shiled Project with 2015LE with .Net 4.5 frame wok.
    I checked the Installer Class checkbox on the COM & .NET Settings tab on the Properties window of the Primary Output file.
    Once done build and I am installing this setup. I got This error "1001".
    Please provide solution for this one.
    Thank you
    Last edited by mvijaykumarredd; 10-16-2017 at 06:03 AM.

  2. #2
    Join Date
    Aug 2005
    Posts
    537
    As a rule of thumb, don't use installer classes. You really want to do all that configuration work in the installer, and not in .Net code--because the installer has all kinds of functionality provided for it--install, modify, rollback, etc. service registration, GAC installation, etc. In fact, once upon a time, adding a new installer class to a .Net project would include in the template code a bug which would produce -1001 errors on modify/repair. (I don't know if this is still the case, tbh)

    Other reasons to avoid installer classes:

    -It's hard to get to the root of a -1001 error (usually not logged in the MSI log; have to chase down the installer class log, and have the good fortune to have it logged there)
    -Almost all errors show up as -1001 errors, despite having a variety of causes
    -Registration is dependent on the application having everything in order at the time of registration (may not be if you have dependencies in the GAC)

    My advice is to make a list of all the stuff you need to do, and one by one look up how to accomplish it in native installer functionality. It may be more work figuring it out if you're much more a .Net dev than an installer dev, but it's going to be easier to live with in the long run.
    Cary R.
    Configuration Engineer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •