Search Unity

Windows 8.1: *.unitypackage file extension should be handled by -which- EXE?

Discussion in 'Editor & General Support' started by jlabs1, Jan 13, 2015.

  1. jlabs1

    jlabs1

    Joined:
    Jun 20, 2014
    Posts:
    6
    Running two separate installations of Unity and have created for myself one heck of a problem.

    DEFAULT & DESIRED BEHAVIOR:
    Upon double-clicking a *.unitypackage in Windows Explorer:​

    If either installation of Unity is already active in the Task Manager:
    The active installation will handle it and proceed to prompt the "add assets to project" window for the currently active project.​
    Otherwise, if an installation of Unity is not active in the Task Manager:
    The most recently installed version of Unity will be launched and prompt the "New Project" window[**].
    CURRENT BEHAVIOR :
    I had attempted to manually switch which installation would be launched upon above case [**] by associating the *.unitypackage extension to desired installation's Unity.exe, which resulted in the BROKEN BEHAVIOR as described below.
    BROKEN BEHAVIOR:
    Upon double-clicking a UNITYPACKAGE in Windows Explorer:​

    If either installation of Unity is already active in the Task Manager:
    A new instance of the most recently installed version of Unity will be launched and prompt the "New Project" window, disregarding entirely the presence of the currently active installation of Unity.​

    Otherwise, if an installation of Unity is not active in the Task Manager:
    The most recently installed version of Unity will be launched and prompt the "New Project" window.
    In order to return to the DEFAULT, DESIRED BEHAVIOR, I tried the following:
    • Uninstalling both versions,
    • Restarting,
    • Wiping the remnant folders including all relevant AppData folders,
    • Wiping the remnant registry entries,
    • Dissociating the *.unitypackage extension from Windows,
    • Restarting,
    • Finally, doing a round of CCleaner after all of this to hopefully wipe any remaining dead registry entries,
    • Restarting,
    • Reinstalling and launching Unity. However...
    ...new installations of Unity are not assigning the *.unitypackage file extension to their intended defaults. My Windows installation has no idea what the heck to do with *.unitypackage files, nor do I know what to assign them to. So, my question for this thread: which EXE should be handling the *.unitypackage extension on Windows 8.1?

     
    Last edited: Jan 13, 2015
  2. Enemyx

    Enemyx

    Joined:
    Feb 21, 2015
    Posts:
    1
    Any solution?
     
  3. Darkworth

    Darkworth

    Joined:
    Jan 19, 2011
    Posts:
    41
    I need to know this too as somehow this association is messed up on mine as well. I am not certain but I think this started happening after installing the Unity5 RC1 build.
     
  4. Graham-Dunnett

    Graham-Dunnett

    Administrator

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    Double-clicking a *.doc should be handled by which version of Microsoft Word on my machine?

    What I mean is, this is not something that OSes seem to be very good at. I'd never double click a unitypackage file and expect the right version of Unity to open. You really really really want to switch to the right Unity, and either import it or drag-and-drop it in.

    If you know that the unitypackage should only every be loaded into the newest Unity version, then you probably can do some internet searches that tells you how to set this up.
     
    Joe-Censored and dadude123 like this.
  5. r35

    r35

    Joined:
    Mar 5, 2015
    Posts:
    9
    I was using Unity 4.6 x86 in Win7 x64, and exactly same thing happening to me after install Unity 5 x64...
    I didn't try uninstall and re-install progress yet, but wow.. that doesn't help?
     
  6. Galahad

    Galahad

    Joined:
    Feb 13, 2012
    Posts:
    72
  7. fgxqstje

    fgxqstje

    Joined:
    Aug 11, 2015
    Posts:
    1
    This happened to me as well. I uninstalled Unity 4 after I installed Unity 5 and it destroyed the file association with Unity 5. Anyhow, here's the registry file contents that will fix the problem. Open notepad, dump the following lines into it, and save it as unitypfix.reg. I've tested this successfully on Windows 8.1. You can see that the problem is the extra -openfile parameter that Unity needs when it sees unitypackages. That's why you can't just right click and choose open with. I hope this helps.

    Windows Registry Editor Version 5.00
    [HKEY_CLASSES_ROOT\.unityPackage]
    @="Unity package file"
    "backup_val"="Unity package file"

    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Unity package file]
    @="Unity package file"

    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Unity package file\DefaultIcon]
    @="\"C:\\Program Files\\Unity\\Editor\\Unity.exe\",0"

    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Unity package file\shell]
    @="open"

    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Unity package file\shell\edit]
    @="Edit Unity package file"

    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Unity package file\shell\edit\command]
    @="\"C:\\Program Files\\Unity\\Editor\\Unity.exe\" -openfile \"%1\""

    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Unity package file\shell\open]

    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Unity package file\shell\open\command]
    @="\"C:\\Program Files\\Unity\\Editor\\Unity.exe\" -openfile \"%1\""
     
  8. Zorranco

    Zorranco

    Joined:
    Jul 15, 2014
    Posts:
    23
    Regedit hack works with windows 7 64 bit too, I broke the link by having two installations of unity, 4 and 5. Now I only have 5 and I wanted to restore the old behaviour.

    Now the problem is that, if Unity is not running, package is imported directly, with no prompt of what to import (and it's corresponding cancel option)

    If unity is running, this window appears normally and you can chek / unchek what you want to import, or cancel if needed.
     
    Last edited: Sep 17, 2015
  9. Galahad

    Galahad

    Joined:
    Feb 13, 2012
    Posts:
    72
    This is the best solution =]
     
  10. 6789077

    6789077

    Joined:
    May 27, 2014
    Posts:
    4
    Works ON windows 10 64bit
     
  11. tawdry

    tawdry

    Joined:
    Sep 3, 2014
    Posts:
    1,357
    I lost association tried the notepad thing on win 7 32 bit but not working do you need to store the notepad file somewhere?
     
  12. CodeCreed

    CodeCreed

    Joined:
    Aug 5, 2017
    Posts:
    1

    Works for me on Windows 8.1. 64bit. Thanks
     
  13. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    1,166
    Thanks for @fgxqstje solution. It works but additionally I also need to remove the registry
    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.unitypackage before run the .reg file
     
    mgear, HyperBrid and MaximilianPs like this.
  14. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    1,166
    I have create this request and I think it should be like this

    https://forum.unity.com/threads/please-let-us-open-unitypackage-with-unityhub.639244/

    Each machine can have many version of unity editor. But it most likely have only one hub. And so what it should happen is, everything related to unity should be handled by hub itself

    When we double click to open .unitypackage or trying to import things from asset store. Or if in any future if we would have URL scheme to import package into package manager from anywhere. The hub should handle it like this

    • If there was no unity instance opened. The hub would just show a normal hub UI for select project like normal. But after the project was opened the hub will also telling that, that project should import that package we try to import from the start
    • If there was exactly one unity instance opened. The hub should just command the opened instance to import package like normal register
    • If there was multiple instances of unity opened. The hub should again open the select project UI like normal, sort by latest opened project as default. And then send the import command to that opened project
      • Alternatively. If the hub could know the last focused project windows. It might just import into that last focused project. And also if the hub was the last focused windows then it fallback to select project UI
     
  15. MaximilianPs

    MaximilianPs

    Joined:
    Nov 7, 2011
    Posts:
    322
    in meantime, I've placed a UnityFix.reg here.
    For further use, I've also added some comments on inside the file, so just open it with your Notepad and read it carefully.

    Happy Importing ;):D

    if you don't trust me, just copy and paste :p
    Code (csharp):
    1. ;
    2. ;    THIS WILL RESTORE THE UNITYPACKAGE FILE ASSOCIATION
    3. ;                        BUT !!!
    4. ;
    5. ; 1) From regedit remove the KEY
    6. ; HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.unitypackage
    7. ;
    8. ; 2) You have to change the Unity's path on the lines 20, 28, 33
    9. ; pleae keep in mind that from folder to folder you have use a double slash \\
    10. ; also, at the end of the path where Unity.exe sit, you have to add another slash \
    11.  
    12.  
    13. Windows Registry Editor Version 5.00
    14. [HKEY_CLASSES_ROOT\.unityPackage]
    15. @="Unity package file"
    16. "backup_val"="Unity package file"
    17.  
    18. [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Unity package file]
    19. @="Unity package file"
    20.  
    21. [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Unity package file\DefaultIcon]
    22. @="\"C:\\Program Files\\Unity\\Hub\\Editor\\2019.2.0f1\\Editor\\Unity.exe\",0"
    23.  
    24. [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Unity package file\shell]
    25. @="open"
    26.  
    27. [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Unity package file\shell\edit]
    28. @="Edit Unity package file"
    29.  
    30. [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Unity package file\shell\edit\command]
    31. @="\"C:\\Program Files\\Unity\\Hub\\Editor\\2019.2.0f1\\Editor\\Unity.exe\" -openfile \"%1\""
    32.  
    33. [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Unity package file\shell\open]
    34.  
    35. [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Unity package file\shell\open\command]
    36. @="\"C:\\Program Files\\Unity\\Hub\\Editor\\2019.2.0f1\\Editor\\Unity.exe\" -openfile \"%1\""
     
    changemaker and vexe like this.
  16. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    1,166
    @MaximilianPs The downside of this method is we need to keep this reg file and change the version number every times we install new version. Which I need to always do it like that for years
     
    MaximilianPs likes this.
  17. MaximilianPs

    MaximilianPs

    Joined:
    Nov 7, 2011
    Posts:
    322
    @Thaina saddly, yes, it's true :-(
     
  18. Razeta

    Razeta

    Joined:
    Jun 27, 2018
    Posts:
    3
    Hello guys, this method worked for me.