Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Identifying target machine (32 bit or 64 bit) with ClickOnce deployment

I have a Windows Forms application and am deploying that application through ClickOnce deployment. Now, I've a third-party DLL file and it has different versions for 32-bit and 64-bit OS.

Is it possible to deploy different DLL files based on the target machine (32-bit or 64-bit) through ClickOnce?

like image 452
JPReddy Avatar asked Dec 01 '10 11:12

JPReddy


People also ask

What is ClickOnce deployment?

ClickOnce is a deployment technology that enables you to create self-updating Windows-based applications that can be installed and run with minimal user interaction.

How do you use ClickOnce?

In the Specific target page, select ClickOnce. Enter a path or select Browse to select the publish location. In the Install location page, select where users will install the application from. In the Settings page, you can provide the settings necessary for ClickOnce.

Where is the ClickOnce application installed?

Unlike usual applications installed to the Program Files folder or a user-defined folder, ClickOnce applications are installed into the user profile, to a subfolder with an obfuscated name.


1 Answers

[Edit]

It's not necessary to use reflection. You can add a reference to your program directly in the loader and kick it off. Did a blog post with code about it at Tech and Me.


You could include both versions in your deployment, but name them differently. Then have a loader app check if you are on a 32bit or 64bit system, copy the correct dll (eg thirdparty64.dll -> thirdparty.dll) which your real program is linked to, and then invoke your program from the loader with for example Assembly.Load and use reflection to start your main method.

An easier method is to compile your application to run as x86, ensuring it will always run in 32bit mode. If you don´t rely on some specific application being installed on the machine in 32/64bit versions this could be the best choice.

like image 192
Mikael Svenson Avatar answered Nov 15 '22 11:11

Mikael Svenson