Search Unity

Context Menu

Discussion in 'Unity Hub' started by rakkarage, May 25, 2018.

  1. rakkarage

    rakkarage

    Joined:
    Feb 3, 2014
    Posts:
    683
  2. AbrahamDUnity

    AbrahamDUnity

    Unity Technologies

    Joined:
    Jun 28, 2017
    Posts:
    431
    Hi,

    That's an interesting idea. What kind of action would you add as a shell extension? On a side note we have plans to implement file associations with Unity files so it's easier to launch projects of different versions directly from the file system.

    Cheers,
     
  3. rakkarage

    rakkarage

    Joined:
    Feb 3, 2014
    Posts:
    683
    I sometimes create shortcuts to folders I am working on, on the desktop, as a todo and as easy access.
    UnityHub does make it easier, but I wanna right click on any folder or shortcut to folder and open it in unity.

    This is the old code: it just adds a command to open with -projectPath %1

    Code (CSharp):
    1. [version]
    2. signature="$CHICAGO$"
    3.  
    4. [OpenWithUnityInstall]
    5. CopyFiles = OpenWithUnity.Files.Inf
    6. AddReg    = OpenWithUnity.Reg
    7.  
    8. [DefaultInstall]
    9. CopyFiles = OpenWithUnity.Files.Inf
    10. AddReg    = OpenWithUnity.Reg
    11.  
    12. [DefaultUnInstall]
    13. DelFiles  = OpenWithUnity.Files.Inf
    14. DelReg    = OpenWithUnity.Reg
    15.  
    16. [SourceDisksNames]
    17. 55="Open with Unity","",1
    18.  
    19. [SourceDisksFiles]
    20. OpenWithUnity.INF=55
    21.  
    22. [DestinationDirs]
    23. OpenWithUnity.Files.Inf = 17
    24.  
    25. [OpenWithUnity.Files.Inf]
    26. OpenWithUnity.INF
    27.  
    28. [OpenWithUnity.Reg]
    29. HKLM,%OWU%,DisplayName,,"%OpenWithUnityName%"
    30. HKLM,%OWU%,UninstallString,,"rundll32.exe syssetup.dll,SetupInfObjectInstallAction DefaultUninstall 132 %17%\OpenWithUnity.inf"
    31. HKCR,Directory\Shell\OpenWithUnity,,,"%OpenWithUnityAccel%"
    32. HKCR,Directory\Shell\OpenWithUnity\command,,,"""C:\Program Files\Unity\Editor\Unity.exe"" -projectPath ""%1"""
    33. HKCR,Directory\Shell\OpenWithUnity,Icon,,"C:\Program Files\Unity\Editor\Unity.exe"
    34.  
    35. [Strings]
    36. OpenWithUnityName="OpenWithUnity PowerToy"
    37. OpenWithUnityAccel="Open with &Unity"
    38. OWU="Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenWithUnity"
    39.  
    I guess I will just do the same but hard code it to point to a new specific version...

    Thanks.
     
  4. rakkarage

    rakkarage

    Joined:
    Feb 3, 2014
    Posts:
    683
    one possible solution would be to write the preferred version to the environment then the context menu could use that
    or even better hub could take a parameter or a -projectPath paremeter and determine which version itself
     
  5. AbrahamDUnity

    AbrahamDUnity

    Unity Technologies

    Joined:
    Jun 28, 2017
    Posts:
    431
    I see! There's been talks of implementing a command-line interface for the Hub but nothing has been planned as of yet. If it were though you could probably call the Hub executable with some kind of projectPath and it could open the right version for this project (if present).

    For now I can't promise much but I'd say the scenario above would definitely go in the direction you're going.
     
  6. rakkarage

    rakkarage

    Joined:
    Feb 3, 2014
    Posts:
    683
  7. rakkarage

    rakkarage

    Joined:
    Feb 3, 2014
    Posts:
    683
    if you can right click on a folder and select open in vscode or open in visual studio or open in vlc you should be able to open a folder in unity like that too wtf

    https://en.wikipedia.org/wiki/Context_menu

    no plans to adopt this new context menu tech?