Jump to content
LaunchBox Community Forums

Download on demand


Torquemurder

Recommended Posts

I'm a developer and I've been trying to find a way to add the ability to check if a ROM is installed, and, if not, download the file/directory from a server.

The issue that I'm running into is getting LB to pass along necessary info to my app.  If I use the 'Additional Apps' functionality, the %romfile%, etc variables do not appear to be supported.  I suppose I could work around this by creating a new emulator which acts as a proxy/wrapper for the actual emulator, but then it won't launch at all if the romfile doesn't exist.

At the moment, it appears that I have a case of you-can't-get-there-from-here.  Assuming that I'm not missing anything, I think that adding the framework to allow an application to be called that provides the romfile and launchbox installation path would be useful.  I'd love to be able to copy my LB installation, minus roms to a latop and not have to worry about needing 8tb+ of HD space.

I'm aware that ExoDOS implemented his own solution to this, but I don't think that is a workable solution for those of us with already-curated libraries.

Link to comment
Share on other sites

11 hours ago, Torquemurder said:

I suppose I could work around this by creating a new emulator which acts as a proxy/wrapper for the actual emulator, but then it won't launch at all if the romfile doesn't exist.

Your proxy/wrapper for the emu could be a batch file, AHK script or even something in C# (or similar).  If you leave the Custom Command-Line parameter blank, uncheck "Remove Quotes" and also "Remove file extension...", the full path to ROM is going to be received as %1 (or %1% in AHK).  From there it's just a matter of checking if the file exists in that location, if not, copy it (or whatever your plan is) then start the emulator with the appropriate command lines and %1 for the ROM file.  Heck, for that matter you can have it delete the ROM after the emulator exits if you're so inclined. ;) 

You could even pass %platform% to use to select a specific emulator. Making the 'wrapper' more generic.

I'm not sure how that works with Additional Apps.  You'd need to check "Use Emulator" and select your 'wrapper'.  I'd assume it passes the same Custom Command-Line Parameters you set in the emulator/wrapper for that given Platform. You may need to [re]set that in the emulators' Associated Platforms section under Default C-L P for the Platform(s).  If nothing else, you're still able to receive %1.

To ramp things up a bit, you could make use of Badges.  On your laptop copy, set all of the games "Installed" field to "false".  Then under Badges, check "Enable Installed" or "Enable Not Installed" (or both).  This way you get a visual indicator.

image.png.8458f3ef922f62a9f1be5ab515e94373.png

Then if you see a game you want to play that is indicated to be not installed, have your plugin(?) setup for when you right-click that game and select the plugin, it copies the game over and sets "Installed" to "true".  Although as I now see this [thought] in writing, it (almost) doesn't help you with Additional Apps.  "Almost" in that the plugin could copy the main game and its Additional Apps.  What's 1 or 2 more games on the laptop?

If you sync your LB installs between the Laptop and your main gaming PC (minus ROMs), that's not really the best option.  So then you go to Plan "C".  Create a plugin for a Custom Badge.  The plugin will: when you select a Platform, scan to see if the file exists in the games' Application Path. And if so, show a badge for the respective games.  Though this still doesn't really help with the Additional Apps.  For those, expand the Additional App to its 'own' game, or set it as the main game.?.?.

Just some thoughts showing where there's a will, there's a way.  And that you-can-get-there-from-here 😎

Link to comment
Share on other sites

Thanks for the reply.

I am debating whether or not to create a wrapper or a standalone tool to manage the library itself by editing the XML.  The main issue with the wrapper is that LB won't even attempt to launch it if the ROM doesn't exist in the first place.

I feel that the best way to handle this is for the LB team to add an option that will allow for an application to be launched (with the four available variables) when a rom file does not exist.

Edited by Torquemurder
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...