Solved

VS.Net Setup Project - 32 and 64 bit

Posted on 2010-08-23
5
402 Views
Last Modified: 2012-05-10
I created a vb.net program, which has a 32 and 64 bit .dll file.  So, I created a setup project for each platform.  However right now the user needs to determine which platform they are running and must run the correct install.

How can I automatically determine (through code, under the setup deployment) which platform the user is running and then run the correct install program?
0
Comment
Question by:K-9
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
5 Comments
 
LVL 42

Expert Comment

by:sedgwick
ID: 33500351
there are number of ways to detect that, here's one:
if the following registry is exists than it is 64bit, otherwise it's 32bit.

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node

so in your vb.net code use the following:

Dim is64bit As Boolean = Registry.LocalMachine.OpenSubKey("SOFTWARE\Wow6432Node") IsNot Nothing

0
 
LVL 42

Expert Comment

by:sedgwick
ID: 33500389
another way is using WMI:

Dim mso As New ManagementObjectSearcher("SELECT *FROM Win32_OperatingSystem")
Dim qc As ManagementObjectCollection = mso.[Get]()
For Each mo As var In qc
      Dim ostype As String = mo("OSArchitecture").ToString()
Next

the value of ostype is: "64-bit" or "32-bit"
0
 
LVL 42

Accepted Solution

by:
sedgwick earned 500 total points
ID: 33500436
another way is check the environment variable:

Dim val As String = Environment.GetEnvironmentVariable("ProgramFiles(x86)")

if val is not nothing than the OS type is 64bit, otherwise 32bit.
0
 
LVL 42

Expert Comment

by:sedgwick
ID: 33500441
if u need another alternative let me know...
0
 

Author Closing Comment

by:K-9
ID: 33859600
Thanks!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question