Note
|
Installation instructions in this repository are no longer maintained or recommended. Please refer to Metanorma installation docs (which also cover Windows) instead. |
This repository provides installation of the Metanorma publication toolchain on Windows.
There are two types of installation:
-
Docker: allows easier management of dependencies
-
Native: better performance
-
Windows 8+ for native installation
-
Windows 10 for the “Docker for Windows” installation
Older versions may work but are not tested.
Right-click on the “Start” menu, and click on “Windows PowerShell (Admin)”.
You will be presented with the following alert, click “Yes” to start the shell.
Run the commands as specified:
If you’d like to run via cmd.exe
(run with Administrator privileges):
bitsadmin /transfer get https://raw.githubusercontent.com/metanorma/metanorma-windows-setup/master/install.bat %cd%\install.bat & .\install.bat
If you’d like to run via PowerShell (again, run with Administrator privileges):
(Invoke-WebRequest 'https://raw.githubusercontent.com/metanorma/metanorma-windows-setup/master/install.bat' -OutFile 'install.bat'); .\install.bat
Run the commands as specified:
If you’d like to run via cmd.exe
(run with Administrator privileges):
bitsadmin /transfer get https://raw.githubusercontent.com/metanorma/metanorma-windows-setup/master/docker.bat %cd%\docker.bat & .\docker.bat
If you’d like to run via PowerShell (again, run with Administrator privileges):
(Invoke-WebRequest 'https://raw.githubusercontent.com/metanorma/metanorma-windows-setup/master/docker.bat' -OutFile 'docker.bat'); .\docker.bat
If automatic installation doesn’t work for you for some reason, follow steps bellow.
Running Metanorma requires installation of the following software:
-
“Docker” is required to run Metanorma on Windows;
-
“Git” is recommended for sharing and running the examples;
There are two ways to install prerequisite packages on Windows:
-
Via the Chocolatey package manager (recommended). Chocolatey allows you to mostly automate the install process without human input.
-
Via manual downloads and installs
You can install Chocolatey with cmd.exe
or PowerShell.
Let’s take the PowerShell method as an example.
Note
|
Refer to detailed steps here: https://chocolatey.org/install |
We strongly recommend installing “Git” using Chocolatey.
Go to this website to download “Git for Windows”:
And install it.
Again, life is much easier using Chocolatey.
The following command installs “Docker for Windows”
choco install docker-for-windows -y
-
Go to the Docker Store to download “Docker for Windows”
-
While the Docker Store asks you to login before downloading, the link is actually available without needing to authenticate (download link)
-
Open the downloaded file.
-
-
Allow the install to execute with administrative access
-
See the installation progress.
-
Continue with the default configuration. DO NOT select “Use Windows containers instead of Linux containers” otherwise the Metanorma container cannot run. It must be run with “Linux containers”.
-
(Luckily, if you have selected this, it is switchable afterwards)
-
-
Installation is completed and a restart is required.
This section is relevant regardless of which method you used to install Docker for Windows.
On the first restart, you will asked by Docker to enable Hyper-V and the Containers service as shown below. This is mandatory for running Docker on Windows. Click “OK” to accept the install and restart, but remember to switch back to using “Linux containers” prior to running Metanorma.
After the restart you will see Docker being up as shown below!
If you mistakenly enabled “Windows containers”, you will have to switch back to “Linux containers” to run the Metanorma container.
Otherwise you will be given the dreaded “image operating system “linux” cannot be used on this platform”.
When running the following commands, you may be prompted to share your current drive, such as “C:\”, as shown below. This is necessary to allow the Metanorma Docker container to read the files in the cloned directory.
Click “Share It” to share the drive with the Metanorma Docker container.
docker run -v ${pwd}:/metanorma/ ribose/metanorma "metanorma -t iso -x html,xml,doc iso-rice-en.adoc"
git clone https://github.com/metanorma/unece-cefact-recommendation-42
cd unece-cefact-recommendation-42
docker run -v ${pwd}:/metanorma/ ribose/metanorma "metanorma -t cefact -x html,xml,doc unece-cefact-recommendation-42.adoc"
If you run into any problems, please copy and paste the entire log into a new GitHub Issue for us.