I’m trying to build a Firefox add-on which lets you create executable files which can be associated with a default program or added to the “Open With” list and possess its own icon.
I was hoping to avoid having the add-on compile files into exes, but…
- It does not seem batch files can have their own icons.
- Although one can pass batch instructions to cmd.exe via shortcut (and shortcuts can have their own icons) and a shortcut can even accept arguments (as in dropping files onto it), one apparently cannot add shortcuts to the “Open with” menu (the Open With dialog treats the shortcut as equivalent to the referenced executable, in this case, .exe, and without the extra parameters).
So, I’d like to know what other approaches might be available to me for building executables (or something that really functions like an executable) in a simple and transparent manner? I am leaning toward packaging an open-source batch-to-exe converter like http://sourceforge.net/projects/bat2exe/ (though I’d really hope to find one which itself can be controlled via command line) so I can build a batch file programmatically and then turn it into a full-blown executable with icon.
UPDATE
The primary reason I want to do this is for the sake of https://github.com/brettz9/webappfind . WebAppFind lets you open desktop files (while you are on your desktop) into web applications and currently comes with pre-built executables which can be associated with a given file extension (to work with Open With or as a default handler). These executables will be used to call Firefox (and my add-on, WebAppFind) with certain flags that allow WebAppFind to open the file in a web app (as determined by other factors like a filetypes.json file in the same directory as the file or a previously registered protocol handler correlated to the file extension, as explained at the repo).
However, what I cannot pre-build into the executable are all possible configuration directive combinations a user might wish to supply to the add-on or, more importantly, the specific Firefox profile in which they wish the app (with desktop file) to load. The ability to open a web app in any profile can allow for web apps to work more like executables–they get their own icon in the task bar, they don’t have to force the user to load a bunch of tabs or add-ons if, e.g., they just want to have open in a separate process their local HTML file in a JavaScript-based WYSIWYG HTML editor or their SVG file in an SVG-edit web app (And I also don’t want users to have to go through the trouble of associating an icon with the exe manually.)
7