I wanted to only install the OpenVPN service from the MSI file I downloaded from here.
As you can see from the screenshot above I have to manually select to install OpenVPN Service and disable the other features I don’t want
First we will need to download and install Orca. If you want to skip downloading the Windows SDK you can download only the Orca program from here.
Next open Orca and click File>Open and select the OpenVPN MSI file and click Property
Take note of the INSTALLLEVEL number
On this MSI file the number is 2
Next we need to make a transform file
Maybe you can use my file here if you want to try. If it doesn’t work generate one like so:
Click Transform>New Transform and you will see (transformed by untitled) in the header like so
On the left click Features and look at the Level Column. Remember earlier we took note of the INSTALLLEVEL number? Any number equal or less means install the feature. +1 means don’t install.
The level number is 2 so 2+1=3 meaning anything with 3 will NOT be installed. 2+0=2 or 2-1=1 meaning anything set to the number 2 or 1 WILL be installed (If you number is 100 for example then 100 and/or 99 means install the feature. I don’t know if ANY lower number works or not and would need to experiment)
Here are my changes
Now click Transform>Generate Transform and save it somewhere
The last step is to open command prompt and cd to the correct directory where the MSI file is located and the transform file and type the following:
msiexec.exe /q /i OpenVPN-2.5.1-I601-amd64.msi TRANSFORMS=OpenVPN.mst
Now that the service is installed I simply need to put my .ovpn file and the keys here C:\Program Files\OpenVPN\config-auto
When I reboot the computer or start the OpenVPN Service service the connection will auto connect
References:
https://docs.microsoft.com/en-us/windows/win32/msi/orca-exe
https://www.geekshangout.com/customising-an-msi-install-using-orca/
https://4sysops.com/archives/edit-an-msi-file-with-the-orca-msi-editor/
https://www.technipages.com/download-orca-msi-editor
https://www.itninja.com/blog/view/the-complete-guide-to-msi-switches-for-silent-software-installation
https://openvpn.net/community-resources/running-openvpn-as-a-windows-service/