- Home /
Checking for PC x64 Application platform
Hi, quick question (hopefully).
I'm having trouble finding a way to tell if the current build is a PC x86 or PC x64 one. As far as I could find, there is no compile-time constant to tell them apart, and the Application.Platform enum also doesn't seem to have separate values for each windows standalone architecture.
Is there a reliable way to check then if the platform I'm running on is a 64-bit executable or not? I have a few version-tracking files I need to parse depending on platform, but without a way to tell them apart, it gets pretty difficult.
Either a compiler costant or a runtime enum will do here. Whichever exists, if any.
Thanks in advance! :)
Cheers
Answer by HarvesteR · Jul 02, 2014 at 06:43 PM
Hi, thanks for the quick reply!
That class isn't available at runtime though, is it? I needed something to tell after building if I had a 64 exe or a 32 bit one.
I solved this by rigging up my build scripts to include a user-defined "WIN64" compile constant when building for x64, and strip it out when building for other platforms. That worked well enough, even though it was kind of a long way around what I think is an oversight in the enumeration definition really.
Well, it did the job, so I can't complain. :)
Thanks again!
Cheers
Answer by voodooRod · Jul 02, 2014 at 05:58 PM
Try using the EditorUserBuildSettings.activeBuildTarget. It returns the BuildTarget. Hope this helps you.
Your answer
Follow this Question
Related Questions
Minimize And Maximize An application 1 Answer
Application.platform Value Under Nintendo 3DS 0 Answers
Why is ARM64 greyed out? How do I turn it back on to meet the Android 64 bit requirements? 2 Answers
can unity application integrates with Microsoft vs application? (integrating two applications) 0 Answers