Skip to content

Instantly share code, notes, and snippets.

@unitycoder
Last active April 3, 2023 09:40
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save unitycoder/74ed2abca19fa227b0027bdad58ad65f to your computer and use it in GitHub Desktop.
Save unitycoder/74ed2abca19fa227b0027bdad58ad65f to your computer and use it in GitHub Desktop.
Fix .UnityPackage for Opening into Currently Running Editor (instead of opening new Unity Instance)
- If you installed 32bit unity, and then removed it, it doesnt work
- install 5.6 64 bit to fix
or use registry fix below, IMPORTANT, insert some unity editor path there
Windows Registry Editor Version 5.00
; https://forum.unity.com/threads/windows-8-1-unitypackage-file-extension-should-be-handled-by-which-exe.290911/#post-2246156
; https://forum.unity.com/threads/windows-8-1-unitypackage-file-extension-should-be-handled-by-which-exe.290911/#post-4338490
[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\""
[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.unitypackage]
@ShiriNmi1520
Copy link

We might not need those two lines of comment here since it might confuse my pc when I trying import reg file by double-clicking it, an Registry Editor Cannot Import File error raises.
Anyway, great work you did here 👍

@unitycoder
Copy link
Author

unitycoder commented Dec 2, 2022

Aha, comments have to be below the registry line, edited it now
https://codeyarns.com/tech/2010-12-11-comments-in-registry-script-files.html#gsc.tab=0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment