There are certain companies that never get tired with their primitive practices: ask for a reboot, alter the user configuration and fill your computer of unnecessary services in the background. Yes, I am talking about you, VMWare. In this article we will see how to correct the waste of resources produced by background services from applications like VMWare Workstation or Player, although it is applicable in any other wasteful app
Long ago, I solved another problem that also originated with the guys from VMWare. The former problem was about tireless consulting registers (a problem that clearly still leaving assets in their new products).
Many software manufacturers have realized the importance of to lighten their solutions. Even Microsoft shows this trend with Windows 7, doing such simple things as for example if we don't have bluetooth, related service is simply not charged for, if we do not connect a Windows Phone phone never appears preloaded the center of synchronization for mobile devices, among others.
"Phew, Windows, slower everyday. Why not can they do something that works well as a < xyz >?"
The question above is usually derived in a possible format of the complete system, something that from personal experience is totally unnecessary and a waste of time. Use your head, a bit of intuition and research is the only thing they need.
We put and remove so many applications that we would lose easily account, exacerbating the problem with the current model of installations of Windows, which is too permissive.
For now, in this article I want to focus only on the problem with certain programs that take the freedom to install services for their benefit, which threaten our resources free, times the machine and overall stability. It is run "services.msc" (or manage equipment / services) to find a list of third-party services, which are to be automatically implemented by the operating system. Although there are many companies which publish products that let services "useless", for me the most emblematic is VMWare, which seem to be extremely stubborn to receive opinions and make improvements.
A simple solution
When I searched for possible solutions, I found a very simple but effective called VMware Launcher. It's a code in VBS launches services in demand and also ending them.
This solution has some flaws.
The largest, the only one that made me look for another solution, is that you need that we alter the services permissions to be able to launch them. Apart from being a problem before each update of VMWare, is lost functionality, for example with USB devices, as services are operations that require administrator privileges.
A better solution, much more general
Then, what would happen if we have a new solution, configurable, allowing you to select what you want to do with each service quickly and also that no request alter things. It would be that we would have a better solution, probably the best given the scenario provided by certain manufacturers.
In addition to being more general, not only could apply to VMWare products, but any product that comes to mind us.
Visual Studio Express C# 2010 will be used for the development of the solution. It is important to have previous concepts on use of the "Settings" in C# because the options panel will work exclusively with this feature.
The main object used will be one called RelatedService. This object will be the representation of a real service from the team, which has only a particularity, a mode of additional custom home to the team:
There are three custom modes, StartStop (it begins and ends in demand service), StartOnly (only starts it and leaves it active), Unknown (there is an error in the service and mode cannot be determined).
Logons that are named with the prefix System (such as SystemAutomatic) represent a system startup mode. One of which can be configured in the options of the operating system.
The main flow of the solution once set up is as follows:
The steps of the workflow are detailed below:
Searching for the services (BackgrounderWorker)
Start of the application
See the next item of this article.
Wait for end of the application (operating system)
As it appears in the point 5 of this article, whatever the form in which the application is launched, it is used M:System.Diagnostics.process.WaitForExit(System.Int32) to wait for its completion. Unlike other methods, M:System.Diagnostics.process.WaitForExit(System.Int32) asks operating system that alert you when a process is terminated, consuming absolutely zero CPU time while you wait.
Final search services)BackgrounderWorker)
Inheritance between father and son, the privileges process
As we need elevated privileges to start services (although services using another user account) it is natural to imagine that the application you launch after starting their services will have the same high privileges.
Since I don't like me or I think it correct to run applications with greater privileges than it needs, it had to find a solution to "lower" privileges.
When execute any installer in Windows Vista or higher, except for those based on MSI Installer which asked for lifting of requirements in certain moment of the process, the operating system shows us a UAC window to open the installer.
This is an obvious need, but it is important to consider that after installing the program, some installers offer to immediately run the newly installed program. Now, the first implementation of this programme would be inheriting the elevated privileges available to the installer something little considered, but rather dangerous.
The solution had already been addressed at the following site:
To integrate it, simply is a bifurcation depending on whether you want to or not "lower" the privileges of the process child which will be released:
An end-user, without modifying the source code can be customized in a big way this solution. The main modifications are accessible from the icon of the program while it is running:
To achieve this, the attached configuration file in a text editor must be opened. Some of the possible configurations are displayed and listed below:
All the settings above, aesthetically allows you to change labels on the program texts.
The set keyword by launcher_related_keyword It allows an automatic search of related services. For example, if we put "vmware" will be listed all services that have name to display or internal matching with those characters.
If this setting is left blank, do not see the option to search services again.
The two configurations above allow you to customize the application file that should be selected by the user, which will launch the program. The configuration application_path_filename It allows to set a default executable name, for example "vmware.exe" (written in the text box of "Open file").
The other setting the filter. The nomenclature is typical for Windows. For example, to force the user to choose "vmware.exe" or "vmplayer.exe" is you would use:
The following settings further customize the graphical part of the interface options and the icon beside the clock:
Designed to please the user
ServiceLauncher, the solution proposed for this article, is designed for the user. The interface has subtle features such as the existence of the box's selection of "service boot mode" always-enabled system to allow rapid customization.
In addition, the start and end of services progress bar appears smoothly (when Aero is enabled) and only when the process takes more than expected, for example if services need less than a second to start, user will not display a progress bar.
There are other subtleties, the existence of an "assisted" setting mode, where only asks about the linked executable or the possibility, as you saw in the previous point, block features. It also performs a transfer of the received arguments (being completely transparent).
Source code and binaries
The source code and the binaries are available for download here:
The executable without customization can be altered as explained in the next item of the article. In this way we can have a unique solution for each problem with unscrupulous services.
To install, for example the version customized for VMWare Workstation (any version), just copy the executable and the attached file in the package to anywhere (in preference to the Workstation directory) and create a shortcut to it (ideally by replacing the original of VMWare Workstation menu start).
Run it with a double click and on the first run it will ask that we say you the product from VMWare that we want to use.
The source code is for Visual Studio C# Express 2010.
Found solution, eliminates the existence of resource consumption and starting time, is customizable and applicable in a high range of problems.
In the event that the application (say VMPlayer) is constantly used by the user, it makes no sense to use the solution provided by this article. Lost time)overhead) in initialize and terminate the services could present problems older who constantly have them loaded, using memory and CPU time. So, it would not be recommended to use this solution on software that is initiated and completed with the equipment (such as for example IIS, SQL Server, Apache).