Install Chocolatey after manually downloading it to local – for windows.

June 14, 2023 |
Views 2583

technology

WHY TO INSTALL CHOCOLATEY?

First we need to know what is shopify? - Shopify  is an ecommerce platform to create an online store and sell products to customers around the globe. It is based out of the programming language - Ruby on Rails. It also uses PHP to process payments through its checkout system and in some other areas. Themes in Shopify are built using - Liquid which is an open-source template language created by Shopify and written in Ruby. It is the backbone of Shopify themes and is used to load dynamic content on storefronts. In order to develop themes in Shopify locally one need to install Chocolatey for Windows. Then will need to install themekit and finally shopify.

 

  1. I. Install Chocolatey

Requirement:

  • Visual studio code editor [VS Code]
  • Power Shell v2+
  • Windows 7+ / Windows Server 2003+
  • .NET Framework 4+

Step1: Create a folder. Open VS Code and open a new Terminal. Navigate to the newly created folder using "cd"

Step2: Run the code below in terminal

Get-ExecutionPolicy

If it returns Restricted, then run

        Set-ExecutionPolicy Bypass -Scope Process

Step3: Run the code below to install chocolatey

      Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

Wait for a few seconds and Chocolatey should install without any errors.

Confirm installation by running the code below:

choco

it will return the version of cholatey installed.

 

Scenerio 1: When chocolatey is not installed and returns an error :''

"This script contains malicious content and has been blocked by your antivirus software."

it may be coz of the anti-virus in the system or even windows defender

Solution: Disable the anti-virus 'real-time scanning' and 'Firewall' for an hour. Follow step1 and step2 above. Chocolatey will get installed.

Scenerio 2: When chocolatey is not installed even after disabling the anti-virus and still keeps returning the error:

"This script contains malicious content and has been blocked by your antivirus software."
Now only solution left is to download and install chocolatey manually, to do so follow the steps below:
  1. Click the link https://chocolatey.org/api/v2/package/chocolatey/ to download chocolatey version 2 (latest one for now)
  2. Copy the file to a new folder and name it 'chocolatey'. In my case I have created the folder 'chocolatey' inside C drive. Rename the chocolatey.2.0.0.nupkg to chocolatey.2.0.0.zip
  3. extract the files
  4. naviagte to folder C: drive> chocolatey > chocolatey.2.0.0 > tools > chocolateyInstall.ps1
  5. Open a new terminal in VSCode,
    change directory (cd) to the path below: run the codeC:\chocolatey\chocolatey.2.0.0\tools> Start-Process powershell -Verb runAs

This will open Windows PowerShell in elevated and will prompt to type in Yes or No
Type in Y and press enter

  1. In PowerShell window navigate (using cd) to the path
    C:\chocolatey\chocolatey.2.0.0\tools
  2. Run the code below:
    Get-ExecutionPolicy

it will return as Restricted

  1. Run the code below to bypass:

    Set-ExecutionPolicy Bypass

It will prompt to Yes or No. Type Y and press enter.

If not bypassed it will show an error as "running script is disabled on this system"

  1. Run the code below to finally install Chocolatey:

    & .\chocolateyInstall.ps1

Once successfully installed it shows as:

Chocolatey (choco.exe) is now ready.You can call choco from anywhere, command line or powershell by typing choco.Run choco /? for a list of functions.You may need to shut down and restart powershell and/or consoles

  1. To check if chocolatey is installed or not. Run the code:
    choco

it will return the version no.:

Chocolatey v2.0.0
Please run 'choco -?' or 'choco <command> -?' for help menu.

You can now close the Windows Powershell as you finally managed to install Chocolatey in your local . Tada!!

Note that Chocolatey is actually installed in C:programData\chocolatey.

Click on the links to install Themekit and finally Shopify in you local for Windows.

 

Related Articles

Related

Themes or Templates collection

Explore Now!

Follow Us

Write to us