File association

Usage of the framework, compiler and tools

File association

Postby Robert » Sun Mar 11, 2018 2:33 pm

In my setup I have:
1 - Standard BlackBox in "D:\BlackBox\171\"
2 - My own subsystems in "D:BlackBoxClient\"
3 - I use a desktop icon with "Target:" set to "D:\BlackBox\171\BlackBox.exe /Use D:\BlackBoxClient"
4 - The icon has "Start in:" set to: "D:\BlackBoxClient".

I have manually set the ".odc" extension to "Open with" D:\BlackBox\171\BlackBox.exe, so
when I double click on a file (say "ShoppingList.odc") it opens in BlackBox.

But it opens in a naked 171 environment; it has bypassed the "Use" & "Start in:" properties defined in the desktop icon.
Is there a way to combine these two behaviours?

Thanks, Robert
User avatar
Robert
 
Posts: 108
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: File association

Postby cfbsoftware » Sun Mar 11, 2018 9:22 pm

Yes - manually set the ".odc" extension to "Open with" the shortcut on your desktop instead of D:\BlackBox\171\BlackBox.exe
cfbsoftware
 
Posts: 28
Joined: Wed Sep 18, 2013 10:06 pm

Re: File association

Postby Robert » Sun Mar 11, 2018 9:45 pm

cfbsoftware wrote:Yes - manually set the ".odc" extension to "Open with" the shortcut on your desktop instead of D:\BlackBox\171\BlackBox.exe

Sounds like a good idea, but I can't get it to work. Does it work for you?
User avatar
Robert
 
Posts: 108
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: File association

Postby cfbsoftware » Sun Mar 11, 2018 10:11 pm

My BlackBox.exe is in C: drive but it is picking up the /Use settings which are pointing to D: drive. I get the set of menus I would get when I click on the icon rather than those that I get when I click on the .exe

What exactly can't you get to work?
cfbsoftware
 
Posts: 28
Joined: Wed Sep 18, 2013 10:06 pm

Re: File association

Postby Robert » Mon Mar 12, 2018 7:32 pm

If I drag my file onto the desktop icon I get a full client/server BlackBox with all my personal menus.

But when I try to associate the extension with the icon by:
1- Select the file in an Explorer window
2 - Right click
3 - Select "Open with > Choose another app
4 - Check "Always use this app to open .odc files" & click "More apps"
5 - Click "Look for another app on this PC"
6 - Navigate to "Desktop -> IconName" which I single click
7 - Click the "Open" button.

The file then (and subsequently) opens in a raw BlackBox 1.7.1 without immediate access to my subsystems.
User avatar
Robert
 
Posts: 108
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: File association

Postby cfbsoftware » Tue Mar 13, 2018 3:59 am

I experimented with my shortcut's properties to find out what makes / does not make it work and it stopped working for me as well :(

However, I was able to get it to work by editing the Windows registry:

Key: HKEY_CLASSES_ROOT\odcfile\shell\open\command

Value name: (Default)

Value data: "C:\Program Files (x86)\BlackBox Component Builder 1.6\BlackBox.exe" /o "%1" /Use D:\BBOberon-07
cfbsoftware
 
Posts: 28
Joined: Wed Sep 18, 2013 10:06 pm

Re: File association

Postby Josef Templ » Tue Mar 13, 2018 8:56 am

cfbsoftware wrote:I experimented with my shortcut's properties to find out what makes / does not make it work and it stopped working for me as well :(

However, I was able to get it to work by editing the Windows registry:

Key: HKEY_CLASSES_ROOT\odcfile\shell\open\command

Value name: (Default)

Value data: "C:\Program Files (x86)\BlackBox Component Builder 1.6\BlackBox.exe" /o "%1" /Use D:\BBOberon-07


This also works for me.
Thanks for the hint.

- Josef
Josef Templ
 
Posts: 195
Joined: Tue Sep 17, 2013 6:50 am

Re: File association

Postby Robert » Tue Mar 13, 2018 10:46 am

Josef Templ wrote:This also works for me.

My existing key (value data) says:
"D:\BlackBox\BlackBox.exe" /o "%1"
which is odd as I don't have ANY files in that directory, but I do in D:\BlackBox\171\.

I tried various experiments with this key, and they seemed to have no effect. I deliberately associated odc files with something else, and this key did not change.

I did a search for "171" and found the key:
HKEY_CLASSES_ROOT\Applications\BlackBox.exe\shell\open\command
which had data
"D:\BlackBox\171\BlackBox.exe" "%1"
to which I added
\Use D:\BlackBoxClient
.
Note: No "/o".

This now works as I wanted; if I double click an .odc file it opens version 171 with all my personal menus.
But goodness knows what other side effects I might have created.
User avatar
Robert
 
Posts: 108
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: File association

Postby Josef Templ » Tue Mar 13, 2018 9:16 pm

Here is the relevant part of the build process.
We use InnoSetup for generating a Windows installer.
The generated installer registers some registry entries as configured in the input file Win/Rsrc/BlackBox.iss of InnoSetup.
HKCR refers to HKEY_CLASSES_ROOT, I guess.

[Registry]
Root: HKCR; Subkey: ".odc"; ValueType: string; ValueName: ""; ValueData: "odcfile"; Flags: deletekey uninsdeletekey
Root: HKCR; Subkey: ".odc\ShellNew"; ValueType: string; ValueName: "FileName"; ValueData: "{app}\Empty.odc"; Flags: deletekey uninsdeletekey
Root: HKCR; Subkey: "odcfile"; ValueType: string; ValueName: ""; ValueData: "BlackBox Document"; Flags: deletekey uninsdeletekey
Root: HKCR; Subkey: "odcfile\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: """{app}\BlackBox.exe"",1"; Flags: deletekey uninsdeletekey
Root: HKCR; Subkey: "odcfile\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\BlackBox.exe"" /o ""%1"""; Flags: deletekey uninsdeletekey
Root: HKCR; Subkey: "odcfile\shell\print\command"; ValueType: string; ValueName: ""; ValueData: """{app}\BlackBox.exe"" /p ""%1"""; Flags: deletekey uninsdeletekey
Root: HKCR; Subkey: ".osf"; ValueType: string; ValueName: ""; ValueData: "osffile"; Flags: deletekey uninsdeletekey
Root: HKCR; Subkey: "osffile"; ValueType: string; ValueName: ""; ValueData: "BlackBox Symbol File"; Flags: deletekey uninsdeletekey
Root: HKCR; Subkey: "osffile\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: """{app}\BlackBox.exe"",2"; Flags: deletekey uninsdeletekey
Root: HKCR; Subkey: "osffile\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\BlackBox.exe"" /o ""%1"""; Flags: deletekey uninsdeletekey
Root: HKCR; Subkey: "osffile\shell\print\command"; ValueType: string; ValueName: ""; ValueData: """{app}\BlackBox.exe"" /p ""%1"""; Flags: deletekey uninsdeletekey
Root: HKCR; Subkey: ".ocf"; ValueType: string; ValueName: ""; ValueData: "ocffile"; Flags: deletekey uninsdeletekey
Root: HKCR; Subkey: "ocffile"; ValueType: string; ValueName: ""; ValueData: "BlackBox Code File"; Flags: deletekey uninsdeletekey
Root: HKCR; Subkey: "ocffile\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: """{app}\BlackBox.exe"",3"; Flags: deletekey uninsdeletekey
Root: HKCR; Subkey: "ocffile\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\BlackBox.exe"" /o ""%1"""; Flags: deletekey uninsdeletekey
Root: HKCR; Subkey: "ocffile\shell\print\command"; ValueType: string; ValueName: ""; ValueData: """{app}\BlackBox.exe"" /p ""%1"""; Flags: deletekey uninsdeletekey


Details must be looked up in the InnoSetup docu and/or Windows/regedit.

- Josef
Josef Templ
 
Posts: 195
Joined: Tue Sep 17, 2013 6:50 am

Re: File association

Postby Robert » Mon Mar 19, 2018 5:24 pm

One very minor problem I still have is that the code files (*.ocf) are marked with the standard BlackBox icon. I seem to remember thay had their own icon (with 0s & 1s ?).
Is there an easy way to fix this?

Did osf files also have a unique icon?
User avatar
Robert
 
Posts: 108
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Next

Return to Common questions

Who is online

Users browsing this forum: No registered users and 0 guests

cron