Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Fix Unity file extensions?

Discussion in 'Editor & General Support' started by Juice-Tin, Apr 11, 2015.

  1. Juice-Tin

    Juice-Tin

    Joined:
    Jul 22, 2012
    Posts:
    233
    Hello, I installed Unity5 and then uninstalled my Unity4.5 after (had to make sure my old projects worked on 5).

    Since I uninstalled my 4.5, all Unity file associations were removed. So now Scene files and Package files no longer work when clicked.

    I changed them to use the Unity.exe file, but now clicking a Scene or Package file tries opening a new Unity editor, instead of loading them into the current editor.

    Any way to fix this without reinstalling unity? Thanks!


    (That project is currently open, but clicking a scene or package file tries to open a new editor)
     
  2. Rene-Damm

    Rene-Damm

    Unity Technologies

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    Unity needs the "-openfile" argument to open scenes and packages. The default association created on Windows won't do that. You can use the registry editor to modify the association. You need a "shell -> open -> command" hierarchy as displayed in the attached screenshot. You can put that directly under the .unity file type in HKEY_CLASSES_ROOT (the Unity installer sets up a separate "Unity scene file" type as you can see in the image).
     

    Attached Files:

  3. Juice-Tin

    Juice-Tin

    Joined:
    Jul 22, 2012
    Posts:
    233
    Hi Rene, thanks for the quick response!

    I followed your instructions and added the hierarchy under HKEY_CLASSES_ROOT/.unity so it looks like this:
    http://gyazo.com/44f509aa616d638d8663a79e7be606bf

    However unity scenes/packages still do not open correctly. Do I need a reboot, or have I done it incorrectly?

    Thanks
     
  4. Rene-Damm

    Rene-Damm

    Unity Technologies

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    Sorry, my bad. The "shell" key under the file type doesn't work. It has to be under the corresponding handler. In short, set the default key on the file type (like ".unity") to a new key (such as "Unity scene file") under the same HKEY_CLASSES_ROOT which contains the "shell" key hierarchy.
     
  5. Juice-Tin

    Juice-Tin

    Joined:
    Jul 22, 2012
    Posts:
    233
    I see now that .unity has the data of Unity scene file.
    I created Unity scene file with the shell>open>command hierarchy and the proper data however it still doesn't work.

    BUT, it's not a huge deal. I can just reinstall unity at some point, or it might fix itself when I grab the update. :)
    Thanks anyway for the help Rene!
     
  6. deroxation

    deroxation

    Joined:
    Jun 25, 2015
    Posts:
    2
    I have the same problem I just deleted unity 4.6 and unity 5 , then I reinstalled unity 5 again , but it still dosent work any solution ? :/
     
    Last edited: Jun 26, 2015
  7. deroxation

    deroxation

    Joined:
    Jun 25, 2015
    Posts:
    2
    I have found a solution , first of all uninstall all unity on your pc , and download ccleaner and make it delete all corrupted registry files then download unity 5 , hope this helps !
     
  8. Juice-Tin

    Juice-Tin

    Joined:
    Jul 22, 2012
    Posts:
    233
    Here's the way I fixed it (alternative to dero's above method)

    1. Uninstall unity
    2. Reinstall unity 5 (scene/package files should no longer be associated with anything)
    3. Try opening a scene. When windows asks which program to use, select unity.
    ^ Doing this after a fresh install will automatically make scenes open properly. However during this without a fresh install will cause my problem listed above.