Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > Conditional installation of 64-bit crystal reports after detecing CPU
 

Conditional installation of 64-bit crystal reports after detecing CPU

IDE: VS2005 PRO
Language: VB 2005

I have an application which uses Crystal Reports X (CRX)and installs fine on x86 machines. I have issues with x64 bit machines since the package included in the setup project is not the x64 Crystal Reports executable.

1. How do I add the x64 bit CR into my setup project?
2. How do I detect the CPU type (x84 or x64) the installer is running on?
3. How do I interrupt the current setup procedure to install the x64 version of CR rather than the x84 version?

Please help!

engrforever  Wednesday, June 24, 2009 8:17 PM

You only care about this if you have code that's built and running in native x64 mode. Most 32-bit apps work fine on x64 systems, and I strongly suspect that Crystal Reports is no different. I'd verify that the problem you're seeing is really a Crystal issue. The most likely cause of what you're seeing is that you have .NET code built as AnyCpu (MSIL) so when you run it on an x64 system it runs native x64 and can't use x86 Crystal. Unless you are determined that your app will run all native x64, just make sure all the builds are creating x86 ILinstead of AnyCpu MSIL.

If you do want a native x64 app then you'll need another setup project, this one marked as x64 in the properties, and that assumes that Crystal supplies x64 support. Build everything as x64, and this setup will install only on x64 systems.


Phil Wilson
  • Marked As Answer byengrforever Tuesday, June 30, 2009 2:36 PM
  •  
PhilWilson  Thursday, June 25, 2009 12:11 AM

You only care about this if you have code that's built and running in native x64 mode. Most 32-bit apps work fine on x64 systems, and I strongly suspect that Crystal Reports is no different. I'd verify that the problem you're seeing is really a Crystal issue. The most likely cause of what you're seeing is that you have .NET code built as AnyCpu (MSIL) so when you run it on an x64 system it runs native x64 and can't use x86 Crystal. Unless you are determined that your app will run all native x64, just make sure all the builds are creating x86 ILinstead of AnyCpu MSIL.

If you do want a native x64 app then you'll need another setup project, this one marked as x64 in the properties, and that assumes that Crystal supplies x64 support. Build everything as x64, and this setup will install only on x64 systems.


Phil Wilson
  • Marked As Answer byengrforever Tuesday, June 30, 2009 2:36 PM
  •  
PhilWilson  Thursday, June 25, 2009 12:11 AM
PhilWilson,

Thank you very much for taking the time to provide me with your wisdom.
Here is the error I was receiving.

Your advice seems to have fixed my problem! I set my source code project "Advanced Compile Options... >> Target CPU" to x86 and everything works.

Now, pleasehelp me understand your last paragraph. If I want to have a true x64 bit executable to utilize the performance features of the x64 processors, what are the exact steps I need to follow?

1. Buildtwo different source code executables (x84 & x64)?
2. Build two different setup projects each respective to x84 and x64?
3. When I have two setup projects and during deployment, how would I control which one to execute from the sameCD?

Also, what is the use of "Any CPU" if it does not truely target x64? Does "Any CPU" refer to AMD and INTEL x84?

Please advice, I am trying to learn this installation and deployment process as professional as possible. Thank you very much for your time!
engrforever  Thursday, June 25, 2009 1:50 PM
Hi engrforever

Based on my understanding of PhilWilson's suggestion, you'd better not mix two platforms into a single application, build the one totally for x86 with x86 CR as prerequisite, and another build for x64 with x64 CR as prerequisite. So that x86 package can work properly for both CPU(wow mode under x64 OS). The x64 package will work perfect on x64 OS. You can put both on a CD and tell your user to install correct one based on their OS.

Since we are at the age of converting from x86 to x64, the compatible problem cannot be avoid. To build separate package for different platform can be a better choice.

Sincerely,
Kira Qian
Please mark the replies as answers if they help and unmark if they don't.
Kira Qian  Friday, June 26, 2009 6:48 AM
Kira,

help me address one of the questions, you did attend to:

"Also, what is the use of "Any CPU" if it does not truely target x64? Does "Any CPU" refer to AMD and INTEL x84?Also, what is the use of "Any CPU" if it does not truely target x64? Does "Any CPU" refer to AMD and INTEL x84?"

Another question:

If I wanted to automate the installation process, how would I do it?

For example, if the CPU and OS is truely 64bit, how can I detect that during install and automatically select the x64 installation?

thank you!
engrforever  Friday, June 26, 2009 2:01 PM
Hi engrforever,

Any CPU mean your application can run on x86 OS under x86 mode, also it can run under x64 CPU under x64 mode. If you build it with x86, it will run on both x86 and x64 but all with x86 mode(wow on x64 os). Only if your user have x64 os, he can run x64. There is no way to package x86 assembly along with x64 assembly into one package. So you need two packages.

Any more, if a truely x64 os running your x86 application, it should run properly. If you look into x64 Vista's task manager, many famous software are also run as 32*.

Sincerely,
Kira Qian
Please mark the replies as answers if they help and unmark if they don't.
Kira Qian  Monday, June 29, 2009 2:36 AM
Kira's covered it, but AnyCpu means that the intermediate code generated by the compiler will JIT tonative x86 on an x86 system andnative x64 on x64 systems. That's all fine if everything you use is .NET code that was built with AnyCpu, but it's not. I suspect that the Crystal code is 32-bit only, and 64-bit code (that's yours) cannot call into a 32-bit Dll. If there is COM registration for a 32-bit Dll then a native x64 app (yours again) won't locate it. When you make everything 32-bit it all works because all the code and any registration is in the 32-bit world.
Phil Wilson
PhilWilson  Monday, June 29, 2009 9:26 PM

You can use google to search for other answers

Custom Search

More Threads

• Problems with setup project - am I thick?
• How does the installer test for .Net?
• How do I get a NEWLINE in the Launch Condition Properties -> Message?
• no-touch deployment - speed of initial dll call
• VS2005 Professional - Setup Project Wizard - says feature not implemented!!?
• Vb 2005 application and Quickbooks SDK (QBFC) deployment
• Q305624 hosting controls from the filesystem
• Creating single setup.exe file for setup project
• over write newer files that do not support versioning
• GAC Assembly not present until after reboot