none
Error 1001. Unable to get installer types in the c:\program files (x86)\...

    Question

  • I have a winform application in Visual Studio 2008.  It uses Crystal Reports 11.5 R2.  I have created a setup project which I am trying to debug.  There are two problems which may be related.  First, when I add myapp.exe to the files to install in the applications folder, Visual Studio checks its dependencies and wants to include crystalreports11_5_net_2005.msm.  I really don't know if that is the correct merge module, but that is what it added.  When I run my install on a test computer, I get the following unexpected results:

    1. There are files in my application folder related to crystal reports that should not be there.  They look like files that are needed for web application deployments, not windows application deployments.  They are in sub-folders called 'css', 'js', 'images', 'html', and 'prompting'.  My suspicion is that I have the wrong crystal reports merge module.  However, since someone at Microsoft decided to slap .NET on every development tool name (bless them), it is hard to separate the real internet development (web page) stuff from the windows desktop stuff.

    2. When I run the install, it fails with the message: "Error 1001. Unable to get installer types in the C:\Program Files (x86)\Market Drive\MarketDrive.exe assembly -> Unable to load one or more of the requested types.  Retrieve the LoadExceptions property for more information.

    I have no idea how to 'retrieve the loadexceptions property' for more information.  I have searched this forum and the web for some ideas.  Some suggest using fuslogvw.exe to see what won't load.  Problem is I cannot find that program.  Some say it is included in the windows development SDK (which I have an it isn't).  Other suggest the Visual Studio 8.0 SDK, which I have downloaded, installed, and still cannot find the file. 

    I believe the error message comes up when my install gets to the point where it has to run my custom actions, which are included in the installer class in my application (MarketDrive.exe).  While MarketDrive.exe is installed on the computer where it is supposed to be, the installer may not be able to load it because the crystal reports pieces are not installed correctly.  All of this is speculation.

    Any ideas would be greately appreciated, including where to find fuslogvw.exe.

    Thanks!

    Andy

    Monday, May 10, 2010 7:00 PM

Answers

All replies

  • On 1., I don't know. If the Crystal Merge Mdule includes then that's what you'll get. You could open that mergfe module with Orca and look at the file table to verify that those files are actually in there.  They might look like web things, but if Crystal have a UI somewhere that's HTML based that's what you'd see.

    2. What dependent assemblies does your exe need? That might be something to do with it, especially if those dependent assemblies are being installed in the GAC.  Install er types means classes marked as RunInstaller or whatever that attribute is, so that your installer classes can be loaded and instantiated.


    Phil Wilson
    Monday, May 10, 2010 7:23 PM
  • Hi Phil.

    Thank you for the reply.  As I look into the answer to your question, I have another.  When your application includes references to third party .net DLLs (the references you would see on the references tab of the applications project properties window), where are those .dlls supposed to be located?  For my application, I see references to dlls in the bin folder and it is those dlls which do not appear to included in the setup program.

    Is there a 'best practice' for putting all the stuff that your project needs that is not part of the .net framework?

    Andy

    Monday, May 10, 2010 7:58 PM
  • Hi Phil.

    I think I have a little more information.  When I run the install and get to the point where I think it is about to run my custom action and I get the error saying it cannot load my application's exe... I switch over the the install directory and run the exe manually.  Sure enough, it runs to a point, then gets an error saying it cannot find 'CrystalReports.shared'. 

    Now it actually did run some startup code before it failed, so could it be that what is causing the failure is the code in my custom action?  My custom action overrides the commit event as follows:

     

    ' Change the permissions to hlkm\software\marketdrive so that all users have access to it (no restrictions)

    Public Overrides Sub Commit(ByVal savedState As System.Collections.IDictionary)

     

    Dim regkey As Microsoft.Win32.RegistryKey

     

    Dim accessRule As System.Security.AccessControl.RegistryAccessRule

     

    Dim regSecurity As System.Security.AccessControl.RegistrySecurity

    MsgBox(

    "Start of commit event. About to run mybase.commit()", MsgBoxStyle.Information)

     

    ' Let the base class do its commit work.

     

    MyBase.Commit(savedState)

    ... (my custom code is here).

    The important thing to note is I do NOT get the first message box at the start of this event. 

    Andy

    Monday, May 10, 2010 8:45 PM
  • Hi Phil.

    More information.  When I change my install NOT to run my custom install action, the install goes through fine... the application starts.  The first line of my custom install action is to bring up a message box, which does not get displayed.  Therefore, it seems to me that the problem occurs when trying to call my custom install action, which is packaged inside my main applications executable as an installerclass.  In addition, it seems that at the point in the install process where it is trying to call the custom commit function, the crystal reports component is not completely installed.  This seems like a catch 22... I have to wait until the end for the merge module to finalize everything but I cannot wait until the end to do my custom action.

    Andy

    Monday, May 10, 2010 11:50 PM
  • Hi andy,

     

    > Is there a 'best practice' for putting all the stuff that your project needs that is not part of the .net framework?

     

    If you only need Crystal Report runtime to run your application, you can set it as prerequisite in your setup project. You don’t need to use merge module in this case if you don’t want to share some modules with other application.

     

    For your custom action, I think you need to override the OnCommitted method instead of Commit. Have you shown us the complete code of your override Commit method? The code doesn’t seem to cause the problem. I suggest you to override the OnCommitted method and copy the code into it. Put “System.Diagnostics.Debugger.Break()” in your code to see where the exception occur.

     

    Sincerely,

    Kira Qian

    MSDN Subscriber Support in Forum

    If you have any feedback on our support, please contact msdnmg@microsoft.com
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework!
    Tuesday, May 11, 2010 7:42 AM
  • This is confusing to me.  When I add an installer class object to my application, I can only see a bunch of events (not methods) that I can handle (not override).  They are:

    AfterInstall, AfterRollBack, AfterUninstall, BeforeInstall, BeforeRollBack, BeforeUninstall, Committed, Committing, Disposed.

    Since there are events, not methods, I don't understand how to override the committed method you speak of.  Can you point me to an example?

    At the moment, I have tried to work around the problem by creating a separate executable with no dependencies (other than the framework).  I have added my installer class to that executable and added the excecutable to the list of times called during the commit phase of the install.  At the moment, I am getting an error 1001 that says it is unable to find the myapp.installstate file.  Very frustrating.

    Tuesday, May 11, 2010 4:08 PM
  • I cannot seem to get rid of the error during the install where is stops with the error 1001 (unable to find the myapp.installstate file).  Please help!

    Tuesday, May 11, 2010 5:21 PM
  • You've got a different error? Previously it was not finding installer types, but now it's the installstate file?  I think we need a sanity check here: What methods or events are you now overriding in your installer class?  If all you have is a Commit, then you need to be sure that you have called Install too, even if it's just the base class.


    Phil Wilson
    Tuesday, May 11, 2010 5:47 PM
  • Hi Phil.

    Let me clear that up.  I have been unable to successfully call a custom action which I need to do a couple of tasks.  That is still the end goal.  To that end, I have added a class module to my applications executable.  When I added the class, I chose the template 'Installer Class".

    Currently, it looks like this:

     

     

    Imports System.ComponentModel
    Imports System.Configuration.Install
    
    Public Class InstallCustomActions
    
      Public Sub New()
    
        ' Initialize the base class
        MyBase.New()
    
        ' This call is required by the Component Designer.
        InitializeComponent()
    
      End Sub
    
      ' Override the 'Commit' method of the Installer class.
      Public Overrides Sub Commit(ByVal mySavedState As IDictionary)
    
        Dim regkey As Microsoft.Win32.RegistryKey
        Dim accessRule As System.Security.AccessControl.RegistryAccessRule
        Dim regSecurity As System.Security.AccessControl.RegistrySecurity
        Dim directory As String
    
        MsgBox("About to call the base class commit method", MsgBoxStyle.Information)
    
        ' Call the base class commit
        MyBase.Commit(mySavedState)
    
        MsgBox("About to modify access of HKLM\Software\MarketDrive", MsgBoxStyle.Information)
    
        ' Open the registry key "hlkm\software\marketdrive" which should have already existed or 
        ' which was created in a prior install step (see registry editor tool in setup/install project)
        regkey = My.Computer.Registry.LocalMachine.OpenSubKey("Software\MarketDrive", True)
        If (regkey IsNot Nothing) Then
    
          ' Get all of the security settings for the registry key
          Try
            regSecurity = regkey.GetAccessControl
          Catch ex As SystemException
            MsgBox("Unable to get the current security settings for HKLM\Software\MarketDrive. " & _
                Err.Description & " [" & Err.Number.ToString & "]", MsgBoxStyle.Critical)
            Throw New InstallException
          End Try
    
          ' Add a new rule giving everyone full control of the key
          Try
            accessRule = New System.Security.AccessControl.RegistryAccessRule("Everyone", Security.AccessControl.RegistryRights.FullControl, Security.AccessControl.AccessControlType.Allow)
            regSecurity.AddAccessRule(accessRule)
          Catch ex As SystemException
            MsgBox("Unable to modify security settings for HKLM\Software\MarketDrive. " & _
                Err.Description & " [" & Err.Number.ToString & "]", MsgBoxStyle.Critical)
            Throw New InstallException
          End Try
    
          ' Save the new set of security settings
          Try
            regkey.SetAccessControl(regSecurity)
          Catch ex As SystemException
            MsgBox("Unable to save new security settings for HKLM\Software\MarketDrive. " & _
                Err.Description & " [" & Err.Number.ToString & "]", MsgBoxStyle.Critical)
            Throw New InstallException
          End Try
    
          ' Close the registry
          regkey.Close()
    
        End If
    
        MsgBox("About to modify virtualization settings of HKLM\Software\MarketDrive", MsgBoxStyle.Information)
    
        ' Make sure the registry key "hlkm\software\marketdrive" does not get virtualized. Virtualization effectively means 
        ' different users on the same machine get their own copy of these settings, rather than sharing one set. 
        If Launch("reg", _
             "flags " & Chr(34) & "HKLM\" & LocalMachineAppSectionName() & Chr(34) & " SET DONT_VIRTUALIZE_RECURSE_FLAG /S", _
             Environment.SystemDirectory, _
             ProcessWindowStyle.Hidden, _
             True) = FunctionEndedResult.FAILURE Then
          MsgBox("Unable to modify virtualization setting for HKLM\" & LocalMachineAppSectionName() & "." & _
              Err.Description & " [" & Err.Number.ToString & "]", MsgBoxStyle.Critical)
          Throw New InstallException
        End If
    
        MsgBox("End of commit event.", MsgBoxStyle.Information)
    
        ' The Crystal Reports 11.5 merge module added a whole bunch of files that appear to be for web applications, 
        ' not windows applications. Delete them all now.
        directory = "c:\program files (x86)\Market Drive\css" ' todo: use the application folder path rather than hardcoding
        If System.IO.Directory.Exists(directory) = False Then
          DeleteDirectory(directory, False)
        End If
        directory = "c:\program files (x86)\Market Drive\html"
        If System.IO.Directory.Exists(directory) = False Then
          DeleteDirectory(directory, False)
        End If
        directory = "c:\program files (x86)\Market Drive\images"
        If System.IO.Directory.Exists(directory) = False Then
          DeleteDirectory(directory, False)
        End If
        directory = "c:\program files (x86)\Market Drive\js"
        If System.IO.Directory.Exists(directory) = False Then
          DeleteDirectory(directory, False)
        End If
        directory = "c:\program files (x86)\Market Drive\prompting"
        If System.IO.Directory.Exists(directory) = False Then
          DeleteDirectory(directory, False)
        End If
    
      End Sub
    
    End Class
    

    I have been struggling to get the install to run this code.  Whe install reaches the point where it needs to call this custom action, it always fails.  The first problem was that my application.exe would not load at the point there the custom action needed to be called.  That was because it depends on crystal reports which was not fully installed at that point in the install routine (a catch 22).  I worked around that problem by moving the installer class from my main application's exe to a smaller utility .exe which has no dependencies other than the .net framework.

    However, that left me with my current error, which is that when I get to the same point, I get an error 1001 stating is is unable to find the file c:\program files (x86)\market drive\mdadmintools.installstate (mdadmintools is the name of the smaller .exe which I put the installer class containing my custom action above.

    I have been spending large amounts of time trying to figure out how to get my custom action to run.  It is just one routine that changes some security settings and cleans up some files.  Such a simple thing... yet so elusive.

    Tuesday, May 11, 2010 6:21 PM
  • My point still holds true - are you calling the Install method? Even just the base method, you must add the Install custom action.  The installstate file is created by the Install method so it must be called.


    Phil Wilson
    Tuesday, May 11, 2010 7:14 PM
  • Hi Phil.

    I think I am doing it correctly. 

    After adding the installer class and creating a .exe file, I go to my setup project, right click the top level node, choose view->custom actions.  I then go the commit node of the custom action viewer and add my .exe to that node.  In the properties of the .exe added to the custom action node, I set InstallerClass = True.

    I thought that is all I was supposed to do.  Did I miss a step?

    Andy

    Tuesday, May 11, 2010 7:50 PM
  • Hi Andy,

     

    Please try to add custom action to the ROOT Node of custom action view.

     

    Sincerely,

    Kira Qian

    MSDN Subscriber Support in Forum

    If you have any feedback on our support, please contact msdnmg@microsoft.com
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework!
    • Marked as answer by andy pelkey Wednesday, May 12, 2010 4:33 AM
    Wednesday, May 12, 2010 1:58 AM
  • This worked!  Thank you for the suggestion!  I must say this is not obvious or intuitive.  The examples I reviewed, including those in my MCTS book only instructed me to add the action to the commit node since all I was writing was something override the commit method. 

    I cannot believe how much time I have wasted on this problem!

    Still, the event don't run entire successfully, because the installation really isn't far enough along.  You mentioned yesterday that I should override the committed method rather than the commit method to ensure more things were wrapped up.  Is there really such a method to override or are you thinking of the commiteed event?

    My custom action tries to remove extraneous files put there by the crystal reports merge module.  Some of them can be deleted from the commit method, but I get an 'access denied' message on others.  Clearly things aren't quite as far long in the install process to do this.  Is there an example you can point me to that shows how to override the committed method?

    Thanks!

    Wednesday, May 12, 2010 4:33 AM
  • Hi Andy,

     

    Some files that cannot be deleted might be occupied. You’d better not delete them. There is no mystery of override Commit method. Your code structure is correct. Put your custom code before base method is called. You can also try handling the Committed event. That equals to override the method.

     

    Sincerely,

    Kira Qian

    MSDN Subscriber Support in Forum

    If you have any feedback on our support, please contact msdnmg@microsoft.com
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework!
    Wednesday, May 12, 2010 8:12 AM
  • As Kira says and I have tried to say too, you MUST have the Install method called to create the installstate file.
    Phil Wilson
    Wednesday, May 12, 2010 7:07 PM
  • The confusion was over how to call the install method. Looking back, I don't see anything that would have told me I was doing it incorrectly.

    Wednesday, May 12, 2010 7:26 PM
  • I found that I needed to manually include the CrystalDecisions.CrystalReports.Engine.dll, CrystalDecisions.ReportSource.dll, and the CrystalDecisions.Shared.dll in my setup project because they were not included in the Detected Dependencies.

    Monday, April 23, 2012 2:11 PM