Orbiter-Forum  

Go Back   Orbiter-Forum > Projects > ORBITER: 2010-P1 > Feature
Register Blogs Orbinauts List Social Groups FAQ Projects Mark Forums Read

Orbiter association with *.scn files Issue Tools
issueid=809 07-15-2011 06:16 PM
Orbinaut
Orbiter association with *.scn files
Double-clicking and *.scn file will open it in Orbiter

Like in title. After double-clicking a scenario file Orbiter will load it into RAM and run it. It may help developers in developing scenarios, because it's faster to open single file instead of launching Orbiter and searching it.
Issue Details
Issue Type Feature
Project ORBITER: 2010-P1
Status Request
Priority 5 - Medium
Suggested Version 101016
Implemented Version (none)
Votes for this feature 4
Votes against this feature 4
Assigned Users (none)
Tags (none)

07-15-2011 06:24 PM
orb orb is online now
O-F Administrator
Ninja
 
If it's implemented, then either only as an option for MSI installer, or an option (disabled by default) for installation verification tool. Until then, you can add the association by yourself.
Reply
07-16-2011 02:21 PM
Orbinaut
 
Quote:
Originally Posted by orb
 If it's implemented, then either only as an option for MSI installer, or an option (disabled by default) for installation verification tool. Until then, you can add the association by yourself.
I've tried to open scenario files with Orbiter but it doesn't work.
Reply
07-16-2011 04:55 PM
Donator
 
I'm not sure how Orbiter receives the filehandle for the scenario, but couldn't you just pass it as a pointer to argv?
Reply
07-16-2011 06:54 PM
orb orb is online now
O-F Administrator
Ninja
 
Quote:
Originally Posted by luki1997a
 I've tried to open scenario files with Orbiter but it doesn't work.
Works fine for me for file association (e.g. HKCR\.scn\Shell\open\command) with this command:
Code:
cmd.exe /c start "Orbiter" /DD:\Orbiter\101016 D:\Orbiter\101016\orbiter.exe -s "%1"
Of course a path to your Orbiter should be provided instead of "D:\Orbiter\101016".
Reply
07-17-2011 03:28 PM
Orbinaut
 
Ok, this is not exactly what I want to be implented.
I want *.scn files to be associated with orbiter just after installation. They should have an description and icon(It may be Orbiter default icon; I don't mean that every scenario file will have it's own icon(but it could be great))
e.g.
###
### Current state.scn | Orbiter scenario file
###
Reply
07-17-2011 04:26 PM
orb orb is online now
O-F Administrator
Ninja
 
Quote:
Originally Posted by luki1997a
 Ok, this is not exactly what I want to be implented.
I want *.scn files to be associated with orbiter just after installation.
No problem at all. Associate the .scn with the command to run it just after installation. You can add an icon for the file type, too (either by editing the association in Explorer, or by adding DefaultIcon key in registry for the file type). It's just a very low priority in my opinion, as users can make that file association by themselves.

When it's implemented though, I just don't want .scn automatically associated with Orbiter, because I usually use a couple of Orbiter installations at the same time, so just clicking on a scenario file isn't very useful for me.

For example you can add .scn association from (elevated / ran as Administrator in Vista/7) command line this way:
Code:
assoc .scn=OrbiterScenario
ftype OrbiterScenario=cmd.exe /c start "{window_title}" /D{path_to_orbiter} {path_to_orbiter}\orbiter.exe -s "%1"
Orbiter needs to be run by using cmd's start command, because of /D switch, which sets the working directory, otherwise it wouldn't be set to Orbiter's executable file location, but to location of scenario file.

After you have made that file association, you can edit it (by regedit) to add icon (create DefaultIcon key in HKEY_CLASSES_ROOT\OrbiterScenario and change the default value to path of icon file and index of the icon if it's inside of executable/library).
Reply
07-17-2011 05:42 PM
Addon Developer
 
Bad idea, IMHO. What happens if you have multiple Orbiter installations? And as an addon developer, I would find this annoying - it makes editing the scenario file harder. I have *.scn associated with Notepad, so I can easily look at or edit scenarios.
Reply
07-21-2011 02:16 PM
50% Orbinaut, 50% Developer
 
Same as SiameseCat. My .SCN files are associated to Notepad and this is great. This feature would also has to write in the registry. If you forgot to delete it when you uninstall Orbiter, you have another registry key that is unused. If you accumulate them, you'll end with a huge registry for nothing.
Reply
07-21-2011 08:45 PM
orb orb is online now
O-F Administrator
Ninja
 
Quote:
Originally Posted by Bibi Uncle
 Same as SiameseCat. My .SCN files are associated to Notepad and this is great. This feature would also has to write in the registry. If you forgot to delete it when you uninstall Orbiter, you have another registry key that is unused. If you accumulate them, you'll end with a huge registry for nothing.
It isn't a problem for both.

Removing from registry: One of the reasons I prefer adding this feature only to the MSI installer is the fact that uninstalling Orbiter (so not just simply deleting extracted from archive files) would be done via Windows installer as well, so it could remove added association too, if there was checked the checkbox to associate files during installation (the other reason is that I don't use the MSI installer for Orbiter ).

Preferred opening with Notepad: Scenario files can be associated with Notepad and Orbiter at the same time: with Orbiter for "Open" action, and with Notepad for "Edit" action. And even more, "Edit" action can be made as the default one (by setting the value of "shell" subkey), for example (shown as a part of .reg file for all users):
Code:
[HKEY_CLASSES_ROOT\.scn]
@="Orbiter.ScenarioFile"

[HKEY_CLASSES_ROOT\Orbiter.ScenarioFile]
@="Orbiter scenario"

[HKEY_CLASSES_ROOT\Orbiter.ScenarioFile\DefaultIcon]
@="<Path to Orbiter>\\orbiter.exe,0"

[HKEY_CLASSES_ROOT\Orbiter.ScenarioFile\shell]
@="edit"

[HKEY_CLASSES_ROOT\Orbiter.ScenarioFile\shell\edit\command]
@="notepad.exe \"%1\""

[HKEY_CLASSES_ROOT\Orbiter.ScenarioFile\shell\open\command]
@="cmd.exe /c start \"Orbiter\" /D\"<Path to Orbiter>\" \"<Path to Orbiter>\\orbiter.exe\" -s \"%1\""
The file association could be made also only for current user:
"HKEY_CURRENT_USER\SOFTWARE\Classes"

or system-wide, for all users:
"HKEY_LOCAL_MACHINE\SOFTWARE\Classes" = "HKEY_CLASSES_ROOT"


Note, that I'm not an advocate for that feature, as I voted against implementing it. I'm just showing, that other presented explanations against it, than only multiple installations of Orbiter, aren't any issue preventing implementing this feature.
Reply
07-22-2011 03:19 AM
Crazy dude with a rocket
 
i forget how it's done - but i think it's possible to just add a right-click menu option for .scn files to "Launch in Orbiter" by just adding a couple of registry entries like these...

i had done this once so i get an "open cmd here" command for launching the prompt at the current folder, but that was a while back and i forgot how i did it
Reply
07-22-2011 11:58 AM
orb orb is online now
O-F Administrator
Ninja
 
Quote:
Originally Posted by Moach
 i forget how it's done - but i think it's possible to just add a right-click menu option for .scn files to "Launch in Orbiter" by just adding a couple of registry entries like these...
It's as simple as adding a new subkey to the "shell" key of the file type. For example this way:
Code:
[HKEY_CLASSES_ROOT\Orbiter.ScenarioFile\shell\LaunchInOrbiter]
@="Launch in Orbiter"

[HKEY_CLASSES_ROOT\Orbiter.ScenarioFile\shell\LaunchInOrbiter\command]
@="cmd.exe /c start \"Orbiter\" /D\"<Path to Orbiter>\" \"<Path to Orbiter>\\orbiter.exe\" -s \"%1\""
Reply
07-22-2011 01:36 PM
50% Orbinaut, 50% Developer
 
Oh, I've just done the file association that you describe after my post. This is really great ! Thank you ! However, when you have multiple installations (like me), it is less useful.

I think that simply having the instructions to create the file association is the best.
Reply
Reply

Issue Tools
Subscribe to this issue

All times are GMT. The time now is 05:05 PM.

Quick Links Need Help?


About Us | Rules & Guidelines | TOS Policy | Privacy Policy

Orbiter-Forum is hosted at Orbithangar.com
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright ©2007 - 2012, Orbiter-Forum.com. All rights reserved.