Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 13:22
    Sukender opened #694
  • Aug 21 06:41
    gep13 closed #693
  • Aug 21 06:41
    gep13 commented #693
  • Aug 21 06:40
    gep13 milestoned #693
  • Aug 21 06:40
    gep13 labeled #693
  • Aug 21 06:40

    gep13 on develop

    (GH-693) Clarify usage requirem… (compare)

  • Aug 21 06:39

    gep13 on develop

    (maint) Remove mention of ZenHu… (compare)

  • Aug 21 04:00
    Lemmingh opened #693
  • Aug 09 14:39
    cybercatgurrl commented #617
  • Aug 01 08:39
    pascalberger commented #692
  • Aug 01 07:56
    gep13 commented #692
  • Aug 01 07:34

    mwallner on develop

    (build) Disable documentation o… (compare)

  • Aug 01 07:34
    mwallner closed #692
  • Aug 01 07:33

    mwallner on develop

    (doc) Fix typo (#691) (compare)

  • Aug 01 07:33
    mwallner closed #691
  • Jul 31 05:46
    AdmiringWorm commented #637
  • Jul 30 21:36
    pascalberger opened #692
  • Jul 30 21:32
    pascalberger opened #691
  • Jul 30 19:41
    mwallner commented #637
  • Jul 28 13:02
    pherwanikar commented #12
Rob Reynolds
@ferventcoder
the batch may not have it available yet
if you ran that by cmd.exe, you should call echo %ChocolateyInstall%
Hitesh
@TechMinder
@ferventcoder I ran that command in windows powershell.
Rob Reynolds
@ferventcoder
so shells don't update until closed and reopened (for environment variables)
and sometimes explorer won't catch updates either
Hitesh
@TechMinder
@ferventcoder got it!
Rob Reynolds
@ferventcoder
if explorer hasn't noticed, you will need to reboot the machine for it to take effect
but an install of choco will set that variable
you will see it if you head into system properties and look at the variables
or into the registry where those are kept
Hitesh
@TechMinder
@ferventcoder I installed chocolateygui in separate cmd.exe(Administrator). And i got the same Autofac exception on first run. If I run ChocolateyGui as administrator then it works fine.
Rob Reynolds
@ferventcoder
it's creating files it should not
it won't do that if that environment variable is recognized
Hitesh
@TechMinder
@ferventcoder yep! that's the issue. I don't know why it won't create environment variable even if I run the batch as administrator. Do you think it's not right approach to install chocolatey?
@ferventcoder I forgot to mention, the batch file is on shared location.
Rob Reynolds
@ferventcoder
install choco as an admin
that's fine
the problem is likely elsewhere
If you see this only happen on a handful of systems
it's explorer.exe not recognizing the updated values
Hitesh
@TechMinder
it's happening on every machine where I am installing using batch file.
Rob Reynolds
@ferventcoder
you can try this from cmd.exe to trigger it: setx trigger 1, then close and reopen everything
take a look at how choco handles updating environment variables for clues to what may be going on - https://github.com/chocolatey/choco/blob/2f588e755e33e4476f5170494c097932a23e1554/src/chocolatey.resources/helpers/functions/Set-EnvironmentVariable.ps1
Hitesh
@TechMinder
@ferventcoder thanks Rob, let me try this.
Rob Reynolds
@ferventcoder
you can try killing and restarting explorer.exe (it's a bit hacktastic as compared to a reboot, but... (shrugs))
that will ensure all environment settings and changes get loaded
start with setx
Hitesh
@TechMinder
Thanks Rob, I will try the options you provided.
thanks for your help. I will let you know if it gets solved..
Rob Reynolds
@ferventcoder
Also, follow this -chocolatey/choco#1297
Hitesh
@TechMinder
@ferventcoder as per your suggestion, I am setting up envionrment variable ChocolateyInstall through command after installing Chocolatey as an admin. It works now.
Rob Reynolds
@ferventcoder
@TechMinder you should not need to, it will add it
if it doesn't, that is a bug
but I did ask you to verify that it was added to the registry already
Because many times Windows does weird stuff
it's helpful to know if it is something local acting weird or not
Hitesh
@TechMinder
@ferventcoder I didn't found any entry in the registry. I tried same approach on at least three different machines, and I got same error on each. I restarted computer and still no changes to environment variable.
Rob Reynolds
@ferventcoder
How are you installing choco?
@TechMinder ^^
Hitesh
@TechMinder
@ferventcoder running batch file as an admin

@ferventcoder ```
CD %UserProfile%\My Documents

SET chocoDir=choco
IF not exist %chocoDir% (mkdir %chocoDir%)

CD %chocoDir%

COPY "\<network path>\choco\choco.exe"

choco.exe install Chocolatey

setx ChocolateyInstall "%UserProfile%\My Documents\choco"

start CMD /k "\<network path>\choco\installgui.bat"```

this is the script.
Rob Reynolds
@ferventcoder
So that explains the issue :+1:
https://chocolatey.org/install - click on more options and see offline script
Rob Reynolds
@ferventcoder
@TechMinder ^^
Hitesh
@TechMinder
@ferventcoder thanks for pointing to me right material. I am still trying to understand the issue. My understanding is Choco.exe is standalone executable so it should not matter how the install Chocolatey command is called. Please correct me if I am wrong. The issue with my script is powershell executionpolicy, is that correct?
I am talking about without downloading chocolatey nupkg file.
Richard Simpson
@RichiCoder1
@TechMinder Choco.exe is not standalone. Or at least not completely. It initializes a fair amount of context and settings that must be present for it to work properly.
If you poke inside the nupkg (It's just a zip), you'll notice there's install scripts and tools and helpers and more.
Hitesh
@TechMinder
Thanks @RichiCoder1 , now I got the answer. I will follow the steps defined on the page.