mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
v2v: windows: uninstall VMware Tools
It looks like VMware Tools support their unattended uninstallation even after the guest is not running anymore on VMware.
This commit is contained in:
@@ -192,6 +192,13 @@ let convert (g : G.guestfs) inspect source output rcaps =
|
||||
Some "PREVENT_REBOOT=Yes LAUNCHED_BY_SETUP_EXE=Yes" in
|
||||
unistallation_commands "Parallels Tools" matchfn extra_uninstall_string in
|
||||
|
||||
(* Locate and retrieve all uninstallation commands for VMware Tools. *)
|
||||
let vmwaretools_uninst =
|
||||
let matchfn s =
|
||||
String.find s "VMware Tools" != -1
|
||||
in
|
||||
unistallation_commands "VMware Tools" matchfn None in
|
||||
|
||||
(*----------------------------------------------------------------------*)
|
||||
(* Perform the conversion of the Windows guest. *)
|
||||
|
||||
@@ -277,7 +284,8 @@ let convert (g : G.guestfs) inspect source output rcaps =
|
||||
configure_vmdp tool_path;
|
||||
|
||||
unconfigure_xenpv ();
|
||||
unconfigure_prltools ()
|
||||
unconfigure_prltools ();
|
||||
unconfigure_vmwaretools ()
|
||||
|
||||
(* [set_reg_val_dword_1 path name] creates a registry key
|
||||
* called [name = dword:1] in the registry [path].
|
||||
@@ -430,6 +438,23 @@ if errorlevel 3010 exit /b 0
|
||||
"uninstall Parallels tools" fb_script
|
||||
) prltools_uninsts
|
||||
|
||||
and unconfigure_vmwaretools () =
|
||||
List.iter (
|
||||
fun uninst ->
|
||||
let fb_script = "\
|
||||
@echo off
|
||||
|
||||
echo uninstalling VMware Tools
|
||||
" ^ uninst ^
|
||||
(* ERROR_SUCCESS_REBOOT_REQUIRED == 3010 is OK too *)
|
||||
"
|
||||
if errorlevel 3010 exit /b 0
|
||||
" in
|
||||
|
||||
Firstboot.add_firstboot_script g inspect.i_root
|
||||
"uninstall VMware Tools" fb_script
|
||||
) vmwaretools_uninst
|
||||
|
||||
and update_system_hive reg =
|
||||
(* Update the SYSTEM hive. When this function is called the hive has
|
||||
* already been opened as a hivex handle inside guestfs.
|
||||
|
||||
Reference in New Issue
Block a user