Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
RocketMan
@RocketM96875137_twitter
Are you supposed to include "choco install" with every program when installing multiple programs? Thanks
TheCakeIsNaOH
@TheCakeIsNaOH
Not required, you can specify multiple in one command: choco install packageA packageB packageC etc
RocketMan
@RocketM96875137_twitter
Thanks
Kevin Weinrich
@kwein1

I now have a custom choco package, 'sccm' that appears to work (I need to test it on the remote server to ensure it works). I have added it to a local, Windows file share choco repository/source named 'ORDChoco'. I think I have those two steps right. This is all on server "A", the local server:
```choco list sccm -verbose -source ORDChoco
Chocolatey v0.10.15
sccm 0.1.0.20210106
Title: | Published: 1/8/2021
Number of Downloads: n/a | Downloads for this version: n/a
Package url
Chocolatey Package Source: n/a
Tags:
Software Site: n/a
Software License: n/a
Description: SCCM client install.

1 packages found.```

For my next two tricks, I need to get DSC to send the package to the remote server, "B". When I specify ChocolateyOptions, Source: ORDChoco, it appears to understand my DSC code, because my DSC push says
sccm not installed. The package was not found with the source(s) listed. Source(s): 'ORDChoco'

But then it fails to find the package (and maybe the Source?). I'm guessing that failure is because the Source is on server A. If that's the case, how do I use DSC to tell server B "Use the \A\store share that server A calls ORDChoco to pull the sccm package from A to B, then install it on B"?

(Sorry for the crappy formatting. I need to figure out the markup rules for Gitter)
rohitrg
@rohitrg
Hi,
I need help in creating packages to install on computers with no internet connectivity. This needs to be an offline installation package.
Paul Broadwith
@pauby

@kwein1 Use the cChocoSource resource of cChoco:

configuration ChocoSource {
    Import-DscResource -ModuleName cChoco

    Node 'localhost' {
        cChocoSource ORDChoco {
            Source = "\\serverA\fileshare"
            Ensure = 'Present'
        }
    }
}

You may need credentials and if that is the case then pass them in under the Ensure option after creating the object.

@rohitrg You will need to add the installer (or payload if it's not an installer) to the package itself. It's generally added either in the tools folder, or if it's many files, by creating a separate folder under the tools folder. See my Gitter package as an example (note you won't find the actual installer on that GitHub site as it's embedded in the package at the creation time automatically - however the code is in there that works with a local installer).
Tunisiano18
@tunisiano187
Hello everyone, Does anyone as a solution to pin package version with the chocolatey's module for puppet in a manifest?
Thank you
Kevin Weinrich
@kwein1

I now have choco working via DSC for packages that are stored in Chocolatey's public repo. And I have the ORDChoco Source set up via DSC. When I log in to the remote server, I can do this:

 choco list -source ORDChoco
Chocolatey v0.10.15
sccm 0.1.0.20210106
1 packages found.

That was created by the following DSCWorkshop-style configuration:

ChocolateyPackages:
  Software:
    Ensure: Present
  Sources:
    Name: ORDChoco
    Ensure: Present
    Source: '\\A\chiz$\software installs and downloads\ChocolateyPackages'
  Features:
    Name: useFipsCompliantChecksums
    Ensure: Present
  Packages:
    - Name: sccm
      Ensure: Present
      ChocolateyOptions:
        Source: ORDChoco

The one thing I still can't do is actually install my custom sccm package from ORDChoco. Am I getting hit with permissions, since I'm doing a DSC push from server A to B, and ORDChoco is on A? Is it because the account (SYSTEM, I guess?) that DSC is using can't access the share on A from B?

Here's the peccant part of my DSC push:

VERBOSE: [B]:                            [[ChocolateyPackage]Chocolatey_sccm::[ChocolateyPackages]ChocolateyPackages] Installing the
following packages:
VERBOSE: [B]:                            [[ChocolateyPackage]Chocolatey_sccm::[ChocolateyPackages]ChocolateyPackages] sccm
VERBOSE: [B]:                            [[ChocolateyPackage]Chocolatey_sccm::[ChocolateyPackages]ChocolateyPackages] By installing you
accept licenses for the packages.
VERBOSE: [B]:                            [[ChocolateyPackage]Chocolatey_sccm::[ChocolateyPackages]ChocolateyPackages] sccm not installed.
 The package was not found with the source(s) listed.
VERBOSE: [B]:                            [[ChocolateyPackage]Chocolatey_sccm::[ChocolateyPackages]ChocolateyPackages]  Source(s):
'\\A\chiz$\software installs and downloads\ChocolateyPackages'
Paul Broadwith
@pauby
@tunisiano187 I'd use an exec for that and maybe an unless or an onlyif if it's not been pinned (run choco pin and parse it) to be idempotent.
1 reply

The one thing I still can't do is actually install my custom sccm package from ORDChoco. Am I getting hit with permissions, since I'm doing a DSC push from server A to B, and ORDChoco is on A? Is it because the account (SYSTEM, I guess?) that DSC is using can't access the share on A from B?

You'll need to make sure B$ (dollar is important) has access to the share.

Kevin Weinrich
@kwein1
@pauby I don't know what B$ is - do you mean the server name followed by a $? As a userid?
Is there a better way to do this - to push the install file from A to B (via DSC somehow), and then install it locally on B via DSC?
Paul Broadwith
@pauby

@pauby I don't know what B$ is - do you mean the server name followed by a $? As a userid?

Yeah, the server name.

Is there a better way to do this - to push the install file from A to B (via DSC somehow), and then install it locally on B via DSC?

You could do it that way, but then you may have to update all of your packages that are using it.

If you want to use file shares with authorisation this is the way it needs to be done unfortunately. This is why we recommend you use a repository manager.

Kevin Weinrich
@kwein1
I was able to get the package install to work after changing the permissions on the Source share, as @pauby indicated - add B$ to NTFS permissions. Works great!
Kevin Weinrich
@kwein1

Now I'm working on my 2nd custom package. This one fails, which is probably due to something I'm not doing right in constructing the package. But when I look for details on precisely WHAT went wrong with the installation, I just get "See the log for details...". The log just says

2021-01-15 15:04:12,065 1316 [ERROR] - ERROR: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: The operation completed successfully.
2021-01-15 15:04:12,065 1316 [DEBUG] - Built-in PowerShell host called with ['[System.Threading.Thread]::CurrentThread.CurrentCulture = '';[System.Threading.Thread]::CurrentThread.CurrentUICulture = ''; & import-module -name 'C:\ProgramData\chocolatey\helpers\chocolateyInstaller.psm1'; & 'C:\ProgramData\chocolatey\helpers\chocolateyScriptRunner.ps1' -packageScript 'C:\ProgramData\chocolatey\lib\bigfix\tools\chocolateyinstall.ps1' -installArguments '' -packageParameters '''] exited with '-1'.
2021-01-15 15:04:12,065 1316 [DEBUG] - Calling command ['"C:\Windows\System32\shutdown.exe" /a']
2021-01-15 15:04:12,174 1316 [DEBUG] - Command ['"C:\Windows\System32\shutdown.exe" /a'] exited with '1116'

I just don't see what it didn't like. Is there any way to get further debugging info about why it blows up? Or how can I manually walk through the package installation?

Note: In my chocolateyinstall.ps1, I do a "reg import ..." command which IS working. So I'm pretty sure it's the "Install-ChocolateyInstallPackage ..." command that's failing.

Kevin Weinrich
@kwein1
It appears that if I manually do:
setup.exe /s /v/qn
from the chocolatey package folder on the target server, it works. But
cinst bigfix -s ordchoco
still doesn't. How can I see what command line choco is actually using to try to run the setup.exe? (As I understand, it's using my chocolateyinstall.ps1 to call Install-ChocolateyInstallPackage, and the magic happens inside there)
Sathish
@satheeshsoft
Previously created chocolatey package working fine. The same code i used in new package but some changes in install file name and descriptions. The new package created with cpack command but not installing it, install failed. https://github.com/satheeshsoft/Soft-Cleaner-CY can you say what is missing here?
Paul Broadwith
@pauby
@kwein1 Do you get any more info when adding -vd to the choco command line?
5 replies
@satheeshsoft Have you looked at the gist? The error is on this line.
VoomDev
@VoomDev
Is it possible to install choco on mac?
daebenji
@daebenji
would you please stop spamming!
VoomDev
@VoomDev
ok sorry
but is it possible to run choco on mac
daebenji
@daebenji
why would you need to to use choco on mac? they have homebrew and choco is trying to automate the installation of windows packages...
Paul Broadwith
@pauby
@VoomDev Chocolatey is the package manager for Windows. There is Homebrew on Mac.
(I removed the 'spam' comments)
Paul Broadwith
@pauby
@satheeshsoft The specific error is at these lines - it can't find the file.
Sathish
@satheeshsoft
@pauby got it, the directory name should be same name!
Paul Broadwith
@pauby
@satheeshsoft :+1:
Sathish
@satheeshsoft
again some doubts
the app directory should be inside chocolatey directory?
sorry i forgot can you explain how to overcome the error
Paul Broadwith
@pauby
@satheeshsoft Have you downloaded the Chocolatey Test Environment?
Sathish
@satheeshsoft
no
Paul Broadwith
@pauby
@satheeshsoft Then that would be my suggestion to allow you to troubleshoot the issue.
Sathish
@satheeshsoft
i created now but cinst not working message showing 3 attempts reached
created i think it may works fine, here checking max attempts reached
Paul Broadwith
@pauby
@satheeshsoft Are you testing this in the Chocolatey Test Environment?
Sathish
@satheeshsoft
its difficult to understand, now created the pack
test environment difficult to understand & time taking
if the test environment automated its fair (like very few user inputs & also it works for the user demand without asking to user)
just saying a suggession
uploaded new copy
@pauby thanking to you