[Openvpn-devel,1/4] Make DriverCertification MSI property public

Message ID 20181219202611.2144-1-simon@rozman.si
State Accepted
Headers show
Series [Openvpn-devel,1/4] Make DriverCertification MSI property public | expand

Commit Message

Simon Rozman Dec. 19, 2018, 9:26 a.m. UTC
Making DriverCertification public (containing only upper-case letters)
allows the property set by FindSystemInfo custom action to be passed
from InstallUISequence sequence to InstallExecuteSequence. This
eliminates the need to execute FindSystemInfo in both sequences.
---
 src/openvpnmsica/openvpnmsica.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Selva Nair Dec. 19, 2018, 10:48 a.m. UTC | #1
Hi,

On Wed, Dec 19, 2018 at 3:27 PM Simon Rozman <simon@rozman.si> wrote:
>
> Making DriverCertification public (containing only upper-case letters)
> allows the property set by FindSystemInfo custom action to be passed
> from InstallUISequence sequence to InstallExecuteSequence. This
> eliminates the need to execute FindSystemInfo in both sequences.
> ---
>  src/openvpnmsica/openvpnmsica.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

It seems I'm behind times and cant figure out where these patches apply. Are
these for openvpn, openvpn-build or something else?

Thanks,

Selva
Simon Rozman Dec. 19, 2018, 10:57 a.m. UTC | #2
Hi,

> It seems I'm behind times and cant figure out where these patches apply.
> Are these for openvpn, openvpn-build or something else?

They are for openvpn repo. The MSI custom action DLL and the tapctl.exe 
utility were packed inside the openvpn repo to join the same workflow as 
openvpn.exe and other binaries (compile using openvpn-build, digitally sign, 
etc.).

Regards,
Simon
Gert Doering Dec. 19, 2018, 11 a.m. UTC | #3
Hi,

On Wed, Dec 19, 2018 at 04:48:49PM -0500, Selva Nair wrote:
> It seems I'm behind times and cant figure out where these patches apply. Are
> these for openvpn, openvpn-build or something else?

openvpn, but it needs all the other Simon patches applied first.  Which
there are lots of... I'll see that I can make some progress here over
the next days.

gert
Selva Nair Dec. 19, 2018, 11:19 a.m. UTC | #4
Hi,
On Wed, Dec 19, 2018 at 5:00 PM Gert Doering <gert@greenie.muc.de> wrote:
>
> Hi,
>
> On Wed, Dec 19, 2018 at 04:48:49PM -0500, Selva Nair wrote:
> > It seems I'm behind times and cant figure out where these patches apply. Are
> > these for openvpn, openvpn-build or something else?
>
> openvpn, but it needs all the other Simon patches applied first.  Which
> there are lots of... I'll see that I can make some progress here over
> the next days.

Oh, thanks. That explains it.

Selva
Gert Doering Jan. 18, 2019, 8:36 a.m. UTC | #5
Acked-by: Gert Doering <gert@greenie.muc.de>

To be honest, I have no idea what this does.  But I don't need to :-) - it's
infrastructure for stuff you need and nobody else depends on, and the code
change itself isn't introducing any new code constructs that might bring
dangers.  And it fixes a bug in the error reporting!

Compile tested on Ubuntu 16.04/mingw.

Your patch has been applied to the master branch.

commit fc2e28badf3736114bbc427f241961664235165c
Author: Simon Rozman
Date:   Wed Dec 19 21:26:08 2018 +0100

     Make DriverCertification MSI property public

     Acked-by: Gert Doering <gert@greenie.muc.de>
     Message-Id: <20181219202611.2144-1-simon@rozman.si>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg18037.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering

Patch

diff --git a/src/openvpnmsica/openvpnmsica.c b/src/openvpnmsica/openvpnmsica.c
index 86434801..721bd4f8 100644
--- a/src/openvpnmsica/openvpnmsica.c
+++ b/src/openvpnmsica/openvpnmsica.c
@@ -289,11 +289,11 @@  FindSystemInfo(_In_ MSIHANDLE hInstall)
         }
     }
 
-    uiResult = MsiSetProperty(hInstall, TEXT("DriverCertification"), ver_info.dwMajorVersion >= 10 ? ver_info.wProductType > VER_NT_WORKSTATION ? TEXT("whql") : TEXT("attsgn") : TEXT(""));
+    uiResult = MsiSetProperty(hInstall, TEXT("DRIVERCERTIFICATION"), ver_info.dwMajorVersion >= 10 ? ver_info.wProductType > VER_NT_WORKSTATION ? TEXT("whql") : TEXT("attsgn") : TEXT(""));
     if (uiResult != ERROR_SUCCESS)
     {
         SetLastError(uiResult); /* MSDN does not mention MsiSetProperty() to set GetLastError(). But we do have an error code. Set last error manually. */
-        msg(M_NONFATAL | M_ERRNO, "%s: MsiSetProperty(\"TAPINTERFACES\") failed", __FUNCTION__);
+        msg(M_NONFATAL | M_ERRNO, "%s: MsiSetProperty(\"DRIVERCERTIFICATION\") failed", __FUNCTION__);
         goto cleanup_CoInitialize;
     }