You are here

File association

7 posts / 0 new
Last post
NathanJ79
NathanJ79's picture
Offline
Last seen: 4 years 10 months ago
Joined: 2007-07-31 15:07
File association

Look -- I might not know what I'm talking about here -- but I was just looking at the NSIS FAQ, and came across this: File Association

I'm going to assume that most of you NSIS wizards know about all that, it seems a pretty elementary function, doesn't look at all complicated.

So... couldn't certain launchers use that?

Say Portable Firefox launches, it registers itself as the handler for .htm, .html, and however it's done in a Windows system that when a URL is called, it opens (default browser, I guess). Then, when you close Firefox, as part of the launcher's cleanup, it undoes this. The code below (on the page) even covers restoring a backup (user's previous settings) and simply deleting the key if none existed before (e.g. we register .avi with VLC and before, the host computer had no such registration).

Wouldn't make sense with some apps as much as others.

Then again, what's StartPortableApps.exe? Is that a launcher or just a Q&D way to launch the menu? If it were a simple NSIS script compiled, couldn't it register stuff upon starting? I guess it would be an addition to the Format... there'd be a .ini for it, and when you install a portable app using that version of the format, it'd add it to the .ini, and the launcher would register all those extensions when you start it, and then unregister them when you exit the menu.

I know portable file association is being worked on, has been "being worked on" for a couple years, and is still in beta... I'm also sure this isn't an original idea, but it just dawned on me as a possibility looking at that page.

Am I onto something, or "been there, done that, isn't what we want"?

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 9 years 6 months ago
Joined: 2007-04-15 21:08
Isn't what we want

We don't want anything like that for our launchers. That's the region of things like PortableFileAssociator and eXpresso. Also, note that the File Association script does its work in a not-entirely-portable way; my quick analysis of the code is that it'll damage some things. Particularly, we like to avoid messing things up in event of system crash or similar - leaving settings behind is one thing, messing up their file extension registrations is another entirely. (Though when implemented properly, it would detect that it had died and fix it up for you, but you'd still need to run it.) Also, many people just won't want that sort of thing.

In regards to the File Association script, it's simple enough to do in raw NSIS code. Most of that script is just fancy stuff for variable verbosity in compilation and memory conservation if not used (that's what the ${CallArtificialFunction} stuff is there for; it makes it so that if it's not used it won't be included, whereas if it were done with a Function it would be included whether or not - same with all the Includes\****Func.nsh core headers).

StartPortableApps.exe just executes PortableApps\PortableApps.com\PortableApps.comPlatform.exe and that's all.

I am a Christian and a developer and moderator here.

“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1

portableapps_member
Offline
Last seen: 10 years 9 months ago
Joined: 2009-10-28 13:12
PortableFileAssociator is the

PortableFileAssociator is the best to handle those sort of things.
Enough with coffee, cafe, expresso, or any other alternatives.... I rather like to see more development with PortableFileAssociator since it has better potential.

gluxon
gluxon's picture
Offline
Last seen: 4 years 3 months ago
Developer
Joined: 2008-06-21 19:26
Hey, I find that quite

Hey, I find that quite insulting!

lol, just kidding. Blum

dinosoep
Offline
Last seen: 14 years 1 week ago
Joined: 2009-12-14 15:12
lol, coffeee and expresso and

lol, coffeee and expresso and al those strange names didn't attract me.
for me portable file associater really is the best Blum
didn't try coffee or expresso but your names are really confusing Blum

gluxon
gluxon's picture
Offline
Last seen: 4 years 3 months ago
Developer
Joined: 2008-06-21 19:26
I didn't come up with it. I

I didn't come up with it. Blum

I wanted to call it TEA.

dinosoep
Offline
Last seen: 14 years 1 week ago
Joined: 2009-12-14 15:12
lol, tea coffee

lol, tea coffee espresso,...
wait untill I release one named cappuccino Smile

Log in or register to post comments