Loading a BlitzMax app as a default app?

BlitzMax Forums/BlitzMax Beginners Area/Loading a BlitzMax app as a default app?

ImaginaryHuman(Posted 2005) [#1]
I want to output a file from my BlitzMax program (just a bank of data or whatever), and give it an icon. I then want the user to be able to go to where that file is stored on their computer and click on the icon for the saved file. This should then automatically load up my original BlitzMax application and load the clicked file into it. How can this be achieved in a cross-platform friendly way? In other words, how can I give a file an icon and set up a default application for that file, that it is loaded into, and how can I get the app to accept the path of the file or whatever is necessary to load it?

Thanks in advance.


Yan(Posted 2005) [#2]
Setting the default app and icon would be a job for the installer, would it not?


BlitzSupport(Posted 2005) [#3]
That's OS-specific stuff really. On Windows, for example, it'd be a bunch of Registry entries for the particular file extension you use, and the OS (well, explorer.exe in Windows' case) would look up from there which app to run.


Phish(Posted 2005) [#4]
Yeah, definitely platform specific. With the Mac it's a question of what is stored in some special files within the .app package (you don't need to install to do this). However, I believe this could be very complicated to achieve with a BlitzMax app (not sure if it's even possible). So I suggest you don't bother - if it's possible I think it would be a nightmare to do by hand...


ImaginaryHuman(Posted 2005) [#5]
Hmm. My first response is that no it wouldn't be the job of the installer because we're talking about files that are generated by the app after the app has been installed and used by the user, and on an ongoing basis.

My second response is, drats.

It sounds like there would need to be a new command which, behind the scenes, did it individually different on each platform.

I guess one way to do it might be that you could create a dummy file with such an icon (just a text file for example), on each of the three platforms. Then set up the icon to automatically load the app. Then save those icons to a file and include it with the app. Then when the app creates a file, offload the icon?

Maybe I'll have to rethink this. Thanks.


Yan(Posted 2005) [#6]
Well, I know Windows installers (I've only ever used Inno Setup, but it's pretty standard) can set up file associations and icons for any data files for the app your installing. I presumed the same would be true for other platforms too.

As you'd need to compile and test on the target platform anyway, setting up each platforms installer package separately seems reasonable (ie custom icons etc.).

I have no idea how OSX and Linux handle these things though, so you may indeed have to handle this stuff manually on those platforms (although I kinda doubt it).