Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > Conditional use of either x86 or x64 isolated COM component from manifest file
 

Conditional use of either x86 or x64 isolated COM component from manifest file

I have a C++ COM component being used from a ClickOnce application. It is used through isolated COM so that the COM component does not need to be registered onthe client machine. To date only an x86 version was used from the ClickOnce application which is compiled as AnyCPU.

The plan is to use a x64 version of the component when the target machine is x64 architecture however, I can not find a way to conditionally use the x64 or x86 version based on the clients machine. Is there a way to use the x64 version if the client's machine is x64 and use the x86 if the client's machine x86 with the same ClickOnce installation?
JDev3  Wednesday, September 30, 2009 3:46 PM

I'm assuming there is some way to tell programmatically if the user is running 32 or 64-bit, right?

So here's what I would do. I would deploy both versions, named whatever_32.whatever and whatever_64.whatever, probably in a subfolder.

When your app starts up, first thing off the bat, if ApplicationDeployment.CurrentDeployment.IsFirstRun is true, check the CPU type and copy the appropriate file up one level, renaming it to whatever.whatever.

IsFirstRun is true the first time the user runs the application after it is installed or updated.

If you wanted to do two builds, you could probably use post-build commands to copy the right one into the deployment, but doing two builds is a pain in the you-know-where.

RobinDotNet


Click here to visit my ClickOnce blog!
RobinDotNet  Wednesday, September 30, 2009 4:52 PM

I'm assuming there is some way to tell programmatically if the user is running 32 or 64-bit, right?

So here's what I would do. I would deploy both versions, named whatever_32.whatever and whatever_64.whatever, probably in a subfolder.

When your app starts up, first thing off the bat, if ApplicationDeployment.CurrentDeployment.IsFirstRun is true, check the CPU type and copy the appropriate file up one level, renaming it to whatever.whatever.

IsFirstRun is true the first time the user runs the application after it is installed or updated.

If you wanted to do two builds, you could probably use post-build commands to copy the right one into the deployment, but doing two builds is a pain in the you-know-where.

RobinDotNet


Click here to visit my ClickOnce blog!
RobinDotNet  Wednesday, September 30, 2009 4:52 PM

You can use google to search for other answers

Custom Search

More Threads

• SETUP n DEPLOYMENT
• ClickOnce and Certificates on Client PC ?
• Is ClickOnce now ClickTwice?
• software Update using Updater component Error!!!
• ClickOnce & System.IO.FileNotFoundException
• Registry REG_DWORD search
• ClickOnce deployed app does not see config file
• Downgrading, MinimumRequiredVersion Question
• Identifying COM components in a deployment project
• How to delete last 6 months data using storedprocedure where table does'nt contains timestamp field