1dustindavis / gorilla

Munki-like Application Management for Windows
Apache License 2.0
186 stars 21 forks source link

Feature Request: option to store scripts as discrete files on web server instead of embedded in catalogue #105

Closed discentem closed 3 years ago

discentem commented 3 years ago

Right now Gorilla requires users to embed check, pre-install, and post-install scripts in Catalogs. I'd love to see an option to store these scripts on the web server as normal .ps1 files and point to them with relative paths from the Catalog. I'm happy to write a pull request, I just have some questions.

1) Would you accept such a feature? 2) Should I cache the scripts on the client and reuse your already-built IfNeeded machinery? 3) I am thinking I am going to need to add new keys to Item and InstallCheck. Any preference or opinions on the names of the new keys? I was thinking something like this

type Item struct {
    Dependencies []string      `yaml:"dependencies"`
    DisplayName  string        `yaml:"display_name"`
    Check        InstallCheck  `yaml:"check"`
    Installer    InstallerItem `yaml:"installer"`
    Uninstaller  InstallerItem `yaml:"uninstaller"`
    Version      string        `yaml:"version"`
    BlockingApps []string      `yaml:"blocking_apps"`
    PreScript    string        `yaml:"preinstall_script"`
    PreScriptPath string `yaml:"preinstall_script_path"` // <--- new key
    PostScript   string        `yaml:"postinstall_script"`
    PostScriptPath string `yaml:"postinstall_script_path"` // <--- new key
}
....

type InstallCheck struct {
    File     []FileCheck `yaml:"file"`
    Script   string      `yaml:"script"` 
    ScriptPath string `yaml:"scriptPath"` // <--- new key
    Registry RegCheck    `yaml:"registry"`
}
....

Thanks! Brandon