Jump to content

Install software using chocolatey

Recommended Posts

#include <File.au3>




;Installs chocolatey.
$choco1 = "@powershell -NoProfile -ExecutionPolicy unrestricted -Command"
$choco2 = " (iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))) >$null 2>&1"
$choco3 = " && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

if not FileExists(@AppDataCommonDir & "\Chocolatey\") then
RunWait(@ComSpec & " /C " & $choco1 & $choco2 & $choco3, "", @SW_HIDE)
$find = '"' & "allowGlobalConfirmation" & '"' & " enabled=" & '"' & "false" & '"' & " setExplicitly=" & '"' & "false" & '"'
$replace = '"' & "allowGlobalConfirmation" & '"' & " enabled=" & '"' & "true" & '"' & " setExplicitly=" & '"' & "true" & '"'
_ReplaceStringInFile(@AppDataCommonDir & "\Chocolatey\config\chocolatey.config", $find, $replace)


;Install and uninstall functions
Func install($package_name,$notify)
RunWait(@ComSpec & " /C " & "choco install " & $package_name, "", @SW_HIDE)
if $notify = True Then MsgBox(64,"Installed", $package_name & " has been installed.")

Func uninstall($package_name, $notify)
RunWait(@ComSpec & " /C " & "choco uninstall " & $package_name, "", @SW_HIDE)
if $notify = True Then MsgBox(64,"Uninstalled", $package_name & " has been uninstalled.")


a small script i made to install software using chocolatey: https://chocolatey.org/

If chocolatey isn't installed, it will install it, and afterwards install the package you defined.


All packages can be found here: https://chocolatey.org/packages

Edited by legend
Link to post
Share on other sites

nice. this can be used to set up Sublime Text 3 to use the console when executing C# and other .NET languages! Until now I had to do in manually! thanks!

so, with every testing or dev vm, I set up my editor (licensed version gives me that right, as many as I want, everywhere, as long as it's only me using) I need to do this so this is going to save me some time.



Sublime Text is available for Mac, Windows and Linux. One license is all you need to use Sublime Text on every computer you own, no matter what operating system it uses.

Sublime Text uses a custom UI toolkit, optimized for speed and beauty, while taking advantage of native functionality on each platform.


Edited by Earthshine

My resources are limited. You must ask the right questions


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...