lib/puppet_x/chocolatey/chocolatey_common.rb
## determines if C# version of choco
determines if C# version of choco
determines if C# version of choco
def chocolatey_command
        if Puppet::Util::Platform.windows?
          chocoInstallPath = PuppetX::Chocolatey::ChocolateyInstall.install_path
          chocopath =  (chocoInstallPath if (chocoInstallPath && file_exists?("#{chocoInstallPath}\\choco.exe"))) ||
              ('C:\ProgramData\chocolatey' if file_exists?('C:\ProgramData\chocolatey\choco.exe')) ||
              ('C:\Chocolatey' if file_exists?('C:\Chocolatey\choco.exe')) ||
              "#{ENV['ALLUSERSPROFILE']}\\chocolatey"
          chocopath += '\choco.exe'
        else
          chocopath = 'choco.exe'
        end
        chocopath
      end
def chocolatey_command if Puppet :: Util :: Platform . windows? chocoInstallPath = PuppetX :: Chocolatey :: ChocolateyInstall . install_path chocopath = ( chocoInstallPath if ( chocoInstallPath && file_exists? ( "#{chocoInstallPath}\\choco.exe" ) ) ) || ( 'C:\ProgramData\chocolatey' if file_exists? ( 'C:\ProgramData\chocolatey\choco.exe' ) ) || ( 'C:\Chocolatey' if file_exists? ( 'C:\Chocolatey\choco.exe' ) ) || "#{ENV['ALLUSERSPROFILE']}\\chocolatey" chocopath += '\choco.exe' else chocopath = 'choco.exe' end chocopath end
determines if C# version of choco
determines if C# version of choco
# When attempting to find the choco command executable, the following # paths are checked: # - Start with the install_path. If choco is found with environment #   variables through the registry or a check on the #   ChocolateyInstall env var (first install of Choco may only have #   this), then use that path. # - Next look to the most commonly used install location (ProgramData) # - Fall back to the older install location for older installations # - If all else fails, attempt to find Chocolatey in the default place #   it installs