?
Solved

VS.Net Setup Project - 32 and 64 bit

Posted on 2010-08-23
5
Medium Priority
?
407 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 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

762 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