Creating a customized OpenVPN installer - Round 2

23 07 2009

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.



Trackbacks


23 07 2009
Creating a customized OpenVPN installer
Note: See "Creating a customized OpenVPN installer - Round 2" for another approach to a custom OpenVPN installer. OpenVPN is an excellent product with seemingly infinite configuration options. After setting everything up to your tastes
Weblog: ameir dot net
Tracked: Jul 23, 15:11

Comments

Display comments as (Linear | Threaded)
05 08 2009
#1 What about renaming the tap interface (Reply)

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
12 08 2009
#1.1 Ameir Abdeldayem (Reply)

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.
28 10 2011
#1.1.1 Josh (Reply)

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?
29 10 2011
#1.1.1.1 Ameir Abdeldayem (Reply)

Josh,

I just downloaded the new version from the site (7-Zip SFX Maker v3.2 (12/30/2010)), 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.
29 08 2011
#2 EJBye7 (Reply)

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
29 10 2011
#2.1 Ameir Abdeldayem (Reply)

EJB,

Sorry for the delay. I've fixed the image links and you should be able to see them now.
01 11 2011
#3 Josh (Reply)

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?
01 11 2011
#3.1 Ameir Abdeldayem (Reply)

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
01 11 2011
#4 Josh (Reply)

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!
01 11 2011
#5 Josh (Reply)

The source file seems to be what's important. Not sure how to structure the path to make sure it is accurate.
08 12 2011
#6 Daniel Agra Iserhard (Reply)

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?
09 12 2011
#6.1 Ameir Abdeldayem (Reply)

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!
13 01 2012
#6.2 Lola (Reply)

I can't believe I've been going for years wthoiut knowing that.

Add Comment


You can use [geshi lang=lang_name [,ln={y|n}]][/geshi] tags to embed source code snippets.
Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
Standard emoticons like :-) and ;-) are converted to images.
BBCode format allowed

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA