In a previous article, I outlined the steps I took to “roll” my own customized OpenVPN installer, and it worked like a charm back then. OpenVPN has gone through several revisions since, and getting things running (especially on different architectures) with the new versions just doesn’t work so well. Luckily, there’s another way to approach this problem and have OpenVPN installed as it was intended (i.e. the correct TAP driver will be detected and the shortcuts where they belong). This method is more of a workaround, but definitely works. Note that with this method you can’t rename OpenVPN to “MyVPN” or whatever like the previous method.
This method employs the use of an SFX that installs the vanilla OpenVPN installer as downloaded from their site, then automatically installs the keys afterwards. You have the option of making the install entirely silent as well–it’s all up to you.
Prerequisites:
7-ZIP SFX Maker (version 2.0 at the time of writing)
7-Zip (or another 7-Zip-capable archiver such as IZArc)
OpenVPN (version 2.1_rc19 at the time of writing)
Your OpenVPN keys
Steps:
First, package your OpenVPN keys with 7-Zip. If you want multiple OpenVPN connections configured on the same machine, it’s a good idea to have each connection’s keys in a subfolder. Ensure that each connection has a .ovpn or .conf file with a unique name.
Next, open up 7-ZIP SFX Maker and add your archived keys by clicking on the “+” symbol. Now, go to the “General” tab. Under “Extract to specified folder”, enter %ProgramFiles%\\OpenVPN\\config. You can right-click for some preset environment variables if you want to change the path.

You can change other options if you’d like. I have “Beginning extraction of keys…” in the “Begin prompt” field of the Text tab. From here, you’re ready to click “Make SFX”.
Now, create another 7-Zip archive with your new SFX and the OpenVPN installer. Add this archive to 7-ZIP SFX Maker. In “General” enter %tmp% or another writable directory in the “Extract to specified folder” field. I have “Allow user to change extraction path” checked as well–this all depends on your environment and needs. Under the Text tab, I have it filled as follows:

Under the Shortcuts tab, I created a shortcut to OpenVPN GUI in Startup so that it starts on login.
Now, (and this is important), go to the Execute tab. We will tell the SFX maker to run the OpenVPN installer then run the SFX for the keys. Be sure to list them in that order. Note that I have a /S in the first entry because I want OpenVPN to install silently. Sadly, not everyone at my company knows how to install software, and I’m satisfied with the setup defaults anyway.

You’re now ready to “Make SFX”! Your new installer will be placed in the folder your files were in.
You might want to play around with settings until the installer suits your tastes.
I have not tried this, but the config requires the network adapter name as shown in the network adapters section of control panel. i dont see where you are forcing the adapter to a know name here, can you clarify
In your OpenVPN client config file, you usually don’t need to specify your TAP adapter name. Do you have multiple TAP adapters for other software? If not, then leaving out the adapter name should be fine.
I’m interested in a quote to have a custom client for XP/Vista/MAC/Linux for 4 sites. Please contact me. Thanks.
Hi
Nice tuto but imgs are not displayed and important info are on these imgs.
Can you fix it or send me them.
ThY
Regards
EJB
Not all of the options seem to be available in the version of the 7-zip sfx maker. I do not see an execution tab and other options you’ve mentioned here as well. Is it still a tool that can accomplish all this?
Josh,
I just downloaded the new version from the site ([url=http://teejee2008.wordpress.com/2010/12/30/7-zip-sfx-maker-v3-2-12302010/]7-Zip SFX Maker v3.2 (12/30/2010)[/url]), and it does look quite different. Luckily, it seems like all the features we need are still there, just in very different places.
You’ll have to dig around, but, e.g., the execution portion is now under the “Tasks” tab. Click on the “+” and choose “Run Program.” Hopefully everything else works in the same way.
EJB,
Sorry for the delay. I’ve fixed the image links and you should be able to see them now.
Ameir,
Thank you for your assistance. When I launch 7-zip it sends me a message that resource hacker is not installed. I downloaded and installed it but 7-zip doesn’t recognize that I did. Is it needed to accomplish packaging the vpn client/config/certs?
On the 7-Zip SFX Maker site, it has a link to Resource Hacker. It’s only really needed to change around icons, so you should be good to go without it. If you’d like to download it, here’s the link:
http://delphi.icm.edu.pl/ftp/tools/ResHack.zip
Last question Ameir,
What should the parameters be for the shortcut? It’s asking for destination folder and working directory. Are those both going to be set to “%ProgramFiles%\OpenVPN\” or “%ProgramFiles%\OpenVPN\bin” ? Thanks!
The source file seems to be what’s important. Not sure how to structure the path to make sure it is accurate.
What about OpnVPN GUI Installer? I didn’t see it in the prerequisites. Guess it should be third in execute tab.
Or we can’t add this on the installation file?
Daniel,
After following this guide, the OpenVPN GUI will be installed as well. That is included with the Windows installer package on the OpenVPN site.
Hope that helps!
I can’t believe I’ve been going for years wthoiut knowing that.
Hi, I will like you to help me to hide my configurations files. After setup, i dont want the users to be able to edit the config files or even see them. What do I do ?
Very helpful guide and I can confirm it works beautifully even with newest versions of the apps and latest openvpn-gui windows installer
thanks for the great article
Since we need to install in windows vista and 7, we need to make the installer sfx AND the openvpn gui “run as admin”, so the client doesn’t need to do that manually.
There’s anyway to do that with sfx maker?
I’m getting an error that system can not find file .\\.\\.\\openvpn-2.2.2-install.exe\\” /S”"”
any ideas?