VolantisDev / Launchpad

Step up your non-Steam game! Generate Steam-compatible .exe files to effortlessly launch any game through Steam with overlay support.
https://launchpad.games
MIT License
85 stars 3 forks source link

Move installerType to the service definition to prevent having to actually load ... #332

Closed github-actions[bot] closed 2 years ago

github-actions[bot] commented 2 years ago

Move installerType to the service definition to prevent having to actually load all installers

https://github.com/VolantisDev/Launchpad/blob/25c6bf5e8f56874fbeb3b6c10b2987543aab5f60/Lib/Shared/Volantis.App/Service/ComponentManager/InstallerManager.ahk#L9


class InstallerManager extends AppComponentManagerBase {
    __New(container, eventMgr, notifierObj) {
        super.__New(container, eventMgr, notifierObj, "installer.", InstallerBase)
    }

    RunInstallers(installerType := "", owner := "") {
        installers := []

        ; TODO: Move installerType to the service definition to prevent having to actually load all installers
        for (name, installer in this.All()) {
            if (!installerType || installer.installerType == installerType) {
                installers.Push(name)
            }
        }

        op := InstallOp(this.container.GetApp(), installers, owner)
        return op.Run()
    }
}

b70d24505502768d382203107944f19b9621dad1