Resolving the WinCC Flexible 2007 "Unable to Find a Version of the Runtime" Error
The "Unable to find a version of the runtime to run this application" dialog is a classic WinCC flexible 2007 startup failure. It appears after a workstation has been shut down cleanly, brought back up, and the user attempts to launch the engineering environment. The condition is transient the first time, then becomes permanent after a few working cycles, and survives a full uninstall/reinstall cycle. This article documents the root cause, the full remediation sequence, the supporting command-line switches, and the preventive maintenance steps that keep the development environment stable on Windows XP Professional SP2.
1. Problem Description and Symptom Table
The error presents as a modal dialog with a single OK button launched at WinCC flexible start-up, before the project tree is loaded. The user cannot dismiss the dialog into a working state. The exact text on XP SP2 builds is:
Unable to find a version of the runtime to run this application.
On Windows 7 / Server 2008 R2 hosts the same error string is also raised, but the typical cause is different (missing Visual C++ 2005 SP1 redistributable, or a corrupted msvcr80.dll side-by-side assembly). The XP-specific symptom set covered here is summarized below.
| Symptom | When observed | Reliability |
|---|---|---|
| Dialog "Unable to find a version of the runtime to run this application." | Every WinCC flexible 2007 start, ~3-5 s after double-click | 100% |
Task Manager shows no Hmies.exe and no HmiSmartStart.exe after a failed start |
Immediately after dismissing dialog | 100% |
| Re-installation of WinCC flexible 2007 restores operation, but the fault returns within 1-7 days | After Add/Remove Programs + reinstall | High |
| Event Viewer Application log entry: .NET Runtime Optimization Service (clr_optimization_v2.0.50727_32) re-compiling mscorlib on first reboot | First 5-10 min after boot | High |
| Project loads if launched in safe mode for Add-ins (WinCC flexible /SafeMode) | Manual start with command-line flag | Medium |
2. Root Cause Analysis
The dialog is raised by the WinCC flexible launcher HmiSmartStart.exe when it cannot match the requested runtime against the available runtime database. Three layered causes appear on Windows XP SP2 installations:
2.1 Corrupted Runtime Database Templates
WinCC flexible 2007 stores the registered runtime targets, panel families, and version metadata in two binary templates inside the install directory:
%ProgramFiles%\Siemens\SIMATIC WinCC flexible\WinCC flexible 2007\HmiEs\Templates\RT_DB.tpl%ProgramFiles%\Siemens\SIMATIC WinCC flexible\WinCC flexible 2007\HmiEs\Templates\RT_DB.idx
These files are rewritten on every clean exit of the engineering system. If the workstation is shut down, hibernated, or loses power while Hmies.exe has the templates open, the index file is left with a stale header pointer. On the next launch the launcher reads the broken index, fails to find any matching runtime, and displays the symptom dialog. A reinstall of WinCC flexible does not repair the templates if the installer uses Repair instead of a clean uninstall, because the corrupted template files are not on the installer's "overwrite always" list.
2.2 Stale Cache Files in the User Profile
Two cache locations are written under the user profile and are not cleared by an MSI reinstall:
%USERPROFILE%\Application Data\Siemens\Automation\WinCC flexible\Cache\%USERPROFILE%\Local Settings\Application Data\Siemens\HmiEs\
When a panel-image cache or a project thumbnail becomes inconsistent with the templates, the launcher refuses to bind a runtime. The condition is propagated to any user that logs in to the same profile.
2.3 Hanging Background Processes
Two WinCC flexible background processes must be terminated before the templates can be re-created, otherwise they hold a write lock on the RT_DB.* files and the reset command exits with no effect:
-
Hmies.exe – the HMI Engineering System service process. Holds a mutex
Global\HmiES_SingleInstance. -
HmiSmartStart.exe – the launcher/guard process. Restarts
Hmies.exeon crash.
If the previous session terminated abnormally, these processes can remain as zombies with a working set of 0 KB but with their handles still open, which is why Task Manager does not always list them. The handle.exe utility from Sysinternals can confirm the handle owners:
handle.exe -a "RT_DB" > C:\TEMP\rt_db_handles.txt
3. Pre-Remediation Checklist
Complete every item below before running the reset command. Skipping any one of them re-creates the same failure within days.
- Log in with a Windows administrator account. WinCC flexible 2007 will not let the launcher write to
RT_DB.tplunder a standard user account because the install directory isProgram Fileswith UAC-style deny ACEs on XP SP2's NTFS volumes. - Disable antivirus on-access scanning for the install path. Some versions of McAfee VirusScan Enterprise 8.5 and Trend Micro OfficeScan 8.0 inject user-mode hooks that hold the template files open for up to 30 s after WinCC flexible closes.
- Verify the Microsoft .NET Framework 2.0 SP2 or 3.0 SP2 is installed. The runtime resolution logic in
HmiSmartStart.execallsSystem.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeInterfaceAsObject, which fails with the symptom dialog if .NET 2.0 has been removed by a .NET cleanup tool. - Confirm at least 800 MB free on the system drive. The reset sequence writes a full new template set and a temporary log in the user profile.
- Stop any open WinCC flexible project. Closing the project lets the launcher release the write lock on
RT_DB.tplcleanly.
4. Step-by-Step Remediation
Step 4.1 – Kill the Background Processes
Open Task Manager (Ctrl+Shift+Esc) and click Show processes from all users. If the columns are not visible, choose View > Select Columns and enable Image Path Name. End the following processes in this order:
HmiSmartStart.exeHmies.exe
Do not close Task Manager itself; you will need it in Step 4.3 to confirm that the reset command spawns a new Hmies.exe instance.
tasklist /FI "IMAGENAME eq Hmies.exe" from a command prompt. If the command returns INFO: No tasks are running which match the specified criteria., the write lock is clear. If a PID is returned, use taskkill /F /PID <pid> from an elevated command prompt.
Step 4.2 – Run the Template Reset Command
The reset is performed by passing four command-line arguments to Hmies.exe. Press Start > Run (or press Win+R) and execute:
"C:\Program Files\Siemens\SIMATIC WinCC flexible\WinCC flexible 2007\Hmies.exe" -reset -new -silentmode true -autoclose true
The flag semantics are listed below. They are documented in the WinCC flexible 2007 readme, in section "Command-Line Parameters of the Engineering System".
| Flag | Effect | Side effect |
|---|---|---|
-reset |
Deletes the existing RT_DB.tpl and RT_DB.idx and rebuilds them from the install media signatures stored under HmiEs\Templates\OEM\
|
Any custom panel descriptions that were added by the user are lost |
-new |
Re-creates the user cache directory under %USERPROFILE%\Application Data\Siemens\Automation\WinCC flexible\
|
Re-creates the local project thumbnail cache |
-silentmode true |
Suppresses all modal dialogs from the launcher (used for scripting and admin push) | Errors that would normally request user input are written to the log file only |
-autoclose true |
Closes the engineering system after the rebuild completes successfully | None |
If the install path differs from the default, substitute the actual path. Common alternatives are:
-
C:\Programs\Siemens\SIMATIC WinCC flexible\WinCC flexible 2007\Hmies.exe(German Windows) -
D:\Siemens\WinCCflex2007\Hmies.exe(custom corporate image)
Confirm the path first with:
dir /S /B "%ProgramFiles%\Siemens\SIMATIC WinCC flexible\Hmies.exe"
Step 4.3 – Verify the Reset Spawned a New Hmies.exe
Switch back to Task Manager. Within five seconds of pressing OK on the Run dialog, a new Hmies.exe process should appear under the same administrator account. Its working set will rise to ~120 MB while it rebuilds the templates, then drop to ~35 MB once the rebuild completes. After 2-3 minutes the process exits automatically because of the -autoclose true flag. If the process never appears, jump to Section 6.
Step 4.4 – Start WinCC Flexible Normally
Launch WinCC flexible 2007 from the desktop icon or from Start > SIMATIC > WinCC flexible 2007. The engineering system should now open the project tree, the panel catalog, and the runtime target list without showing the dialog.
5. Verification Tests
Run the following four checks. Each one exercises a different code path in the launcher.
- Runtime target list test. Open Project > Runtime Properties > Target. The dropdown should list the full panel set (TP170A, OP77A, MP277, ... up to PC Runtime). A pre-reset failure shows an empty list.
-
Compiler round-trip test. Open a small project (the bundled Getting Started project in
C:\Program Files\Siemens\SIMATIC WinCC flexible\WinCC flexible 2007\Examples\), choose Project > Compiler > Compile (Full), and confirm zero errors. The compiler needs the runtime database to resolve tag types against the panel firmware; if the database is broken, the compiler aborts with Error 130003: The selected target device is not available. - Start Simulation test. From the menu choose Project > Start Runtime / Simulation. The simulator window should appear within 5 s. A broken template set produces a second "Unable to find a version of the runtime to run this application" dialog at this step.
- Reset stability test. Shut down the workstation, power off, wait 30 s, power on, and log in. Start WinCC flexible 2007 again. The dialog must not reappear. If it does, the antivirus on-access scan is still holding the templates (Section 6.3).
6. What to Do If the Reset Command Does Not Help
6.1 Corrupt MSI Installer Cache
The MSI cache for WinCC flexible 2007 is stored at C:\WINDOWS\Installer. Each install leaves a .msi and a *.msp patch. If the cache is missing or corrupted, both the Repair and the Uninstall options fail. Confirm the cache is healthy:
msiexec /fv "C:\WINDOWS\Installer\<wincc_flex_2007_GUID>.msi" /l*v C:\TEMP\wincc_repair.log
The product GUID for WinCC flexible 2007 ES on German and English media is listed in the registry under HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall. Look for SIMATIC WinCC flexible 2007. If the InstallSource value is empty, restore it from the original DVD before continuing.
6.2 Missing or Damaged Visual C++ 2005 SP1 Redistributable
WinCC flexible 2007 links statically against msvcr80.dll, msvcp80.dll, and msvcm80.dll. On a clean Windows XP SP2 these are installed by the WinCC flexible 2007 bootstrapper. If they are missing, the launcher reports the same dialog even when the templates are healthy. Verify with:
dir "%WINDIR%\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.4053_x-ww_e69d8b0c\msvcr80.dll"
If the path is missing, install the Microsoft Visual C++ 2005 SP1 Redistributable (x86) and reboot.
6.3 Antivirus Holding the Templates Open
Trend Micro OfficeScan 8.0, McAfee VirusScan Enterprise 8.5i, and Kaspersky Endpoint Security 10 are known to hold a read lock on RT_DB.tpl for up to 30 s after WinCC flexible closes. The Repair step appears to succeed but the templates are never overwritten. Add the following exclusions:
C:\Program Files\Siemens\SIMATIC WinCC flexible\%USERPROFILE%\Application Data\Siemens\%USERPROFILE%\Local Settings\Application Data\Siemens\C:\WINDOWS\Temp\HmiEs*
6.4 Hard Disk Errors on the System Partition
Bad clusters on the Program Files partition can corrupt the rebuilt RT_DB.tpl silently. Run the manufacturer diagnostic:
chkdsk C: /R /F
Schedule the volume check for the next reboot, then rerun the reset command from Section 4.2.
7. Preventive Maintenance Procedure
Once the immediate fault is cleared, schedule the following maintenance tasks to keep the engineering environment stable on Windows XP SP2 hosts. The procedure is suitable for inclusion in a corporate image build or a monthly maintenance window.
- Create a scheduled task that runs the reset command nightly while no user is logged on:
schtasks /Create /SC DAILY /TN "WinCCflex_Reset" /TR ""C:\Program Files\Siemens\SIMATIC WinCC flexible\WinCC flexible 2007\Hmies.exe" -reset -new -silentmode true -autoclose true" /ST 02:00 /RU SYSTEM /RL HIGHEST
- Add an On Application Exit log capture in the registry. Under
HKLM\SOFTWARE\Siemens\Automation\WinCC flexible\2007\Diagnosticscreate a DWORD valueLogFileLevel= 3 to enable verbose logging. Logs are written to%USERPROFILE%\Application Data\Siemens\Automation\WinCC flexible\Log\HmiEs.log. - Mirror the WinCC flexible install on a second partition with
robocopy /MIR. The mirror provides a clean source for the-resetrebuild even if the primary install directory is damaged. - Disable Windows XP Hibernation on engineering workstations. Hibernate writes the template files back to disk in an inconsistent state on power restore. Run
powercfg -H OFFfrom an elevated command prompt.
8. Alternate Path: Full Clean Reinstall
If the reset procedure has been executed three or more times without durable success, perform a clean reinstall. The clean reinstall is more invasive but clears every cache and registry value that contributes to the symptom.
- Uninstall via Add or Remove Programs. If the uninstall fails, use the Microsoft Program Install and Uninstall Troubleshooter to force-remove the product.
- Delete the install directory and all subdirectories:
rmdir /S /Q "C:\Program Files\Siemens\SIMATIC WinCC flexible" - Delete the user profile caches:
rmdir /S /Q "%USERPROFILE%\Application Data\Siemens"andrmdir /S /Q "%USERPROFILE%\Local Settings\Application Data\Siemens" - Clean the registry:
reg delete "HKLM\SOFTWARE\Siemens\Automation\WinCC flexible" /f - Reboot.
- Reinstall WinCC flexible 2007 from the original DVD or a verified ISO image.
- Apply WinCC flexible 2007 SP3 (the last released service pack) before connecting to a panel.
9. Compatibility Notes and Platform Migration
Windows XP SP2 reached Microsoft end of support in 2014. The WinCC flexible 2007 runtime database issue is amplified on XP because XP does not have the transactional file system safeguards that arrived with Windows 7. The following table lists the migration targets that Siemens has officially endorsed for the same engineering project file (.flex).
| Source | Target | Notes |
|---|---|---|
| WinCC flexible 2007 SP3 on Windows XP SP2/SP3 | WinCC flexible 2008 SP5 on Windows 7 SP1 / Server 2008 R2 | Project migration in the Project > Migrate wizard; OPC-XML DA changes |
| WinCC flexible 2007 SP3 on Windows XP SP2/SP3 | TIA Portal V13 / V14 / V15.1 on Windows 7 SP1 / Windows 10 LTSB | Use the Migration Tool from the TIA Portal DVD; tag prefixes are preserved |
| WinCC flexible 2008 SP5 on Windows 7 SP1 | TIA Portal V16 on Windows 10 LTSC | Officially supported by Siemens 6ES7822-0AA04-0YA7 entry ID 109746538 |
On Windows 7 SP1 and later, the same "Unable to find a version of the runtime" dialog is not caused by the template corruption described in this article. The Windows 7 root cause is typically a missing side-by-side assembly, fixed by re-installing the Visual C++ 2005 SP1 redistributable. See the Siemens Industry Online Support entry ID 26169062 for the Windows 7-specific procedure.
10. Diagnostic Log Locations
When escalating the fault to Siemens Technical Support, attach the following log files. They are required to identify the exact failure layer in the launcher.
| File | Default path | Size on failure |
|---|---|---|
| Engineering system log | %USERPROFILE%\Application Data\Siemens\Automation\WinCC flexible\Log\HmiEs.log |
2-50 MB |
| Launcher trace | %USERPROFILE%\Application Data\Siemens\Automation\WinCC flexible\Log\HmiSmartStart.log |
200 KB-2 MB |
| Installer trace (after reinstall) | C:\WINDOWS\Temp\SiemensInstall.log |
5-30 MB |
| Windows Application event log | Event Viewer > Windows Logs > Application | n/a (export as .evtx) |
| Process Monitor boot trace | Captured with Sysinternals Process Monitor, filtered to Hmies.exe and HmiSmartStart.exe
|
20-200 MB compressed |
11. Related WinCC flexible 2007 Error Strings
The following dialogs share a code path with the "Unable to find a version of the runtime" error. Recognizing them in the field log helps narrow the root cause.
| Error text | Common cause | Quick fix |
|---|---|---|
| "Unable to find a version of the runtime to run this application." | Corrupt RT_DB.tpl
|
Reset command (Section 4.2) |
| "The application failed to initialize properly (0xc0000135)." | Missing VC++ 2005 SP1 | Reinstall redistributable (Section 6.2) |
| "The WinCC flexible Runtime could not be started. Error 0x80004005." | Permission on Program Files, MSI cache | Run as administrator, repair MSI |
| "The integration with STEP 7 is not available. Do you want to load the project without the integration?" | STEP 7 not installed or wrong version | Install matching STEP 7 version (5.4 SP4 or 5.5) |
| "The license for WinCC flexible 2007 is invalid or has expired." | License key removed | Re-transfer the license via Automation License Manager V5.2 |
12. Quick Reference: Reset Command in One Line
For engineers who already know the path and the flag set, the entire fix can be pasted into an elevated command prompt in a single copy/paste. The line is safe to script and to run from PsExec across multiple engineering workstations in a build farm.
taskkill /F /IM HmiSmartStart.exe 2>NUL & taskkill /F /IM Hmies.exe 2>NUL & timeout /T 3 /NOBREAK >NUL & "C:\Program Files\Siemens\SIMATIC WinCC flexible\WinCC flexible 2007\Hmies.exe" -reset -new -silentmode true -autoclose true
The exit code of the final command is 0 on success and 1 on failure. A failure code should be captured to C:\TEMP\winccflex_reset_%date:~-4%%date:~3,2%%date:~0,2%.log for audit purposes.
%USERPROFILE%\Application Data\Siemens\, back them up to a safe location before running the script.
What does the WinCC flexible 2007 error "Unable to find a version of the runtime to run this application" mean?
It means the launcher HmiSmartStart.exe could not match the requested WinCC flexible version to a registered runtime in the RT_DB.tpl template. The template is typically corrupted by an unclean shutdown of Hmies.exe, and the reinstall of WinCC flexible does not repair it.
Do I have to reinstall WinCC flexible 2007 every time the error appears?
No. Run the command "C:\Program Files\Siemens\SIMATIC WinCC flexible\WinCC flexible 2007\Hmies.exe" -reset -new -silentmode true -autoclose true from Start > Run after killing Hmies.exe and HmiSmartStart.exe in Task Manager. The reset rebuilds the template and the user cache in 2-3 minutes and is non-destructive to the install directory.
Why does the error come back a few days after a fresh install?
It comes back when one of three conditions is met: (1) antivirus on-access scan holds a lock on RT_DB.tpl for > 5 s after WinCC flexible closes; (2) the workstation hibernates while the engineering system is open; (3) the .NET 2.0 SP2 runtime is removed by a cleanup tool. Add the antivirus exclusions from Section 6.3 and disable hibernation with powercfg -H OFF.
Can I run the reset command from a script or a scheduled task?
Yes. The four-flag form -reset -new -silentmode true -autoclose true is documented for headless use. Wrap it in a scheduled task that runs as SYSTEM with HIGHEST privileges, and pipe the exit code to a log file. The command is safe to run on any Windows XP SP2 / SP3, Windows 7 SP1, or Windows Server 2003 R2 workstation with WinCC flexible 2007 SP3 installed.
What Windows version should I move WinCC flexible 2007 projects to?
Microsoft ended Windows XP support in 2014, and Siemens ended mainstream support for WinCC flexible 2007 SP3 in 2018. The recommended path is TIA Portal V16 on Windows 10 LTSC. Use the Project > Migrate wizard in WinCC flexible 2008 SP5 first if you need an intermediate step, then re-export from TIA Portal V16 for the final platform.