Search Unity

Resolved How to find installation path of given Unity version outside of Unity editor?

Discussion in 'Editor & General Support' started by shelim, Jul 30, 2021.

  1. shelim

    shelim

    Joined:
    Aug 26, 2017
    Posts:
    29
    I need to find Unity installation path for given version to call it from command line outside of Unity (Windows Batch).

    I tried this snipped:

    Code (csharp):
    1. set "RegPath=HKEY_CURRENT_USER\SOFTWARE\Unity Technologies\Installer\Unity"
    2. set "RegKey=Location x64"
    3.  
    4. for /F "usebackq tokens=3,*" %%A IN (`reg query "%RegPath%" /v "%RegKey%" 2^>nul ^| find "%RegKey%"`) do (
    5.   set UnityPath=%%B
    6. )
    But this does not allow me to specify version I am looking for. Is there any way to find installation path of given version?
     
  2. shelim

    shelim

    Joined:
    Aug 26, 2017
    Posts:
    29
    Okay, just found it

    Code (CSharp):
    1.     set "UnityVersion=2021.1.12f1"
    2.     set "RegPath=HKEY_CURRENT_USER\SOFTWARE\Unity Technologies\Installer\Unity %UnityVersion%"
    3.     set "RegKey=Location x64"
    4.  
    5.     for /F "usebackq tokens=3,*" %%A IN (`reg query "%RegPath%" /v "%RegKey%" 2^>nul ^| find "%RegKey%"`) do (
    6.       set UnityPath=%%B
    7.     )
    It is possible to miss installation that way, but with above fallback it should be ok.
     
  3. coolnoob123456

    coolnoob123456

    Joined:
    Apr 10, 2023
    Posts:
    1
    can some one help me plz with this code "editor-installation-location" -batchmode -createManualActivationFile -logfile