Right click a file to Open in a different version of Xojo

WARNING: Playing with the registry can cause huge problems (but not if you get it right :wink: )

@Michel Bujardet was talking on another thread about not being able to easily open projects in Windows on different versions of Xojo that you have installed on the same machine. This got me thinking about ways around it, and here is the most elegant.

Create a text file with the following information:

[code]Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Xojo.XojoProject\shell\Open Xojo 2016r3]

[HKEY_CLASSES_ROOT\Xojo.XojoProject\shell\Open Xojo 2016r3\command]
@="“C:\\Program Files (x86)\\Xojo\\Xojo 2016r3\\Xojo.EXE” “%1"”

[HKEY_CLASSES_ROOT\Xojo.XojoProject\shell\Open Xojo 2016r4.1]

[HKEY_CLASSES_ROOT\Xojo.XojoProject\shell\Open Xojo 2016r4.1\command]
@="“C:\\Program Files (x86)\\Xojo\\Xojo 2016r4.1\\Xojo.EXE” “%1"”

[HKEY_CLASSES_ROOT\Xojo.XojoProject\shell\Open Xojo 2017r1b14\command]
@="“C:\\Program Files (x86)\\Xojo\\Xojo 2017r1b14\\Xojo.EXE” “%1"”[/code]

Now rename the text file to something like XojoChange.reg and double click the file, this will insert the changes above into the registry.

Now, when you right click a xojo_project file it will show these additional entries.

If you make a typo in the above and insert it into the registry or want to tweak them at a later date, click Start->Run and run regedit, then navigate to the entry that you wish to correct.

You can change the parts like Open Xojo 2017r1b14 to something more desirable if you wish, this is what is shown when you right click.

This can also be done for Xojo.XojoBinaryProject by changing the relevant strings from Xojo.XojoProject to Xojo.XojoBinaryProject in the above file.

If you keep your latest BETA in a certain folder, you only need to make the change once and it will work when you replace the folders contents with the latest version:

[code]Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Xojo.XojoProject\shell\Open Xojo Latest BETA]

[HKEY_CLASSES_ROOT\Xojo.XojoProject\shell\Open Xojo Latest BETA\command]
@="“C:\\Program Files (x86)\\Xojo\\Xojo BETA\\Xojo.EXE” “%1"”

[/code]

If someone wants to make a nice little project to provide a user interface for this, please feel free, it would be a good little starter/test project using RegistryItem.

I thInk Xojo could and should add this to the installer.

I’ve thrown together a little project/app to perform this function.

Download Binary Project

It picks out the versions and extensions you have installed from the registry.

It doesnt store “Command” or “Beta Path” between execution, just alter the project to have the default you want in there.

If you don’t want a BETA entry, set the beta text to a blank string.

Its pretty self explanatory, Apply creates the entries, and Clear removes them, it will only remove ones its added, it wont remove anything from the registry that it hasnt put there previously.

Build the project then run it as administrator so it has permission to access the relevant registry entries.

There’s currently a bug in RegistryItems.Delete where it doesnt raise an exception if it cant delete what it need for a Clear so it might not show the error message when you Clear when its not running as administrator.

Let me know if you have any questions.

Enjoy

On Windows I just add each version of Xojo to the Send To Folder (%appdata%\Microsoft\Windows\SendTo). Then I can right click a project and select the version of Xojo I want to use.

I prefer a sub menu.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\\Xojo.XojobinaryProject\\Shell\\Open With Xojo]
"MUIVerb"="Open With Xojo"
"SubCommands"="Xojo 2015r1;Xojo 2016r3;Xojo 2016r4.1"
"icon"="C:\\\\Program Files (x86)\\\\Xojo\\\\Xojo 2015r1\\\\Xojo.exe"

[HKEY_CLASSES_ROOT\\Xojo.XojoProject\\Shell\\Open With Xojo]
"MUIVerb"="Open With Xojo"
"SubCommands"="Xojo 2015r1;Xojo 2016r3;Xojo 2016r4.1"
"icon"="C:\\\\Program Files (x86)\\\\Xojo\\\\Xojo 2015r1\\\\Xojo.exe"

[HKEY_CLASSES_ROOT\\Xojo.XojoXMLProject\\Shell\\Open With Xojo]
"MUIVerb"="Open With Xojo"
"SubCommands"="Xojo 2015r1;Xojo 2016r3;Xojo 2016r4.1"
"icon"="C:\\\\Program Files (x86)\\\\Xojo\\\\Xojo 2015r1\\\\Xojo.exe"


[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CommandStore\\shell\\Xojo 2015r1]

[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CommandStore\\shell\\Xojo 2015r1\\command]
@="\"C:\\\\Program Files (x86)\\\\Xojo\\\\Xojo 2015r1\\\\Xojo.exe\" \"%1\""

[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CommandStore\\shell\\Xojo 2016r3]

[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CommandStore\\shell\\Xojo 2016r3\\command]
@="\"C:\\\\Program Files (x86)\\\\Xojo\\\\Xojo 2016r3\\\\Xojo.exe\" \"%1\""

[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CommandStore\\shell\\Xojo 2016r4.1]

[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CommandStore\\shell\\Xojo 2016r4.1\\command]
@="\"C:\\\\Program Files (x86)\\\\Xojo\\\\Xojo 2016r4.1\\\\Xojo.exe\" \"%1\""