?
Solved

VMWare Tools removal problem

Posted on 2012-09-20
25
Medium Priority
?
1,502 Views
Last Modified: 2012-10-03
I have around 200 windows 7 computers which had their source image prepared on a VM on ESXi 4. Now, the problem is that vmware tools was not removed before sysprep and image capture - end result is 200 machines with vmware tools that should have it on.

This has materialised to cause issues with the print spooler service (somehow)

So, how can i remove vmware tools from these physical machines remotely?

I have tried add/remove programs, but there is an error about not being able to determine what type of VM so it won't run.

msiexec /x also won't work

Any ideas?

Much appreciated.

Thanks.
0
Comment
Question by:gmbaxter
  • 13
  • 11
25 Comments
 
LVL 10

Expert Comment

by:CSI-Windows_com
ID: 38417588
With a verbose MSI log it may be possible to determine a method to trick the MSI to uninstall.

For the failing uninstall, please create a verbose MSI log and zip and upload it to the thread and I can analyze it for you.

Please follow these instructions for creating the log - the included REG file on the article ensures that logging data is maximized:

http://www.experts-exchange.com/Programming/Installation/A_5177-Installation-Logging-How-To-Create-a-Verbose-Windows-Installer-Log-and-Submit-it-With-Your-Question-Including-MSIs-That-are-INSIDE-Setup-exes.html
0
 
LVL 7

Expert Comment

by:Beneford
ID: 38417591
I had the same problem moving from VMware to KVM as a Virtual Machine Host.

I found no easy solution, so had to trawl the registry for any references to the VMWare, and then deleted them.

Doing that for 200+ machines at once is a bit harder.
My approach would be to look carefully at one machine and construct a RegEdit file with the necessary deletions. Then test carefully before deploying.

Note:
a .reg file should contain
[-HKEY_CURRENT_USER\somepath]
to remove a key and
[HKEY_CURRENT_USER\somepath]
"ValueToDelete"=-
to remove a value
0
 
LVL 11

Author Comment

by:gmbaxter
ID: 38417679
Thanks for the quick replies,

@CSI-Windows
File is attached - I have had a scan through it but unsure what to look out for really.

@Beneford
Hopefully that is the last resort. Annoyingly, vmware's uninstaller and cleanup scripts simply do not work!

Thanks.
vmtools.log
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 10

Expert Comment

by:CSI-Windows_com
ID: 38417761
The log is exactly what I needed!

MSIZap.exe could be used to remove all Windows Installer references and decrement components counts - however, it would leave all the service registry keys, files, etc on the system and they would have to be removed manually.

Here is a link that includes the msizap download: http://www.extorr.com/readme_cdrom3.htm#Uninstalling

However, another approach would be to:

1) Get a copy of the cached MSI
2) add a condition to exclude the failing custom action
3) Use a script to replace the cached copy on each machine and call the uninstall.

It so happens I've been working on some VBS to do MSI cache management.

If you run the attached VBS on a workstation that has the tools - it should find and copy  the relevant cached MSI to the same location as the script.  Please zip the msi and attach it to the thread.
0
 
LVL 11

Author Comment

by:gmbaxter
ID: 38417804
There doesn't appear to be an attachment in your reply. Is it the msi contained within the C:\windows\installer directory that is referenced in the log?
0
 
LVL 11

Author Comment

by:gmbaxter
ID: 38417978
I have attached it to this reply (but had to change the file extension to pdf) as msi files are not allowed even inside a zip file, so just change the extension when you download it.

Many thanks
3cd2e63.pdf
0
 
LVL 10

Expert Comment

by:CSI-Windows_com
ID: 38418269
VMware's MSI is a quagmire of custom actions - so although I have neutralized this one, it is quite likely another will fail.

Please test this one on the machine that you pulled it from.

Please DO NOT use it on any other machine - the name of the cached MSI will be randomized on every machine it was installed on.  I have a script that finds the randomized name in the MSI repository and copy this file over the existing one - but there's no sense in bothering if a bunch of these other VMWare custom actions are going to fail (it would need some changes made).
3cd2e63-fixed.PDF
0
 
LVL 11

Author Comment

by:gmbaxter
ID: 38418287
Hi, thanks for your reply, however there is no file attached?

Thanks.
0
 
LVL 10

Expert Comment

by:CSI-Windows_com
ID: 38418502
I realized that and re-editted the post to add the file - probably missed you by a couple seconds - so upon reading this you should now see the file attached to the original post.
0
 
LVL 11

Author Comment

by:gmbaxter
ID: 38418508
I see it now thanks - will have a go.
0
 
LVL 11

Author Comment

by:gmbaxter
ID: 38421270
Hello, that works a treat!

msiexec /x file.msi /qn /forcerestart

Now, how do we determine which cached msi files to delete with your script please?

Many thanks.
0
 
LVL 10

Expert Comment

by:CSI-Windows_com
ID: 38421629
Did you: (a) copy the fixed .MSI into the cache before running the above command line on the test machine - or (b) did it work properly with the unchanged cache file in place?

If the answer is (b), you could save a lot of hassle and risk.

D.
0
 
LVL 11

Author Comment

by:gmbaxter
ID: 38421984
Option A - renamed the old one to .old than ran the fixed one.
0
 
LVL 10

Accepted Solution

by:
CSI-Windows_com earned 2000 total points
ID: 38422278
I am attaching a script that will copy the .MSI into the cache on a given machine.  Please follow these instructions closely:

*) You may modify this script to add the uninstall commands to the bottom of it.
*) Place this script and the .MSI in the same folder.
*) The msi must be named: {FE2F6A2C-196E-4210-9C04-2B1BC21F07EF}.msi (named by the GUID to make it unique.
*) I have had to modify the script to overwrite an existing cached copy, but don't have time to test.
*) Run the VBS on affected workstations.

*) Your uninstall command DOES NOT NEED to reference ANY files - including the fixed one.  Once the cached MSI file has been put in place, use:

msiexec /x {FE2F6A2C-196E-4210-9C04-2B1BC21F07EF}

(no .MSI on the end).

This causes MSI to find the cached copy and us it for uninstall.
FixCachedCopy2.vbs
0
 
LVL 11

Author Comment

by:gmbaxter
ID: 38430574
Thanks for the script. Didn't get chance to try it today but did look over the script. Where abouts do I put the uninstall command?

Thanks
0
 
LVL 10

Expert Comment

by:CSI-Windows_com
ID: 38430641
The script simply copies the fixed MSI over the cached MSI - so add the uninstall command to the very end.
0
 
LVL 11

Author Comment

by:gmbaxter
ID: 38433032
Hi,

I'm getting a script compilation error: (screenshot attached)

It seems to be on this line: sourceMSI.Copy (CachedFileName,True)

Removing the Parenthesis results in a syntax error.

Thanks.
0
 
LVL 10

Expert Comment

by:CSI-Windows_com
ID: 38433214
Although the documentation says that the .Copy method allows an overwrite parameter (http://msdn.microsoft.com/en-us/library/6973t06a(v=vs.84).aspx), I haven't tried it before - but was trying to keep the script simple and consistent.

Let's change to a method that I've used before, please replace the erroring line with:

oFSO.CopyFile FixUpCachedFile,CachedFileName,True

Open in new window

0
 
LVL 11

Author Comment

by:gmbaxter
ID: 38444773
Thanks for that. That got past the original error, now have an error on Line 12, Char 1: 80004005
MSi API Error
0
 
LVL 10

Expert Comment

by:CSI-Windows_com
ID: 38445714
It is working on my end (including when the product does not exist on my system).

Could you please double check the syntax of the line against the originally sent script in case you made adjustments trying to resolve the previous error?

Make sure you're running in an elevated command prompt as well - I do get that error when double clicking and this copy does not have the admin check in it.
0
 
LVL 11

Author Comment

by:gmbaxter
ID: 38453966
Thanks for the reminder - it works from an elevated prompt.

Do I need to modify the script at all to run it as a machine startup script?

Thanks.
0
 
LVL 10

Expert Comment

by:CSI-Windows_com
ID: 38454124
I think the only mods for machine startup would be that you make sure all your file references are fully pathed UNC references.  Machine startup scripts have no mapped drive letters.  Without mapped drive letters (UNC execution) you have NO working folder / current folder that enable the use file references without a full path.

This code should dynamically retrieve the UNC that your script is running from - you can then tack it on to the front of any variables referencing the file to copy:

set oFSO = CreateObject("scripting.filesystemobject")
currentfolder = oFSO.GetParentFolderName(wscript.scriptfullname)
wsh.echo currentfolder

Open in new window

0
 
LVL 11

Author Closing Comment

by:gmbaxter
ID: 38457788
Excellent assistance provided.
0
 
LVL 11

Author Comment

by:gmbaxter
ID: 38457794
Thanks for all of your help with this - msi and script did the trick.

I am interested to know what you did to the MIS - I read the log I produced for you, but could not determine the exact place where the VM or not check was occuring. I presume you used an MSI editor to edit the mis to remove the check?

I opened up the mis in Instead, but again was unsure where to look.

A brief explanation would be great if possible.

Many thanks again.
0
 
LVL 10

Expert Comment

by:CSI-Windows_com
ID: 38458622
Glad it worked for you!

The verbose log you send indicated that the custom action VM_CheckRequirements was failing which causes the entire package to fail.

In the InstallExecuteSequence I placed a condition on this custom action that would never be true.  I put "NeverExecute" in the "Condition" column of the InstallExecuteSequence table for the row starting with VM_CheckRequirements.  I used the free InstEd, but for this simple edit the free Microsoft Orca tool would have worked just as well.

In MSI Conditions have an implied if before them.  So "NeverExecute" would be interpretted as "If the property NeverExecute contains ANY value, THEN run this action."

The other critical bit of knowledge for this to work is that an MSI uinstall - no matter how it is initiated - ALWAYS uses the cached copy of the package.  So if we fixed the original package and ran MSIEXEC /I originalpackage.msi - it just grabs the MSI product code from the MSI on the command line and uses it to locate the cached package.

The cache extraction and cache injection scripts are part of a MSI cache management script I am working on - otherwise manually injecting the fixed MSI into the cache would have been a lot more challenging.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

August and September have been big months for VMware—from VMworld last month to our new Course of the Month in VMware Professional - Data Center Virtualization. We reached out to Andrew Hancock, resident VMware vExpert, to have a more in-depth discu…
It’s time for spooky stories and consuming way too much sugar, including the many treats we’ve whipped for you in the world of tech. Check it out!
How to install and configure Citrix XenApp 6.5 - Part 1. In this video tutorial we have explained step by step installation of Citrix XenApp 6.5 Server on Windows Server 2008 R2 is explained in this video. We have explained the difference between…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question