Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installer disables OpenVPNService #348

Closed
TitovLab opened this issue Apr 4, 2023 · 3 comments
Closed

Installer disables OpenVPNService #348

TitovLab opened this issue Apr 4, 2023 · 3 comments
Assignees
Labels
msi related to MSI installer
Milestone

Comments

@TitovLab
Copy link

TitovLab commented Apr 4, 2023

Describe the bug
When distributing OpenVPN through Active Directory group policies, if this version has already been manually installed on the computer, the installer disables the OpenVPNService service.
This only happens if there is an exact version match. If you manually install 2.6.1, use VPN to get in touch with a domain controller, add a workstation to the domain and deploy version 2.6.2 through policies, everything will be fine.

To Reproduce

  1. Install OpenVPN-2.6.2-I001-amd64.msi on a clean Windows 10 22H2
  2. Add this PC to Active Directory domain
  3. Deploy OpenVPN-2.6.2-I001-amd64.msi via Active Directory group policy

Expected behavior
OpenVPNService must not be set to disabled

Version information (please complete the following information):

  • OS: Windows 10 19045.2728
  • OpenVPN version: 2.6.2-I001-amd64

Additional context
MSI log:
MSI3174.LOG

Attracted attention two strings:

MSI (s) (6C:C8) [15:08:18:389]: Executing op: ServiceInstall(Name=OpenVPNServiceInteractive,DisplayName=OpenVPN Interactive Service,ImagePath="C:\Program Files\OpenVPN\bin\openvpnserv.exe",ServiceType=32,StartType=2,ErrorControl=1,,Dependencies=Dhcp[~][~][~],,,Password=**********,Description=Allows OpenVPN GUI and other clients to establish OpenVPN connections without administrative privileges in a secure way.,,)
MSI (s) (6C:C8) [15:08:18:389]: Executing op: ServiceInstall(Name=OpenVPNService,DisplayName=OpenVPNService,ImagePath="C:\Program Files\OpenVPN\bin\openvpnserv2.exe",ServiceType=16,StartType=4,ErrorControl=1,,Dependencies=Dhcp[~][~][~],,,Password=**********,Description=Responsible for automatic start of OpenVPN instances.,,)

Apparently the installer gives the wrong StartType for OpenVPNService. At the same time, there is no error with OpenVPNServiceInteractive, the problem is only with OpenVPNService.

@lstipakov lstipakov transferred this issue from OpenVPN/openvpn Apr 4, 2023
@lstipakov
Copy link
Member

This is likely due to this code:

<Custom Action="ConfigureOpenVPNService" After="StartServices">NOT Installed</Custom>

This custom action sets start mode and starts/stops the service. For new installation start mode is set to auto and service is started. For upgrade existing settings are preserved. However, this action is supposed to be run on install/upgrade.

Apparently this condition got confused by installation of the same version, and this action is not executed:

MSI (s) (6C:C8) [15:08:06:233]: Skipping action: ConfigureOpenVPNService (condition is false)

I am not too much into AD group policy but I wonder how MSI allows you to install the same version of the product?

@lstipakov lstipakov self-assigned this Apr 4, 2023
@lstipakov lstipakov added the msi related to MSI installer label Apr 4, 2023
@TitovLab
Copy link
Author

TitovLab commented Apr 4, 2023

No tuning, clean OS, clean Active Directory, a test enviroment specifically for OpenVPN.
Thoughts came to mind that this might be due to the new location of the MSI file or the update being launched under the system account - but they were not confirmed in the tests.
It is also strange that this does not happen with OpenVPNServiceInteractive - the service continues to work after such an update and it still has automatic start. The problem is only with OpenVPNService.

@lstipakov
Copy link
Member

We set interactive service state unconditionally, and openvpn service uses custom action, which in your case is not run. I need to tune condition a bit so that it will run on install and reinstall too.

lstipakov added a commit to lstipakov/openvpn-build that referenced this issue Apr 4, 2023
We configure openvpn service (set startup mode and run, if needed)
only on installation or upgrade. This is achieved by running
configuration custom action with "NOT Installed" condition.

However the product may be reinstalled (even though we disable it in UI),
for example when pushed via AD Group Policy or with command line

    msiexec /fomusv "OpenVPN-2.6.2-I001-amd64.msi" /L*V reinstall.log

In this case OpenVPN service status is set to "disabled", since our
configuration custom action won't be run.

Fix by changing action condition to NOT REMOVE, which covers both
install/upgrade and reinstall cases.

Fixes OpenVPN#348

Change-Id: I92974dea4749c415e25ab0f804050e3e6d309ffc
Signed-off-by: Lev Stipakov <[email protected]>
@lstipakov lstipakov added this to the 2.6.3 milestone Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
msi related to MSI installer
Projects
None yet
Development

No branches or pull requests

2 participants