## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
##### Activity
• 06:41
gep13 closed #693
• 06:41
gep13 commented #693
• 06:40
gep13 milestoned #693
• 06:40
gep13 labeled #693
• 06:40

gep13 on develop

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

• 06:39

gep13 on develop

(maint) Remove mention of ZenHu… (compare)

• 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
• 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
• Jul 11 07:43
mtnielsen commented #511
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
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
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
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
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?
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.
Richard Simpson
@RichiCoder1
:+1: Good luck! If you have anymore questions, feel free to ask (though preferably in chocolatey/choco ;P)
Hitesh
@TechMinder
okay, my goal was to run ChocolateyGUI . so I posted all the questions here. :smile:
Richard Simpson
@RichiCoder1
Absolutely, if you run into Gui specific issues post here.
Hitesh
@TechMinder
Thanks @ferventcoder @RichiCoder1 for help and answering questions.
@RichiCoder1 do we have plan to make choco standalone? It worked for me with extra command to setup environment variable.
Richard Simpson
@RichiCoder1
@TechMinder That's a @ferventcoder question. My understanding is no, but that could change.