Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add run flag to package config entries #585

Closed
stevemk14ebr opened this issue Apr 12, 2024 · 2 comments
Closed

Add run flag to package config entries #585

stevemk14ebr opened this issue Apr 12, 2024 · 2 comments
Labels
💎 enhancement It is working, but it could be better ❔ discussion Further discussion is needed

Comments

@stevemk14ebr
Copy link

stevemk14ebr commented Apr 12, 2024

Details

Some packages (such as PDBReSym - mandiant/VM-Packages#986 (comment)) have installer.ps1 files that not only install the tool, but run it. This is not ideal, there is a difference between installation of a tool and executing it. For this package in particular, we always want it to be installed, but do NOT always want it to be run because it can bloat the VM. I suggest we extend the installer.ps1 scripts to accept a run argument to indicate if the package should be run after installation. The config.xml files can have the flag present like this <package name="PDBReSym.vm" run=false/>. This way packages can be included in the default configuration always, but only run in FULL configurations sometimes.

@emtuls
Copy link
Member

emtuls commented Apr 12, 2024

This seems fairly possible to do if we used this: https://docs.chocolatey.org/en-us/create/functions/get-packageparameters
Note the part: choco install <pkg_id> --params "'/LICENSE:value;". We would use something like run instead, then inside of packages we could test for this to determine if it should be run or not.

Example 2:
# see https://docs.chocolatey.org/en-us/guides/create/parse-packageparameters-argument
# command line call: `choco install <pkg_id> --params "'/LICENSE:value'"`
$pp = Get-PackageParameters
# Read-Host, PromptForChoice, etc are not blocking calls with Chocolatey.
# Chocolatey has a custom PowerShell host that will time these calls
# after 30 seconds, allowing headless operation to continue but offer
# prompts to users to ask questions during installation.
if (!$pp['LICENSE']) { $pp['LICENSE'] = Read-Host 'License key?' }
# set a default if not passed
if (!$pp['LICENSE']) { $pp['LICENSE'] = '1234' }

That being said, I think mandiant/VM-Packages#991 might be the way to go for now, but this may be something to consider down the road.

@emtuls emtuls added 💎 enhancement It is working, but it could be better ❔ discussion Further discussion is needed labels Apr 12, 2024
@Ana06
Copy link
Member

Ana06 commented May 13, 2024

mandiant/VM-Packages#991 fixed this issue. I think splitting packages is a better approach as it uses the current structure. At the moment the packages do not receive arguments from the installer to run and It that would imply complicating the installer and the packages code.

@Ana06 Ana06 closed this as completed May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💎 enhancement It is working, but it could be better ❔ discussion Further discussion is needed
Projects
None yet
Development

No branches or pull requests

3 participants