Jack
Jack

Reputation: 723

How to properly and fully uninstall TwinCAT 3?

Disclaimer: I am aware that the "how to" questions are not very appreciated here but it was the most effective way to sum up my question and make it available for other people if an answer is found.

I have tried on multiple occasions to remove TwinCAT from a computer in order to reinstall it after some bugs.

But everytime it's been a huge hassle.

The official Beckhoff website says that running the installation program again and selecting the uninstall button works but the thing is that it only removes TwinCAT 3 and not its modules. At first I thought it was because TwinCAT XAE Shell was installed as well and the modules depended of XAE and not TwinCAT3 so I uninstalled XAE but the modules are still there.

After that I still end up with all these programs:

Programs left after uninstalling TwinCAT3 and TwinCAT XAE Shell

I find it very odd (if not extremely annoying) that the installation program is able to install so many programs but not uninstall them.

One time I tried to completely remove TwinCAT (and all its modules) from my computer and uninstalling the programs from the Windows Configuration Panel wasn't enough as some of the program stayed in the list after running the un-installation process (which meant the files were still present in my Program Files). It was also still present in my Visual Studio Extensions and couldn't be removed from Visual Studio. So I tried to manually delete their files, some of them were protected by some unidentified process (or processes?) I wasn't able to locate (it wasn't in my startup list).

The program/files that caused the most trouble uninstalling were:

After a windows search the remaining files are located (this a non exhaustive list) in C:\Users\xxx\AppData\Local, a lot in C:\Windows\Microsoft.NET\assembly\GAC_MSIL. And there is such an overwhelming amount of occurrences in the Registry Editor that I'm not going to attempt on listing them.

So I had to manually remove all Beckhoff mentions in my regedit and windows folders (such as Program Files, AppData etc).

After that, I was finally able to delete all TwinCAT components...

Note: CCleanerPro was unable to delete TwinCAT too.

This is very much the behavior of a virus, so I find it weird that there isn't a better way to do this...

Have you found a way to quickly uninstall TwinCAT from a computer?

Upvotes: 4

Views: 9050

Answers (6)

Evgeniy
Evgeniy

Reputation: 108

If you have issues with non removed drivers, I was able to remove them using pnputil command line. You can run it as administrator. With the grep installed all the drivers can be found by next command

pnputil /enum-drivers | grep -B 3 -A 4 "Beck"

Without grep it is only original command and manual investigation.

pnputil /enum-drivers

Next you can remove found by pnputil drivers using next command:

pnputil /delete-driver <driverfile> /uninstall /force

Here what I have ended up with:

pnputil /delete-driver oem0.inf /uninstall /force
pnputil /delete-driver oem65.inf /uninstall /force
pnputil /delete-driver oem96.inf /uninstall /force
pnputil /delete-driver oem22.inf /uninstall /force
pnputil /delete-driver oem23.inf /uninstall /force
pnputil /delete-driver oem101.inf /uninstall /force

Upvotes: 0

piertoni
piertoni

Reputation: 2021

This is a powershell script given by Beckhoff to uninstall everything, latest release are not included but should be simple to add in case:

# First Execution Policy has to set to RemoteSigned...
#
# Set-ExecutionPolicy RemoteSigned -Force
#
$AppsToRemove = @(
    # -- TC --
    'Beckhoff Support Info Report'        # 4022
    'Beckhoff Target Browser'             # >= 4022.14
    'Beckhoff TE130x Scope View'          # 4024
    'Beckhoff TE132x Bode Plot'           # 4024
    'Beckhoff TE1010 Realtime Monitor'
    'Beckhoff TE2000 HMI Engineering'
    'Beckhoff TE5950 Drive Manager 2'
    'Beckhoff TF3110 TC3 Filter Designer'
    'Beckhoff TF3300 Scope Server'
    'Beckhoff TF5400 TC3 Advanced Motion Pack'
    'Beckhoff TF5850 TC3 XTS Technology'  # does not work!
    'Beckhoff TF6010 ADS Monitor'
    'Beckhoff TF6100 OPC-UA'
    'Beckhoff TF6340 Serial Communication'
    'Beckhoff TF6xxx TwinCAT 3 Connectivity'
    'Beckhoff TwinCAT 3 Application Runtime Libraries (x64)' # 4024
    'Beckhoff TwinCAT 3 BlockDiagram'
    'Beckhoff TWinCAT 3 Scope'             # < 4024.0
    'Beckhoff TwinCAT 3 Type System (x64)' # 4024.0 only one
    'Beckhoff TwinCAT 3 Type System (x64)' # >= 4024.4 two and TFs can bring more!
    'Beckhoff TwinCAT AML DataExchange'    # 4024
    'Beckhoff TwinCAT PnP Driver Package'
    'Beckhoff TwinCAT 3 Measurement'       # 4024
    'Beckhoff TwinCAT Multiuser Git'       # >= 4024.4
    'Beckhoff TwinCAT Multiuser'           # 4024
    'Beckhoff TwinCAT 3.1 Remote Manager Components (Build 4018)' # RM 4018
    'Beckhoff TwinCAT 3.1 Remote Manager Components (Build 4020)' # RM 4020
    'Beckhoff TwinCAT 3.1 Remote Manager Components (Build 4022)' # RM 4022
    'Beckhoff TwinCAT 3.1 Remote Manager Components (Build 4024)' # RM 4024
    'Beckhoff TwinCAT 3.1 (Build 4024)' # TC3.1.4024
    'Beckhoff TwinCAT 3.1 (Build 4022)' # TC3.1.4022
    'Beckhoff TwinCAT XAE Shell'        # 4024
    'Git-for-TwinCAT-Multiuser'         # 4024.0 only
    'vs_minshellinteropmsi'             # 4024.0 only
    # ----- TC 2.11 x64 -----
    'TwinCAT 2.11 x64 Engineering'
    # ----- VS TcXae shell || VS2019 -----
    'Microsoft Help Viewer 2.3'         # TcXae Shell
    # ----- OPC UA -----
    'UaGateway 1.5.3'
    'UaGateway_COM_ProxyStub_3.00.101.2'
    )

$RegKeys = @(
    'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\'
    'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\'
    )

$Apps = $RegKeys |
    Get-ChildItem |
    Get-ItemProperty |
    Where-Object { $AppsToRemove -contains $_.DisplayName -and $_.UninstallString }

foreach( $App in $Apps ){
    $UninstallString = if( $App.Uninstallstring -match '^msiexec' ){
            "$( $App.UninstallString -replace '/I', '/X' ) /qn /norestart"
            }
        else{
            $App.UninstallString
            }

    Write-Verbose $UninstallString

    Start-Process -FilePath cmd -ArgumentList '/c', $UninstallString -NoNewWindow -Wait
    }

# TcCnc Service
$IsTcCnc = Test-Path HKLM:\SYSTEM\CurrentControlSet\Services\TcCnc
if ($IsTcCnc)
{
    Remove-Item HKLM:\SYSTEM\CurrentControlSet\Services\TcCnc
    }

# TcpIp Service
$IsTcCnc = Test-Path HKLM:\SYSTEM\CurrentControlSet\Services\TcpIpServer
if ($IsTcCnc)
{
    Remove-Item HKLM:\SYSTEM\CurrentControlSet\Services\TcpIpServer
}

Upvotes: 1

sander
sander

Reputation: 86

I had similar problems. After one by one uninstalling all the Beckhoff apps and searching for Beckhoff and TwinCAT in the registry I still couldn't delete

C:/TwinCAT/3.1/Driver/TcCnc.sys

What worked for me was to rename the top folder from TwinCAT to old-TwinCAT. Then I looked at event logs to identify the service that was now failing to launch and removed that.

But it's still not all gone. In Windows 11 Pro settings->network->advanced network settings->->more adapter options (edit) I found a TwinCAT network client. Removing that fixed a VmWare bridged networking problem where my wired adapter was not shown on the list of adapters.

If I have to use TwinCAT again I will install it on a separate PC that I intend to wipe after.

Upvotes: 0

Sparkes
Sparkes

Reputation: 1

When I've hit this issue the advice from Beckhoff UK was to use Revo Uninstaller.

I found the “free” version from PortableApps.Com did the job, as yet no other side effects of the uninstall noticed.

Upvotes: 0

Muhammad Sulaiman
Muhammad Sulaiman

Reputation: 2605

I've just uninstalled Twincat 3 (XAE), following the official guide.

  1. Open Control Panel\Programs\Programs and Features,

  2. Sort the list by name (all Beckhoff-related apps will be grouped together),

  3. Start uninstalling them one by one (Hint: look at the app size, uninstall the app with smaller size first),

    3.1. Some components need restarting the computer, click No (reboot later),

  4. After uninstalling every Beckhoff-related app, restart the computer.

Done.

I've checked Program Files (x86) and AppData, everything is clean.

Upvotes: 0

Koosvw
Koosvw

Reputation: 11

I have run into similar issues, mainly when wanting to install a newer version of TwinCAT. Often the update doesn't work correctly.

I've resolved to using BoxStarter to at least automate the removal of TwinCAT. It may not be as thorough as using CCleanerPro, RevoUninstaller or BcUninstaller, but I find it usually does enough to get a cleaner install.

I've created a gist of the script which you can find here: https://gist.github.com/koosvanw/5b6933945399ec727b61531de7a6a794

You can either download the script and run it with a local BoxStarter installation, or click the provided link to launch the webapplication which then starts running the uninstall script.

Let me know if you run into any issues with the script.

Upvotes: 1

Related Questions