Link to home
Avatar of EricTViking
EricTVikingFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Visual Studio Setup Project, Error 1001 When Using Custom Actions in Installer. Works on Vista, not on XP or 2k3.

I have a .Net solution in Visual Studio 2008 that consists of 3 VB.Net projects and a C# project. I created a setup project that pulls it all together into an MSI installer.

Works perfectly.

Until I added an installer class in my main project and added a custom action to the setup project to invoke it.

The resulting MSI works perfectly under Vista, calling the custom action and installing fine. When I run the installer under XP or Server 2k3, it gets right to the end and I get the following error:

Error 1001. Unable to get installer types in the C:\Program Files\MyApp\MyApp.exe assembly


Running the MSI on an XP Pro box with installer logging enabled I get the following log entry when it burps:

MSI (s) (CC!50) [15:40:42:796]: Creating MSIHANDLE (28) of type 790531 for thread 2640
DEBUG: Error 2835:  The control ErrorIcon was not found on dialog ErrorDialog
The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2835. The arguments are: ErrorIcon, ErrorDialog,
Error 1001. Error 1001. Unable to get installer types in the C:\Program Files\MyApp\MyApp.exe assembly. --> Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.


Any assistance in nailing this bug would be greatly appreciated!


PS. My custom action uses the following CustomActionData - "/INSTALLDIR="[TARGETDIR]/" /SQLSERVER=[TXTSQLSERVERNAME] /SQLUSER=[TXTSQLUSERNAME] /SQLPASSWORD=[TXTSQLPASSWORD]" and I notice that if I remove the trailing "/" from the INSTALLDIR part I get the above error when installing on Vista. Not sure if this is related but thought I'd mention it JIC.
Avatar of William Domenz
William Domenz
Flag of United States of America image

There are specific icons available for vista messages that are not found in xp...
I thnk you should perform a version check of the os and have 2 routines for your action based on OS rather than one...

You can most of the items needed for this in the Environment.OSVersion assemblies
or do a little testing with the following code....

This was converted from :
http://support.microsoft.com/kb/304283
Dim osInfo As System.OperatingSystem = System.Environment.OSVersion 
Select Case osInfo.Platform 
    Case System.PlatformID.Win32Windows 
        ' Platform is Windows 95, Windows 98, Windows 98 Second Edition, 
        ' or Windows Me. 
        
        Select Case osInfo.Version.Minor 
            Case 0 
                Console.WriteLine("Windows 95") 
                Exit Select 
            Case 10 
                If osInfo.Version.Revision.ToString() = "2222A" Then 
                    Console.WriteLine("Windows 98 Second Edition") 
                Else 
                    Console.WriteLine("Windows 98") 
                End If 
                Exit Select 
            Case 90 
                Console.WriteLine("Windows Me") 
                Exit Select 
        End Select 
        Exit Select 
    Case System.PlatformID.Win32NT 
        
        
        ' Platform is Windows NT 3.51, Windows NT 4.0, Windows 2000, or Windows XP. 
        
        Select Case osInfo.Version.Major 
            Case 3 
                Console.WriteLine("Windows NT 3.51") 
                Exit Select 
            Case 4 
                Console.WriteLine("Windows NT 4.0") 
                Exit Select 
            Case 5 
                If osInfo.Version.Minor = 0 Then 
                    Console.WriteLine("Windows 2000") 
                Else 
                    Console.WriteLine("Windows XP") 
                End If 
                Exit Select 
        End Select 
        Exit Select 
    
    
End Select 

Open in new window

Here is another one...
Converted from http://forums.msdn.microsoft.com/en-US/csharpgeneral/thread/5e4107b5-e480-4203-b0a1-8e2c717a9908/
Private Function GetOperatingSystemName() As String 
 
    
    Dim OSName As String = Nothing 
    
    Dim osInfo As System.OperatingSystem = System.Environment.OSVersion 
    
    Select Case osInfo.Platform 
        Case PlatformID.Unix 
            
            
            
            Exit Select 
        Case PlatformID.Win32NT 
            
            
            Select Case osInfo.Version.Major 
                Case 3 
                    
                    
                    
                    OSName = "Windows NT 3.51" 
                    
                    Exit Select 
                Case 4 
                    
                    
                    OSName = "Windows NT 4.0" 
                    
                    Exit Select 
                Case 5 
                    
                    
                    Select Case osInfo.Version.Minor 
                        Case 0 
                            
                            
                            
                            OSName = "Windows 2000" 
                            
                            Exit Select 
                        Case 1 
                            
                            
                            OSName = "Windows XP" 
                            
                            Exit Select 
                        Case 2 
                            
                            
                            OSName = "Windows 2003" 
                            
                            Exit Select 
                        Case Else 
                            
                            
                            Exit Select 
                        
                    End Select 
                    
                    Exit Select 
                Case 6 
                    
                    
                    OSName = "Windows Vista" 
                    
                    Exit Select 
                Case Else 
                    
                    
                    OSName = "Unknown Win32NT Windows" 
                    
                    Exit Select 
                
            End Select 
            
            Exit Select 
        Case PlatformID.Win32S 
            
            
            Exit Select 
        Case PlatformID.Win32Windows 
            
            
            Select Case osInfo.Version.Major 
                Case 0 
                    
                    
                    
                    OSName = "Windows 95" 
                    
                    Exit Select 
                Case 10 
                    
                    
                    If osInfo.Version.Revision.ToString() = "2222A" Then 
                        OSName = "Windows 98 Second Edition" 
                    Else 
                        OSName = "Windows 98" 
                        
                        
                        
                    End If 
                    
                    Exit Select 
                Case 90 
                    
                    
                    OSName = "Windows ME" 
                    
                    Exit Select 
                Case Else 
                    
                    
                    OSName = "Unknown Win32 Windows" 
                    
                    Exit Select 
                
            End Select 
            
            Exit Select 
        Case PlatformID.WinCE 
            
            
            Exit Select 
        Case Else 
            
            
            Exit Select 
        
    End Select 
    
    If osInfo.ServicePack IsNot Nothing Then 
        OSName += " " + osInfo.ServicePack 
        
    End If 
    
    
    
    Return OSName + String.Format(" ({0})", osInfo.VersionString) 
    
End Function 

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of EricTViking
EricTViking
Flag of United Kingdom of Great Britain and Northern Ireland image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
> Once again Crystal Reports wastes days of my time

the good rule of thumb - reject whatever is pushed at you, 'cause this can't be anything but spam.

Crystal reports in visual studio, throwing c'mons to buy full version - reject.

Obfuscator throwing c'mon's - reject.

Whatever is pushed, is practically always a junk - be it the miracles sold at "as seen on tv",  stock tips in your mailbox, trial tools included with visual studio, or trial antivirus preinstalled on new laptop. It's never anything but spam - in general.
yeah, sorry, should have put the comment after it's closed.
Avatar of LeonvWyk
LeonvWyk

<P>I had the same error but the cause was due to the formatting of the CustomActionData and using TARGETDIR. I changed my formatting and it worked.</P><P><STRONG>Wrong: </STRONG>/TARGETDIR=[TARGETDIR]<BR><STRONG>Wrong: </STRONG>/TARGETDIR=[TARGETDIR] /LAUNCHAPPLICATION=[LAUNCHAPPLICATION]<BR><STRONG>Wrong: </STRONG>/TARGETDIR=[TARGETDIR]/LAUNCHAPPLICATION=[LAUNCHAPPLICATION]<BR><STRONG></STRONG></P><P><STRONG>Correct: </STRONG>/TARGETDIR="[TARGETDIR]\"<BR><STRONG>Correct: </STRONG>/TARGETDIR="[TARGETDIR]\" /LAUNCHAPPLICATION=[LAUNCHAPPLICATION]</P><P>Remeber to use a space between paramters. You need a space before each new /</P>
Avatar of EricTViking

ASKER

For the crystal Reports induced problem that I had, i found an additional workaround that allows the reports to be included in the project:

Make sure the Crystal Reports Redistributables are added as a pre-requisite to the setup project - you can then include the *RPT files in your project and the installer won't give 1001 errors.

Alternatively make sure that CRRedist2008_x86.msi (or x64) is installed on the client machine before hand.

LeonWyk: Any chance you could re-post your workaround without the HTML tags? Looks like a useful suggestion!
I had the same error but the cause was due to the formatting of the CustomActionData and using TARGETDIR. I changed my formatting and it worked.
Wrong: /TARGETDIR=[TARGETDIR]
Wrong: /TARGETDIR=[TARGETDIR] /LAUNCHAPPLICATION=[LAUNCHAPPLICATION]
Wrong: /TARGETDIR=[TARGETDIR]/LAUNCHAPPLICATION=[LAUNCHAPPLICATION]

Correct: /TARGETDIR="[TARGETDIR]\"
Correct: /TARGETDIR="[TARGETDIR]\" /LAUNCHAPPLICATION=[LAUNCHAPPLICATION]

Remeber to use a space between paramters. You need a space before each new /