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=[TXTSQLSERVERNA ME] /SQLUSER=[TXTSQLUSERNAME] /SQLPASSWORD=[TXTSQLPASSWO RD]" 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.
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]/
Here is another one...
Converted from http://forums.msdn.microsoft.com/en-US/csharpgeneral/thread/5e4107b5-e480-4203-b0a1-8e2c717a9908/
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
see the post by ejsmith at http://community.codesmithtools.com/forums/p/934/4019.aspx
ASKER CERTIFIED SOLUTION
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.
> 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.
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.
<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>Wron g: </STRONG>/TARGETDIR=[TARGE TDIR]<BR>< STRONG>Wro ng: </STRONG>/TARGETDIR=[TARGE TDIR] /LAUNCHAPPLICATION=[LAUNCH APPLICATIO N]<BR><STR ONG>Wrong: </STRONG>/TARGETDIR=[TARGE TDIR]/LAUN CHAPPLICAT ION=[LAUNC HAPPLICATI ON]<BR><ST RONG></STR ONG></P><P ><STRONG>C orrect: </STRONG>/TARGETDIR="[TARG ETDIR]\"<B R><STRONG> Correct: </STRONG>/TARGETDIR="[TARG ETDIR]\" /LAUNCHAPPLICATION=[LAUNCH APPLICATIO N]</P><P>R emeber to use a space between paramters. You need a space before each new /</P>
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!
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=[LAUNCH APPLICATIO N]
Wrong: /TARGETDIR=[TARGETDIR]/LAU NCHAPPLICA TION=[LAUN CHAPPLICAT ION]
Correct: /TARGETDIR="[TARGETDIR]\"
Correct: /TARGETDIR="[TARGETDIR]\" /LAUNCHAPPLICATION=[LAUNCH APPLICATIO N]
Remeber to use a space between paramters. You need a space before each new /
Wrong: /TARGETDIR=[TARGETDIR]
Wrong: /TARGETDIR=[TARGETDIR] /LAUNCHAPPLICATION=[LAUNCH
Wrong: /TARGETDIR=[TARGETDIR]/LAU
Correct: /TARGETDIR="[TARGETDIR]\"
Correct: /TARGETDIR="[TARGETDIR]\" /LAUNCHAPPLICATION=[LAUNCH
Remeber to use a space between paramters. You need a space before each new /

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
Open in new window