Automated Windows installer

Рысь lynx at lynxlynx.tk
Tue Oct 20 14:16:46 CEST 2015


On Sat, 17 Oct 2015 21:44:46 +0700
Рысь <lynx �� lynxlynx.tk> wrote:

> On Sat, 17 Oct 2015 14:54:17 +0200
> Guus Sliepen <guus �� tinc-vpn.org> wrote:
> 
> > On Sat, Oct 17, 2015 at 02:54:01PM +0700, Рысь wrote:
> > 
> > > The problem starts with Windows itself. We have tap-win{32,64}
> > > directories. Inside them, there is a few batch files and
> > > tapinstall.exe binary. It actually performs installation process
> > > of TAP driver and new interface.
> > > 
> > > And that's it: I can't safely rename interface from installer
> > > batch file. If it comes with name "Local Area Connection", then I
> > > can rename it. But if user has many unrenamed "Local Area
> > > Connection"'s? And localization issues: in Russia, it's always
> > > "Подключение по локальной сети". And OS can append a number if
> > > there multiple ones.
> > > 
> > > I can't link which interface belongs to which adapter: newly
> > > created, physical or virtual, TAP or VMWare and so on.
> > 
> > Have a look in src/mingw/device.c setup_device(). If you don't
> > specify a Device or Interface in tinc.conf, it will use the first
> > available TAP innterface. It finds it by going through the registry
> > to find adapters, and then tries to open \\\\.\\Global\\<adapter
> > id>.tap. If the latter succeeds, it means it's a free TAP interface.
> > 
> 
> Okay I see it, thanks! Usually my Windows nodes have no many TAP
> devices on their boxes, that's what I need.
> 
> I will try that and will report my success there.
> 

I share my experience with my first automated windows installer.

First, I did got the hint that tinc automatically uses first available
tap-win32 device which is allocated but not used yet. When tincd
starts, it finds it, reads it's name and passes it on tinc-up.bat as
%INTERFACE% envvar. tinc-up.bat then needs only to compare it to "lynx"
string (my network name '^^') and if it does not matches, perform first
time interface initialization (including renaming before any ip address
assignment). It uses netsh, which is available at least from Windows
XP. It also appends new interface name to tinc.conf. I don't know a
proper way of resolving location of tinc.conf, so I just use absolute
path, which is provided by installer.

After second and further runs, tinc-up.bat does nothing because
settings are already remembered by Windows. It's indicated by name of
interface.

I also implemented selecting of which tap-win{32,64} is needed to
install. No need to choose.

The remaining problems. Different Windows versions, more 8.x and likes,
it was reported that there interface renaming issues. Maybe other
commands are needed. Unfortunately I don't have more than Windows 7
32bit VM at the moment.

I attach my set of files which are part of installer for my network.
tinc.nsi is heavily populated with Russian messages, so beware.

-- 
http://lynxlynx.tk/
Power electronics made simple
Unix and simple KISS C code
----------- �������� ����� -----------
A non-text attachment was scrubbed...
Name: tinc_lynx.zip
Type: application/octet-stream
Size: 3803 bytes
Desc: �����������
URL: <http://www.tinc-vpn.org/pipermail/tinc/attachments/20151020/5fde2aae/attachment.obj>


More information about the tinc mailing list