Author Topic: FileAss – A Cross-Platform File Association Manager Component  (Read 680 times)

Tony Stone

  • Sr. Member
  • ****
  • Posts: 300
FileAss – A Cross-Platform File Association Manager Component
« on: October 11, 2026, 11:16:50 pm »
I've been working on several Lazarus projects that need file associations, and rather than reinventing the wheel every time, I wanted a reusable, cross-platform component to handle it.

So, with a fair amount of help from AI (Codex), FileAss was born, featuring the appropriately named TFileAssMan component.

The idea is simple... drop a component on a form, configure your file extensions, descriptions, MIME types, icons, etc. through the Object Inspector, and let the library handle the OS-specific registration.

It currently targets Windows, Linux, and macOS, with separate runtime and design-time packages. The licensed under 0BSD, so use it however you like.

It's still new and certainly has issues.  So far I have only been able to do real tests on my Linux Mint machine and have integrated it into two of my applications.  I am currently testing on my Windows machine.  I do not have a Mac machine to properly test.

GitHub: https://github.com/TonyStone31/FileAss
Feedback, bug reports, and contributions are welcome. Hopefully somebody else finds the FileAssMan useful!  :D
« Last Edit: October 11, 2026, 11:19:28 pm by Tony Stone »

n7800

  • Hero Member
  • *****
  • Posts: 811
  • Lazarus IDE contributor
    • GitLab profile
Re: FileAss – A Cross-Platform File Association Manager Component
« Reply #1 on: October 11, 2026, 11:28:38 pm »
Hopefully somebody else finds the FileAssMan useful! [/size] :D

Sorry, but the translator didn't handle the phrase "file ass man" very well ))

Perhaps that is why the file association command in "cmd.exe" is named "assoc".

Or, it could be your intentional joke... If not, the name "FileAssocMgr" might interest you.

Tony Stone

  • Sr. Member
  • ****
  • Posts: 300
Re: FileAss – A Cross-Platform File Association Manager Component
« Reply #2 on: October 11, 2026, 11:40:44 pm »
The name was intentional...  I'm a bit childish at times.   :D   But it is accurate.

Tony Stone

  • Sr. Member
  • ****
  • Posts: 300
Re: FileAss – A Cross-Platform File Association Manager Component
« Reply #3 on: October 11, 2026, 11:53:10 pm »

Something I'd like some opinions on...

One thing I've been thinking about with FileAss is what should happen when a user opens an associated file while the application is already running.

Obviously, some applications want multiple instances, while others would prefer to pass the filename to the existing instance and open it there.

FPC already has SimpleIPC, so the communication side isn't particularly difficult.

My question is: Would you expect something like TFileAssMan to optionally handle this, perhaps through an OnOpenFile event, or would you rather leave instance management entirely to the application developer?

I'm leaning toward keeping FileAss focused on file associations rather than turning it into another application management framework. But I'd be interested in what others think.

cdbc

  • Hero Member
  • *****
  • Posts: 2977
    • http://www.cdbc.dk
Re: FileAss – A Cross-Platform File Association Manager Component
« Reply #4 on: October 12, 2026, 07:03:48 am »
Hi Tony
I simply love it -- Good on you mate  -- for bringing the humour \o/\ö/\o/  :D ;D :D
<afterthought>
...maybe my P.I.S.S-Framework could use a 'FileAssMan' on the team  8-) :D ;)
...or my M.I.L.F. app  8)
</afterthought>
Cool · Keep it coming...
edit:
Quote
Obviously, some applications want multiple instances, while others would prefer to pass the filename to the existing instance and open it there.
I'd let that be an option the user can turn On / Off according to h(er/is) temper... Prolly default it to multiple instances... 8)
Regards Benny
« Last Edit: October 12, 2026, 07:15:16 am by cdbc »
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

Tony Stone

  • Sr. Member
  • ****
  • Posts: 300
Re: FileAss – A Cross-Platform File Association Manager Component
« Reply #5 on: October 12, 2026, 03:26:20 pm »
lol I am glad you found humor in it.  It is a pretty serious component though and that is an option to enforce single instances now.  I don't want to cram too many features into it, I want it to stay dedicated to this fairly simple process of creating file associations and handling them and nothing more beyond what I have implemented so far.  The menu entries and exports for including with installers for example is as far as it will go.  It is already used in 3 of my applications now and it works perfect.  I would love for someone to test it on Mac and even Windows... I have a couple Windows machines and will test it all once more on here but I don't often have access to these Windows machines.  I really think it is such a simple component it will be able to be re-used in tons of Lazarus applications.  I have to say using AI to make this component was actually a lot of fun compared to other AI developed crap I have made.  I think the AI did a really good job for the most part and not including excessive code to handle edge cases that will never exist.  I took it step by step with the AI being very specific how I wanted things to work and function by function so it didn't get carried away with the typical AI crap where it writes 500 lines of code when one you you smart programmers could have done it in 50 lines and better. lol  I have some ideas for some other super simple components I want to use AI to build and take a similar approach.  I am gonna hold off on the P.I.S.S. frame work for now.... sounds like it will be a complex and very fluid project.   :D

cdbc

  • Hero Member
  • *****
  • Posts: 2977
    • http://www.cdbc.dk
Re: FileAss – A Cross-Platform File Association Manager Component
« Reply #6 on: October 12, 2026, 05:58:54 pm »
Hi
If you're curious, you can find P.I.S.S. in my GitLab repo, It's "Alive and Kickin'"  8-)
It has NOT been made with AI, but with blood, sweat and tears  :D ;D
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

Tony Stone

  • Sr. Member
  • ****
  • Posts: 300
Re: FileAss – A Cross-Platform File Association Manager Component
« Reply #7 on: October 12, 2026, 06:52:04 pm »
 :o 8-) That's hilarious.  I like it.  I will have to examine it more for some of my plugin ideas I have had over the years.  Maybe I can make use of that in my SketchUp clone as I have a radiant heat layout tool I want to some day build as a fully functional plugin and maybe sell it to industry pros in the HVAC business!  Maybe your blood sweat and tears can live on as something useful in Heckers Sketch.


A little update on the FileAss components.  It now has an enforcer for single instance enforcement and handoff of several files opening at once.  I really wish I could have did this fully without AI... I probably could have but it would have taken me a year to get it right!  As a hobbyist I have been relying heavily on AI to make my programs lately which some have been working out great for me.  I do fear it is making me a little bit lazy as some of this stuff I would have researched for many hours before having 10 lines of useful code.  Now I am getting it done in minutes and not doing the hard work of understanding the underlying system.  That to me is the main issue with some of this AI crap.  But it has its plus sides too.  I only announced this component here because I think from my "professional" experience the AI did a pretty good job at making this useful for ever in all of my programs.  Anyway... I have a couple other things mostly made by AI and as I go through the code I don't dare announce them yet... or maybe ever.  This one I feel is truly a quick useful tiny component that will be useful for a lot of developers.

Tony Stone

  • Sr. Member
  • ****
  • Posts: 300
Re: FileAss – A Cross-Platform File Association Manager Component
« Reply #8 on: October 13, 2026, 11:50:24 pm »
A little progress update on FileAss...

I've been polishing things up quite a bit, and I think it's turning into a genuinely handy little set of components for Lazarus developers.

For anyone who hasn't looked at it yet, the idea is to make everything feel like a typical Lazarus component. You install the package and get two nonvisual components on the component palette:
  • TFileAssMan — Drop it on a form, configure your file extensions, MIME types, document icons, etc. through the Object Inspector, and call RegisterAll or UnregisterAll. It can also generate the necessary files for including associations in your application's installer.
  • TFileAssInstance — An optional component for single-instance enforcement and forwarding files to an already-running application. You can configure it through the Object Inspector too, without writing your own IPC code. It even handles multiple files and queues requests while the application is starting.
Both are intended to be simple drop-in components. No complicated framework to learn.

Some good testing progress too! Linux Mint is working well in my applications, and the project has now been tested on macOS Sequoia in an Intel VM, including opening documents into an already-running application.

The instance management code has also been through some pretty aggressive testing with 50 simultaneous launches and crash recovery.

Windows
still needs more testing on actual Windows machines rather than just Wine, my VM and my 10 minute tests on a real Windows laptop.

There's a working Lazarus demo included, along with a developer guide explaining the properties and usage.

I'm trying hard not to turn this into some enormous framework. I want it to remain a simple, reusable solution to a problem I've encountered repeatedly in my own applications.

If anyone wants to give it a try, especially on Windows or macOS, I'd really appreciate some feedback.

https://github.com/TonyStone31/FileAss
Still 0BSD licensed, so you're free to put the FileAssMan to work wherever you need him.

El Salvador

  • Full Member
  • ***
  • Posts: 148
Re: FileAss – A Cross-Platform File Association Manager Component
« Reply #9 on: October 14, 2026, 12:25:09 pm »
So, with this component, will it be possible to replicate this software? https://github.com/gluxon/eXpresso/

Just so I understand.

Tony Stone

  • Sr. Member
  • ****
  • Posts: 300
Re: FileAss – A Cross-Platform File Association Manager Component
« Reply #10 on: October 14, 2026, 07:32:49 pm »
I had to look into eXpresso a little bit to understand what it does.

FileAss handles normal operating system file associations, so it can accomplish the same basic result of opening associated files with an application.

From what I understand, eXpresso is specifically designed for portable applications and intercepts file double-clicks without modifying the host computer's file associations.

FileAss doesn't do that. It uses the native OS registration mechanisms, so it wouldn't be a direct replacement for eXpresso.

It's an interesting project though... You could potentially use my LazHIDControl package to build a program that replicates Expresso.

 

TinyPortal © 2005-2018