@@ -111,6 +111,11 @@ SPDX-License-Identifier: GPL-3.0-only
111111 <SetProperty Id =" DetachAll" Value =" " [#usbipd.exe]" detach --all" Sequence =" execute" Before =" DetachAll" Condition =" $(var.UpdateOrRepair)" />
112112 <CustomAction Id =" DetachAll" BinaryRef =" Wix4UtilCA_$(sys.BUILDARCHSHORT)" DllEntry =" WixQuietExec" Return =" ignore" Impersonate =" no" Execute =" deferred" />
113113
114+ <!-- Delay so detach can finish its side effects. -->
115+ <!-- NOTE: This will run the *old* (to be upgraded or repaired) version. -->
116+ <SetProperty Id =" DelayAfterDetach" Value =" " [#usbipd.exe]" installer delay" Sequence =" execute" Before =" DelayAfterDetach" Condition =" $(var.UpdateOrRepair)" />
117+ <CustomAction Id =" DelayAfterDetach" BinaryRef =" Wix4UtilCA_$(sys.BUILDARCHSHORT)" DllEntry =" WixQuietExec" Return =" ignore" Impersonate =" no" Execute =" deferred" />
118+
114119 <!-- Disable all force-bound devices, such that (after DetachAll) the VBoxUSB driver is not used at all (best effort). -->
115120 <!-- NOTE: This will run the *old* (to be upgraded or repaired) version (< 5.3.0 does not even have this). -->
116121 <SetProperty Id =" DisableForced" Value =" " [#usbipd.exe]" installer disable_forced" Sequence =" execute" Before =" DisableForced" Condition =" $(var.UpdateOrRepair)" />
@@ -120,6 +125,10 @@ SPDX-License-Identifier: GPL-3.0-only
120125 <SetProperty Id =" UnbindAll" Value =" " [#usbipd.exe]" unbind --all" Sequence =" execute" Before =" UnbindAll" Condition =" $(var.UninstallOnly)" />
121126 <CustomAction Id =" UnbindAll" BinaryRef =" Wix4UtilCA_$(sys.BUILDARCHSHORT)" DllEntry =" WixQuietExec" Return =" ignore" Impersonate =" no" Execute =" deferred" />
122127
128+ <!-- Delay so unbind can finish its side effects. -->
129+ <SetProperty Id =" DelayAfterUnbind" Value =" " [#usbipd.exe]" installer delay" Sequence =" execute" Before =" DelayAfterUnbind" Condition =" $(var.UninstallOnly)" />
130+ <CustomAction Id =" DelayAfterUnbind" BinaryRef =" Wix4UtilCA_$(sys.BUILDARCHSHORT)" DllEntry =" WixQuietExec" Return =" ignore" Impersonate =" no" Execute =" deferred" />
131+
123132 <!-- This will uninstall all stub devices, so they don't "use" the VBoxUSB driver (remember: they are already inactive at this point) (cleanup) (best effort). -->
124133 <SetProperty Id =" UninstallStubs1" Value =" " [#usbipd.exe]" installer uninstall_stubs" Sequence =" execute" Before =" UninstallStubs1" Condition =" $(var.UninstallOnly)" />
125134 <CustomAction Id =" UninstallStubs1" BinaryRef =" Wix4UtilCA_$(sys.BUILDARCHSHORT)" DllEntry =" WixQuietExec" Return =" ignore" Impersonate =" no" Execute =" deferred" />
@@ -166,8 +175,10 @@ SPDX-License-Identifier: GPL-3.0-only
166175
167176 <InstallExecuteSequence >
168177 <Custom Action =" DetachAll" Before =" StopServices" Condition =" $(var.UpdateOrRepair)" />
178+ <Custom Action =" DelayAfterDetach" Before =" StopServices" Condition =" $(var.UpdateOrRepair)" />
169179 <Custom Action =" DisableForced" Before =" StopServices" Condition =" $(var.UpdateOrRepair)" />
170180 <Custom Action =" UnbindAll" Before =" StopServices" Condition =" $(var.UninstallOnly)" />
181+ <Custom Action =" DelayAfterUnbind" Before =" StopServices" Condition =" $(var.UninstallOnly)" />
171182 <Custom Action =" UninstallStubs1" Before =" StopServices" Condition =" $(var.UninstallOnly)" />
172183 <Custom Action =" UninstallOldDrivers1" Before =" StopServices" Condition =" $(var.UninstallOnly)" />
173184 <Custom Action =" UninstallDriver" Before =" StopServices" Condition =" $(var.UninstallOnly)" />
0 commit comments