How to fix bas file association

From Liberty BASIC Family
Jump to navigation Jump to search

Description

If you upgrade Liberty BASIC and have previously set a .bas file association you may find that you cannot associate .bas files with Liberty.exe or that the association always points at the older version.

The file association that allows you to double click any .bas file and have it open in the IDE, is set manually. You normally right click on the .bas file, select "open with" and then click on the Liberty BASIC icon in the dialog. If it does not show, click on "choose default program", navigate to the Liberty BASIC folder and click on liberty.exe. A fairly simple operation.

This manual file association is recorded in the Registry. The problem is that when you upgrade, the old manual association is still retained in the Registry. The install process does not handle file associations. Now when you set an association there are two recorded in the Registry. Because Liberty is installed in ever increasing directory numbers, v4.03, v4.04, the first liberty.exe the Registry finds is always the previous version. So you will find that clicking a .bas file always opens the older version of Liberty BASIC if you have left it on your hard drive. If you have deleted the older version Windows assumes the association is broken and never checks the next higher directory.

To solve the problem we need to manually cleanse the Registry. Easily done. Click on "Start" then in the search box immediately above the Start icon key in "regedit" and press enter. For some the UAC dialog box will open and ask if you are sure you want to allow these changes. Click on "Yes". The Registry editor will open. It has two panes, in the left hand pane there is a tree view of all of the Registry entries, Use the scroll bars to get to the top left of the tree view. There will be a little "Computer" icon with a little pointer to it's left. Click on the pointer till all that is in view is the little computer icon itself.

Click on "Edit" then "Find" and key in "liberty.exe" in the search dialog and press "Find Next". The tree view will have opened up, use the scroll bars if it is not in view but you should find a "liberty.exe" folder has been highlighted. Right click on the folder and choose "Delete". Close the editor, job done.

Now rebuild the association by right clicking on any .bas file and selecting "Open with", tick the "Always use this program" checkbox and then click on "Choose default program". Navigate to the upgraded version of liberty.exe double click and the job is finished.