Last updated on August 9, 2019
When installing HgLab on a clean system, it's recommended to install IIS before installing .NET Framework. Installing them the other way around doesn't cause any problems, but requires an extra step. See the Registering ASP.NET in IIS section below.
All the instructions below use DISM to install Internet Information Services.
Please note that these commands must be executed in an Elevated Command Prompt, which is summoned by right-clicking on the Command Prompt element in the Start menu and picking Run as Administrator
Run the following command in an Elevated Command Prompt:
dism /online /enable-feature /featurename:IIS-WebServerRole /featurename:IIS-WebServer /featurename:IIS-CommonHttpFeatures /featurename:IIS-Security /featurename:IIS-RequestFiltering /featurename:IIS-StaticContent /featurename:IIS-DefaultDocument /featurename:IIS-HttpErrors /featurename:IIS-HttpRedirect /featurename:IIS-ApplicationDevelopment /featurename:IIS-ISAPIExtensions /featurename:IIS-ISAPIFilter /featurename:IIS-HealthAndDiagnostics /featurename:IIS-HttpLogging /featurename:IIS-RequestMonitor /featurename:IIS-HttpTracing /featurename:IIS-Performance /featurename:IIS-HttpCompressionStatic /featurename:IIS-HttpCompressionDynamic /featurename:IIS-WebServerManagementTools /featurename:IIS-ManagementConsole /featurename:IIS-ManagementScriptingTools /featurename:WAS-WindowsActivationService /featurename:WAS-ProcessModel /featurename:WAS-ConfigurationAPI
Run the following command in an Elevated Command Prompt:
dism /online /enable-feature /featurename:NetFx4ServerFeatures /featurename:NetFx4 /featurename:NetFx4Extended-ASPNET45 /featurename:IIS-WebServerRole /featurename:IIS-WebServer /featurename:IIS-CommonHttpFeatures /featurename:IIS-Security /featurename:IIS-RequestFiltering /featurename:IIS-StaticContent /featurename:IIS-DefaultDocument /featurename:IIS-HttpErrors /featurename:IIS-HttpRedirect /featurename:IIS-ApplicationDevelopment /featurename:IIS-ApplicationInit /featurename:IIS-NetFxExtensibility45 /featurename:IIS-ISAPIExtensions /featurename:IIS-ISAPIFilter /featurename:IIS-ASPNET45 /featurename:IIS-HealthAndDiagnostics /featurename:IIS-HttpLogging /featurename:IIS-RequestMonitor /featurename:IIS-HttpTracing /featurename:IIS-Performance /featurename:IIS-HttpCompressionStatic /featurename:IIS-HttpCompressionDynamic /featurename:IIS-WebServerManagementTools /featurename:IIS-ManagementConsole /featurename:IIS-ManagementScriptingTools /featurename:WAS-WindowsActivationService /featurename:WAS-ProcessModel /featurename:WAS-ConfigurationAPI
When finished, confirm that the Web server works by opening up http://localhost/ in Internet Explorer.
Download the offline installer for Microsoft .NET Framework 4.6.2.
Follow the installer prompts. Note that a reboot might be required.
If you installed IIS after installing .NET Framework, there's an additional step you'll need to perform.
On a 32-bit system, run following commands in an Elevated Command Prompt:
%windir%\microsoft.net\framework\v4.0.30319\aspnet_regiis.exe -ir
iisreset
On a 64-bit system, run following commands in an Elevated Command Prompt:
%windir%\microsoft.net\framework64\v4.0.30319\aspnet_regiis.exe -ir
iisreset
Microsoft SQL Server 2008 Express is available free of charge and can be downloaded here. Note that there is a number of limitations for Express edition, notably:
All of this is more than enough, though, to run HgLab and to scale it to hundreds of repositories.
When installing Microsoft SQL Server, make sure to enable Mixed Mode Authentication.
Microsoft SQL Server, even Express edition, is a complex beast to install. See Installing SQL Server 2008 Express Guidance for instructions. If you have any questions, please contact HgLab Support.
You might also need to install Microsoft SQL Server 2008 Management Studio.
Connect to the Microsoft SQL Server instance and run the following script:
create database [hglab]; go use [master] create login [hglab] with password = N'hglab', /* Be sure to change the password */ default_database = [hglab], check_expiration = off, check_policy = off go use [hglab] create user [hglab] for login [hglab] exec sp_addrolemember N'db_datareader', N'hglab' exec sp_addrolemember N'db_datawriter', N'hglab' exec sp_addrolemember N'db_ddladmin', N'hglab'
Those with DBA-fu can tweak things accordingly.
Mercurial is trivial to install. Download an MSI for Mercurial 3.6 or above from Mercurial Downloads (make sure that it matches your platform) and click through the installer.
Download HgLab Installer and follow prompts.
The usual legalese you have to agree with to proceed with the installation.
This is where HgLab will be installed. Please note that this is not where HgLab will be storing all its data, including repositories and logs.
When setting a Connection String, stick to the following pattern:
data source={DATA-SOURCE};initial catalog={INITIAL-CATALOG};user id={USER-ID};password={PASSWORD}
DATA-SOURCE
is the hostname (or the IP address) of the machine Microsoft SQL Server is running on. (local)
or .
is used in case SQL Server is running on the same server with HgLab. Additionally, if you are running an Express version, you will need to specify Instance Name, which is separated by the backslash. Typical instance name for Express versions is SQLEXPRESS
, so DATA-SOURCE
for the Microsoft SQL Server Express running on the local machine will most likely be (local)\SQLEXPRESS
.{INITIAL-CATALOG}
is the name of the database created earlier.{USER-ID}
and {PASSWORD}
are the login and password, respectively, created earlier.Refer to ConnectionStrings.com for more information on how to construct a connection string.
HgLab Installer will not continue until it successfully connects using the Connection String provided.
Here are the important things it verifies:
db_datareader
, db_datawriter
and db_ddladmin
database rolesIn addition to specifying the traditional Installation Directory, you'll also need to set HgLab Home Directory. This will be the location where HgLab will be keeping all the repositories, logs and other resources. Since HgLab does a lot of intensive disk I/O as part of its normal operation, it is advised to have the HgLab Home Directory on a reasonably fast device - ideally, on a SAS or an SSD disk.
Starting from HgLab 1.10, Mercurial 3.6 or later is required to be present on the server where HgLab is being installed to.
This is where you decide how you would like to be accessing HgLab. Options are:
Either option is perfectly valid and HgLab supports both configurations equally well. Deciding on which option to pick is a matter of preference and infrastructure requirements.
After all this, it's just a matter of clicking "Next" and let the setup complete the installation.
When you first open up HgLab in your web browser, you will be greeted with a HgLab Setup page. Remember to get here first, because this is where the very first System Administrator user is created.
Upon completing HgLab Setup, you will then need to provide a License. You can get a full-featured 45-day Evaluation License or purchase a perpetual license.
And now you're all set.