locked
VS 2010 Custom Action - Error 1001 Unable to get installer type .... RRS feed

  • Question

  • Hi all,

    I have upgraded my project from vs2008 sp1 to vs2010 v.10.0.30319.1 RTMRel Ultimate Edition.

    I got an error 1001 Unable to get installer type... during running setup if my setup includes a custom action (note: for testing I just include a custom action without any custom code)
    The error message I got from Fusion Log Viewer is as shown below.
    Based on the error log my application could not load my mixed mode library in .net 4 without additional configuration.  So I modify the config as shown in my app config (note: all projects are using .net 4 setting)

      <startup useLegacyV2RuntimeActivationPolicy="true">
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
      </startup>
     
    Now, I can run my application without error in .net 4 but the setup still fail for error 1001.
    I have tried to narrow down where the problem is and I found out that
    If I just include a variable that references to an enumeration of my mixed mode library then I got error 1001

    example code:
    Public Class Form1
        Private m_enOperation As Company.MixedModeLib.OperationTypeEnum
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        End Sub
    End Class
     

    OperationTypeEnum is the enumeration in my library and the variable enOperation  declared in the member of my form will create the problem.
    If I declare the variable enOperation  as local then it would not fail during setup.
    I really has no clue why the setup of vs2010 fail in this scenario.
    My mixed mode library (MC++) developed with .net 1.1 v1.1.4322 sp1 in VS2003  and the installation is performed on Windows XP sp3 (my development pc).
    I though after I modified the app config useLegacyV2RuntimeActivationPolicy="true" to allow my application to load my mixed mode library in .net 4 would solve the installation issue but it is not
    I also tried to create a new test application in vs2010 .net 4 and incude my mixed mode library and declare a variable as described above and I got the same issue if using custom action in setup

    It seems that VS 2010 tries to load my mixed mode library without taking into the app configuration setting during setup if I use custom action.

    Is this VS 2010 bug?


    I really appreciate for any help.

    *** Assembly Binder Log Entry (10/20/2010 @ 11:48:32 AM) ***
    The operation failed.
    Bind result: hr = 0x80004005. Unspecified error
    Assembly manager loaded from: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\clr.dll
    Running under executable C:\WINDOWS\system32\MsiExec.exe
    --- A detailed error log follows.
    === Pre-bind state information ===
    LOG: User = CompanyNT\Tester

    LOG: DisplayName = Company.MixedModeLib, Version=2.1.0.1, Culture=neutral, PublicKeyToken=2d3497331b752ad6

     (Fully-specified)

    LOG: Appbase = file:///C:/WINDOWS/system32/

    LOG: Initial PrivatePath = NULL

    LOG: Dynamic Base = NULL

    LOG: Cache Base = NULL

    LOG: AppName = MsiExec.exe

    Calling assembly : TestCustomAction, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.

    ===
    LOG: This bind starts in LoadFrom load context.

    WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().

    LOG: No application configuration file found.

    LOG: Using host configuration file: C:\DOCUME~1\Tester~1\LOCALS~1\Temp\CFGC05.tmp

    LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\config\machine.config.

    LOG: Post-policy reference: Company.MixedModeLib, Version=2.1.0.1, Culture=neutral, PublicKeyToken=2d3497331b752ad6

    LOG: GAC Lookup was unsuccessful.

    LOG: Attempting download of new URL file:///C:/WINDOWS/system32/MixedModeLib.dll.

    LOG: Attempting download of new URL file:///C:/WINDOWS/system32/Company.MixedModeLib/MixedModeLib.dll.

    LOG: Attempting download of new URL file:///C:/WINDOWS/system32/Company.MixedModeLib.EXE.

    LOG: Attempting download of new URL file:///C:/WINDOWS/system32/Company.MixedModeLib/Company.MixedModeLib.EXE.

    LOG: Attempting download of new URL file:///C:/Program Files/Company/TestCustomActionSetup/MixedModeLib.dll.

    LOG: Assembly download was successful. Attempting setup of file: C:\Program Files\Company\TestCustomActionSetup\MixedModeLib.dll

    LOG: Entering run-from-source setup phase.

    LOG: Assembly Name is: Company.MixedModeLib, Version=2.1.0.1, Culture=neutral, PublicKeyToken=2d3497331b752ad6

    LOG: Where-ref bind Codebase does not match what is found in default context. Keep the result in LoadFrom context.

    LOG: Binding succeeds. Returns assembly from C:\Program Files\Company\TestCustomActionSetup\MixedModeLib.dll.

    LOG: Assembly is loaded in LoadFrom load context.

    ERR: Rejecting IJW module built against v1.1.4322 because it could be loaded into another runtime in this process.

    ERR: Rejecting IJW module built against v1.1.4322 because it could be loaded into another runtime in this process.

     

     

     


     

     

     

    • Moved by Figo Fei Thursday, October 21, 2010 8:05 AM (From:Visual Studio Setup and Installation)
    Wednesday, October 20, 2010 4:49 PM

Answers

  • PhilWilson,

    Thanks for pointing me to that article.

    But, the article you mentioned was dated back then 2007 which VS2010 was not released yet.

    I have no problem when creating setup using custom action with .net 3.5 from vs2008 even in Vs2010.

    Only if I specifiy the framework 4 in application then it would be a problem and even there is not a single line of code in the custom action file.

    So it would be obviously the msi needs to load the application in order to execute the custom action code and therefore it would need to load the mixed mode library in .net 1.1. Eventually, msi failed to load both .net 4 and 1.1 into the process.

    Based on this scenario, I have tried to create a .net 4 application to handle specifically for the custom action only and call the this custom action during the setup then it works since msi does not have to load different .net framework version into the process and it can perform custom action code (of course no code refers to other .net framwork)

    It is a work-around solution to handle the loading issue between  .net 4 and legacy .net framework library in mixed mode

    Thanks

    • Marked as answer by thichcoiphim2 Friday, July 27, 2018 6:41 PM
    Friday, October 22, 2010 8:22 PM

All replies

  • Moved to Setup project forum for further response.

    Thanks.


    Figo Fei
    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.
    Thursday, October 21, 2010 8:05 AM
  • Hi thichcoiphim,

     

    Did you add custom action to the ROOT node of custom action tree in Visual Studio setup project? If you only add action to the sub node, sometime it will cause error 1001.

    http://www.codeproject.com/KB/install/Installation.aspx

     

    Look into the “Add a new custom action to the root Custom Actions node” screenshot.

     

    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!
    Friday, October 22, 2010 2:55 AM
  • Kira,

    I did add from the root node and have tried different ways but it still fails. 

    I would consider this as a bug in Vs2010 and I report in connect with sample code of library and application in vs2010

     

    http://connect.microsoft.com/VisualStudio/feedback/details/615378/vs-2010-custom-action-error-1001-unable-to-get-installer-type

    Friday, October 22, 2010 12:10 PM
  • Visual Studio appears to have nothing to do with this, and the app config file is irrelevant. You're not running your code in any kind of application environment. It's running as a plug-in called by an msiexec.exe process that knows nothing about any app config files you've installed.  It's not an application - if msiexec.exe is trying to load your Dll thwn you've got an installer class, not an application.  It looks like msiexec.exe isn't going to load multiple versions of the runtime so you can call your assembly, and the Windows Installer time doesn't support that kind of custom action anyway, and this behavior here seems to describe what you are seeing: 

    http://robmensching.com/blog/posts/2007/4/19/Managed-Code-CustomActions-no-support-on-the-way-and-heres 

    If you want to run an application, create your code as as executable and run that as a custom action, it will use your app config and have a much better chance of working. 


    Phil Wilson
    Friday, October 22, 2010 5:40 PM
  • PhilWilson,

    Thanks for pointing me to that article.

    But, the article you mentioned was dated back then 2007 which VS2010 was not released yet.

    I have no problem when creating setup using custom action with .net 3.5 from vs2008 even in Vs2010.

    Only if I specifiy the framework 4 in application then it would be a problem and even there is not a single line of code in the custom action file.

    So it would be obviously the msi needs to load the application in order to execute the custom action code and therefore it would need to load the mixed mode library in .net 1.1. Eventually, msi failed to load both .net 4 and 1.1 into the process.

    Based on this scenario, I have tried to create a .net 4 application to handle specifically for the custom action only and call the this custom action during the setup then it works since msi does not have to load different .net framework version into the process and it can perform custom action code (of course no code refers to other .net framwork)

    It is a work-around solution to handle the loading issue between  .net 4 and legacy .net framework library in mixed mode

    Thanks

    • Marked as answer by thichcoiphim2 Friday, July 27, 2018 6:41 PM
    Friday, October 22, 2010 8:22 PM
  • > So it would be obviously the msi needs to load the application in order to execute the custom action code

     

    Windows Installer only needs to load the assembly which contains the custom action code. If you define the custom action code (Installer class) in separate dll, that dll should be loaded by the Windows Installer.

     

    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, October 26, 2010 8:24 AM
  • I found a solution to this.

    Similar to the original question I had upgraded as vs2005 project to vs2010 and that included three deployment projects.

    When I hit this error, it was relating to a service which is installed by custom actions. The service had been added to the custom actions root in vs 2005. However I had not removed it and re-added it in vs 2010 - when I did exactly that the problem went away. I therefore think there's a bug in the vs 2010 upgrade program but I don't really have the time to prove this.

    So the solution in my case was to remove the custom action from each step and then re-add it to the custom actions root.

    HTH

     

     


    • Proposed as answer by BobTD Sunday, March 27, 2011 10:18 AM
    Sunday, March 27, 2011 10:17 AM
  • Also check, if you get this error, that all DLL's the custom action requires are actually present. I hit that problem also with vs2010sp1 deployment projects.

     

    Tuesday, March 29, 2011 4:10 PM