Skip to content

Install TwinCAT HMI Engineering and Server automatically

The TwinCAT HMI setup files are based on InstallShield [Link to revenera.com]. By knowing this, several options are available to allow an easy way for you to trigger setup processes. Think about easy deployments to dozens of individual engineering machines. The InstallShield allows to modify the execution by append some arguments, check the official documentation for individual information [Link to InstallShield 2018 Help Library].

The most interesting part for me is the “Running Setup.exe Silently” topic [Link].

As it states, when you use

TE2000-HMI-Engineering.exe /s /v/qn

the setup will run silently and in the background. Sure, calling this would execute the setup process but the default preferences in the setup will be applied, i.e. no installation of any TwinCAT HMI in any available VisualStudio on your machine. It is important to provide additional information.

The setup supports a handful of arguments for the TE2000-HMI-Engineering.exe:

  • INSTALLTOVS2013=1 (relevant for TwinCAT HMI 1.10.x only)
  • INSTALLTOVS2015=1 (relevant for TwinCAT HMI 1.10.x only)
  • INSTALLTOVS2017=1 (relevant for TwinCAT HMI 1.12 AND 1.10.x)
  • INSTALLTOVS2019=1 (relevant for TwinCAT HMI 1.12.x only)
  • INSTALLTOTCXAESHELL=1
  • REBOOT=ReallySuppress
  • ALLUSERS=1

The TF2000-HMI-Server.exe setup supports some other arguments:

  • DELSERVERCONFIG=1
  • ENABLEHTTP=1
  • ENABLEIPV6=1
  • WIN64=1
  • WINCE=1
  • REBOOT=ReallySuppress
  • ALLUSERS=1

The arguments of the server in the list represent these gui-way configured checkbox hits:

Example “TE2000 HMI Engineering”

Let us see how the execution looks like. Check the following screeshot, the setup files are stored in “C:\TwinCAT HMI\” and in command prompt we enter:

TE2000-HMI-Engineering.exe /s /clone_wait /v"/qn 
     INSTALLTOVS2017=1 
     INSTALLTOVS2019=1 
     INSTALLTOTCXAESHELL=1 
     REBOOT=ReallySuppress ALLUSERS=1"

After entering of that command you will recognize some new processes in the task manager, but NO gui is popping into front.

The result will be a fully installed TwinCAT HMI Engineering:

Example “TF2000 HMI Server”

Just call:

TF2000-HMI-Server.exe /s /clone_wait /v"/qn 
   DELSERVERCONFIG=1 
   ENABLEHTTP=1 
   ENABLEIPV6=1 
   WIN64=1 
   WINCE=1 
   REBOOT=ReallySuppress ALLUSERS=1"

As a result the installation will process in the background:

Diagnostic

When you run into trouble, just check the setup logfiles:

  • TE2000: %userprofile%\TE2000-HMI-Engineering.1.12.742.1.log
  • TF2000: %userprofile%\TF2000-HMI-Server.1.12.742.1.log

Use C# to install…

The following snippet provides two methods for installing the engineering and server (without any error handling or reporting):

namespace RiesBlog
{
    using System.Diagnostics;

    public class Installer
    {
        public static bool InstallServer(
            string fullPathToExe, 
            string workingDirectory,
            int timeoutInSeconds = 1000 * 60 * 15 /* default is 15 minutes */)
        {
            var arguments = "/s /clone_wait /v\"/qr "
                                + "REBOOT=ReallySuppress "
                                + "ALLUSERS=1\"\"";

            var process = new Process
            {
                StartInfo =
                {
                    WorkingDirectory = workingDirectory,
                    FileName = fullPathToExe,
                    Arguments = arguments,
                    ErrorDialog = true,
                    WindowStyle = ProcessWindowStyle.Minimized
                }
            };
            process.Start();
            return process.WaitForExit(timeoutInSeconds);
        }

        public static bool InstallEngineering(
            string fullPathToExe,
            string workingDirectory,
            int timeoutInSeconds = 1000 * 60 * 15 /* default is 15 minutes */)
        {
            var arguments = "/s /clone_wait /v\"/qr "
                   + "INSTALLTOVS2013=1 "
                   + "INSTALLTOVS2015=1 "
                   + "INSTALLTOVS2017=1 "
                   + "INSTALLTOVS2019=1 "
                   + "INSTALLTOTCXAESHELL=1 REBOOT=ReallySuppress ALLUSERS=1\"";

            var process = new Process
            {
                StartInfo =
                {
                    WorkingDirectory = workingDirectory,
                    FileName = fullPathToExe,
                    Arguments = arguments,
                    ErrorDialog = true,
                    WindowStyle = ProcessWindowStyle.Minimized
                }
            };
            process.Start();
            return process.WaitForExit(timeoutInSeconds);
        }
    }
}

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.