condition for x64
-
hi there, im going to run a custom action in a setup proj... its a driver installer which depends on windows platform now i have two version of this driver x64 and x86 ... i know there is a condition properties for detecting platform... but what should i write in it for this reason?
-
hi there, im going to run a custom action in a setup proj... its a driver installer which depends on windows platform now i have two version of this driver x64 and x86 ... i know there is a condition properties for detecting platform... but what should i write in it for this reason?
-
What do you mean? This?
if (IntPtr.Size == 8)
; // it's 64bit yay
else
; // it's 32bit :(I doubt that; there probably is only one installer for all Windows systems, so it is bound to be x86. Testing IntPtr.Size tells about the own process, which would then always return 4. The installer really should be interested in the Windows version, i.e. what sits outside its own boundaries. Unless MS provided something tailored for this in installers, I'd go with WMI. :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.
-
I doubt that; there probably is only one installer for all Windows systems, so it is bound to be x86. Testing IntPtr.Size tells about the own process, which would then always return 4. The installer really should be interested in the Windows version, i.e. what sits outside its own boundaries. Unless MS provided something tailored for this in installers, I'd go with WMI. :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.
-
hi there, im going to run a custom action in a setup proj... its a driver installer which depends on windows platform now i have two version of this driver x64 and x86 ... i know there is a condition properties for detecting platform... but what should i write in it for this reason?
I'd start moving away from the Setup and Deployment project in Visual Studio. It won't exist in the next Visual Studio release. The supported method will be InstallShield (Lite or Express or whatever...) Windows Installer has supported x64 component since release 2.0. Normally, I'd create a seperate x64 version of the installer. But, depending on what you're doing, you may be able to do something like adding the x64 components (tagged as such) to a seperate feature, then in a CA, check the VersionNT64 property and make a call to SetFeatureState as appropriate to turn on/off its install state, in the InstallExec sequence. And you don't need any .NET code to do this. You also have to keep in mind a 32-bit installer cannot write to 64-bit registry and file locations...
A guide to posting questions on CodeProject[^]
Dave Kreskowiak