Reschedule EvaluateWintun between InstallInitialize and InstallFinalize

WireGuard is always doing so-called "minor" upgrade. This makes it
enough to run EvaluateWintun only once - somewhere after CostFinalize.
The component state we bind our driver install/remove logic to will be a
singleton: either be installed,  left alone, or uninstalled. One single
action for install product session and RemoveExistingProducts session.

Other applications using Wintun might use the so-called "major" upgrade.
In this scenario the existing product is completely uninstalled first.
Including Wintun. The EvaluateWintun was called only once and it
determined that Wintun driver should be uninstalled. Since the MSI did
not execute EvaluateWintun again when installing the new product later,
the Wintun remained uninstalled.

In the case of major upgrades, the Wintun requires two separate action
logics: what to do with Wintun on uninstall of the old product, and what
to do with it when new product is installed.

Therefore, EvaluateWintun has been moved between InstallInitialize and
InstallFinalize to have MSI execute it in install and uninstall
sessions.

Reported-by: Dmitry Smirnov <dmitry.smirnov@netprotect.com>
Tested-by: Simon Rozman <simon@rozman.si>
Signed-off-by: Simon Rozman <simon@rozman.si>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Simon Rozman 2020-02-27 14:56:44 +01:00 committed by Jason A. Donenfeld
parent 27e4d334fc
commit 6d6e219080

View File

@ -34,7 +34,7 @@
<CustomAction Id="EvaluateWintun" SuppressModularization="yes" BinaryKey="installer.dll" DllEntry="MsiEvaluate" Execute="immediate" />
<CustomAction Id="ProcessWintun" SuppressModularization="yes" BinaryKey="installer.dll" DllEntry="MsiProcess" Execute="deferred" Impersonate="no" />
<InstallExecuteSequence>
<Custom Action="EvaluateWintun" After="CostFinalize" />
<Custom Action="EvaluateWintun" Before="ProcessWintun" />
<Custom Action="ProcessWintun" After="InstallFiles" />
</InstallExecuteSequence>