While at it, embed the comment about ERROR_SUCCESS_REBOOT_REQUIRED being
fine into the batch file.
Bugzilla:
https://bugzilla.redhat.com/show_bug.cgi?id=1788823
Signed-off-by: Laszlo Ersek <lersek(a)redhat.com>
---
convert/convert_windows.ml | 23 ++++++++++----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/convert/convert_windows.ml b/convert/convert_windows.ml
index 60742454c3c4..0611bf06cb80 100644
--- a/convert/convert_windows.ml
+++ b/convert/convert_windows.ml
@@ -490,19 +490,20 @@ let convert (g : G.guestfs) _ inspect _ static_ips =
"uninstall Xen PV" fb_script
and unconfigure_prltools () =
+ let regkey =
+ "HKLM\\System\\CurrentControlSet\\Services\\prl_strg\\DriverInfo" in
List.iter (
fun uninst ->
- let fb_script = "\
-@echo off
-
-REG DELETE HKLM\\System\\CurrentControlSet\\Services\\prl_strg\\DriverInfo /v RefCount
/f
-
-echo uninstalling Parallels guest tools
-" ^ uninst ^
-(* ERROR_SUCCESS_REBOOT_REQUIRED == 3010 is OK too *)
-"
-if errorlevel 3010 exit /b 0
-" in
+ let fb_script = sprintf
+ "@echo off\n\
+ \n\
+ REG DELETE %s /v RefCount /f\n\
+ \n\
+ echo uninstalling Parallels guest tools\n\
+ rem ERROR_SUCCESS_REBOOT_REQUIRED (3010) is OK too\n\
+ %s\n\
+ if errorlevel 3010 exit /b 0\n"
+ regkey uninst in
Firstboot.add_firstboot_script g inspect.i_root
"uninstall Parallels tools" fb_script
--
2.19.1.3.g30247aa5d201