RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    Module depends on other module.

    Scheduled Pinned Locked Moved Help and Support
    scriptmoduledepends
    4 Posts 2 Posters 431 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      sleve_mcdichael
      last edited by

      Say I want to make a scriptmodule to install, for example, a Doom mod (IWAD), that relies on an existing lr-prboom installation. How would I write the scriptmodule to check for and install or update if necessary, the other package? I see @fn hasPackage() but it looks like this only works for native Debian packages and not RP's own packages, right?

      Would I just manually query the appropriate retropie.pkg in the PRboom install dir, or is there a slicker way?

      1 Reply Last reply Reply Quote 0
      • mituM
        mitu Global Moderator
        last edited by

        Use rp_isInstalled to check if another scriptmodule is installed.

        S 1 Reply Last reply Reply Quote 0
        • S
          sleve_mcdichael @mitu
          last edited by

          @mitu ah thanks, I knew I had seen an rp_something I was just looking in the wrong place (helpers).

          And then if it's not installed, I'd do that with rp_installModule lr-prboom which is the same as rp_callModule lr-prboom _auto_ right?

          Would this all go in the depends_ function of the other module?

          And if I want to make sure it's the latest version anyway, could I just skip the check for rp_isInstalled and just do something like this?

          function depends_mymod() {
              rp_callModule lr-prboom _autoupdate_
          }
          
          mituM 1 Reply Last reply Reply Quote 0
          • mituM
            mitu Global Moderator @sleve_mcdichael
            last edited by

            @sleve_mcdichael said in Module depends on other module.:

            And then if it's not installed, I'd do that with rp_installModule lr-prboom which is the same as rp_callModule lr-prboom auto right?

            Yes.

            Would this all go in the depends_ function of the other module?

            Yes, you can add it there.

            And if I want to make sure it's the latest version anyway, could I just skip the check for rp_isInstalled and just do something like this?
            ...

            You could, but that would attempt to install/check update for lr-prboom each time instead of just checking locally that lr-prboom is installed.

            1 Reply Last reply Reply Quote 1
            • First post
              Last post

            Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

            Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.