Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
3
Question by Clem · Dec 15, 2011 at 03:18 PM · versionscontinuous-integration

Programmatically get version of Unity installed on a machine

Hello,

I am wondering if there is any way to know the version of Unity installed on a machine (PC or Mac). We have multiple build machines constantly building our game and sometimes we want to be able to build it on a specific version of Unity - for example 3.5 beta. At the moment we do this by installing Unity on a new build machine and then add it to our Continuous Integration server. For each build new build agent we have to enter the Unity version it supports automatically. This is a bit tidious and we would like our CI server to be able to work out what version of Unity is installed on a machine automatically.

Is there a file somewhere in Unity's installation folder that would give me the information I need?

Thanks,

Clem

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image FWCorey · Jan 02, 2013 at 08:47 AM 0
Share

Did you ever find out how to do this? I'm working with 2 versions of unity and building a .dll so have to build 2 .dll files for some cases at the moment.

6 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by unimechanic · Jul 09, 2013 at 04:33 PM

Currently you can obtain some version information this way:

 using UnityEditorInternal;
 ...
 DateTime dt = new DateTime(1970, 1, 1, 0, 0, 0, 0);
 Debug.Log(
   "Unity version      = " + Application.unityVersion + "\n" +
   "Full Unity version = " + InternalEditorUtility.GetFullUnityVersion() + "\n" +
   "Version date       = " + dt.AddSeconds(InternalEditorUtility.GetUnityVersionDate()));
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
1

Answer by Korbinian · Sep 17, 2019 at 08:21 PM

These days it's surely easiest to use the UnityHub, which finally got a command line interface. It's easy to enumerate editors installed through the hub, and to install any version if you know the changeset hash, like unityhub://2019.2.5f1/9dace1eed4cc

Check the help screen with (on Windows) "Unity Hub.exe" -- --headless help

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Muzz5 · Dec 16, 2011 at 02:02 PM

Check for updates. It will tell you your current version number.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Statement · Dec 15, 2011 at 03:45 PM

Have you checked out the version defines? I'm not sure if you're looking for a runtime check or a compile time check, or just a setting?

More examples here.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Clem · Dec 15, 2011 at 03:56 PM 0
Share

Thanks for the suggestion but I don't think it's what I am looking for. I want to be able to deter$$anonymous$$e which version of Unity is installed on a machine without having to open Unity. I was thinking maybe there is a version file or something in Unity's install folder. Ideally the solution would on $$anonymous$$ac and PC.

avatar image Statement · Dec 15, 2011 at 07:32 PM 0
Share

Do you mean webplayer version? I think Unity standalones are self-contained, but I'm not totally sure on that. It seems that %appdata%\..\LocalLow\Unity\WebPlayer\player\2.x.x and 3.x.x on Windows contains a plist file which contain the version number for the player. If you fail to get an appropriate answer here, you could try contacting unity support. They should know for sure.

avatar image Clem · Dec 16, 2011 at 01:48 PM 0
Share

Sorry I should have been clearer. I want to know the version of the Editor installed on a build machine. I'll have a look a what you suggested.

avatar image
0

Answer by FWCorey · Jan 11, 2013 at 11:32 PM

generate an editor script that includes a #if define, get the result, set an editor pref, then purge the dummy script. I know it's clunky but it'll work.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image FWCorey · Jan 12, 2013 at 09:29 PM 0
Share

There is also the (currently undocumented but shows up in intellisense) Application.unityVersion property.

  • 1
  • 2
  • ›

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

9 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Trouble upgrading project from 5.3.4 to 5.4.0 0 Answers

Any trick to downgrade successfully from Unity2019.3.3f1 to 2018.2.15f1? 2 Answers

Is there a existing path for getting CI for Android and iOS builds and deploying in to Google Beta and TestFlight? 0 Answers

3ds Max version issue 0 Answers

urgent help needed: how SystemInfo.deviceUniqueIdentifier works on IOS? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges