Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

Add an Environment Variable 'refresh' before installing package #29

Open
gaelcolas opened this issue Jul 20, 2016 · 4 comments
Open

Add an Environment Variable 'refresh' before installing package #29

gaelcolas opened this issue Jul 20, 2016 · 4 comments

Comments

@gaelcolas
Copy link

Some packages, like RabbitMQ in the Chocolatey Repo, can have their installation customized based on Environment Variables (questionable but common method in *nix environment, and ported applications).

When using DSC and setting variables via the Environment resource (which, btw does not support [EnvironmentVariableTarget]), you'd need to restart before being able to install such package. Would it be possible to add a refresh Environment variable to the process that runs the install-package?

Would you consider a PR with the above?

Here's what the resulting configuration could look like:

        Environment RMQBase {
            Ensure            = 'Present'
            Name              = 'RABBITMQ_BASE'
            Value             = $Node.RabbitMQBase
        }

        Environment ErlangHome {
            Ensure            = 'Present'
            Name              = 'ERLANG_HOME'
            Value             = 'C:\Program Files\erl8.0'
        }

        PackageManagement RabbitMQ
        {
            Ensure            = 'present' 
            Name              = 'RabbitMQ'
            Source            = 'Chocolatey'
            DependsOn         = '[Environment]ErlangHome'
        }

The workarounds atm are: restarting, wait for next run, hack by killing session and restarting it, create custom PackageManagement resource to add the functionality...

@gaelcolas
Copy link
Author

By the way, the core functionality should probably be provided by PackageManagement module (as in, not the DSC resource), or the Chocolatey provider.
I believe this behaviour has been fixed in Chocolatey v9.10 (issue 664), but I believe we're still waiting for the full re-work of the Chocolatey provider.

@jianyunt
Copy link
Contributor

@gaelcolas. We welcome contributions from the community, i.e., accept PR.
You are right. We do not have OneGet-Chocolatey provider yet.

@gaelcolas
Copy link
Author

I talked with @grayzu about this, and I'm not sure about how to implement such refresh in the LCM, but would be happy to submit a PR if given a bit guidance.

@brywang-msft
Copy link

This issue was moved to OneGet/oneget#255

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants