CUCC Expedition Handbook - Windows Bulk Updates

A Windows Bulk Update laptop

First read the generic instructions for all the software installations you will need:
Setting up a basic Expo laptop
Setting up a 'survey laptop' for Expo survey processing

Unlike a Linux machine, on Windows there are two distinct levels of 'bulk update laptop' capability:

  1. Keys and key management, simple file transfer, scp, ftp
  2. Synchronisation of entire file heirarchies: installation and use of rsync
    TLDR; While it can be done, just don't do this in Windows. It's too fiddly and prone to error. If you really want to synchronise a large file heirarchy, use a Linux machine.

Level 01 - Windows Bulk Update

Software

Visual Studio Code editor

If you use VS Code here are some relevant extras. Not really for beginners but here are instructions for configuring it for python. On Windows you run VS Code as a Windows app but it communicates directly ("remotely") with the WSL Linux environment.

You will definitely want the "Git History" extension and probably the "GitLens" extension too.

It is entirely feasible (and on a slow machine, recommended) to use VS Code only for git management, and using a faster Windows-native editor, such as Notepad++, for actually editing code and text.

Configuration

Brendan wrote a guide to using puTTY and git for expo on a Windows machine. It's worth reading and it has lots of screenshots: Idiots guide to accessing expo git.pdf.

Key management and configuration

You need to register a key with the expo server to get upload (i.e. read/write) access. Do this first, Without it none of git, scp, ftp (or rsync) will work. You can do this entirely on your own if you have access to the expo laptop to upload and install the public key generated by your laptop.

On a Windows machine with PuTTY you will need to configure pageant (the puTTY authentication agent) to run at startup to load your key. Note that you are loading your private key, the .ppk file, into pageant and that this key never leaves your laptop.

Full illustrated instructions:

The above gets the command-line puTTY tools (ssd, sftp, pscp) running.

Most Windows software that we recommend "just works" if you have set up puTTY and have done the key-pair setup and are running a local ssh agent (pagent) automatically at boot up on your laptop.

Some software (such as Filezilla) defaults to using pageant and it "just works".

When using Windows please, please be excessively careful when naming files and survex names.

Configuring Filezilla or equivalents

Filezilla defaults to using pageant and it "just works" if you used PuTTy.

Configuring git

Idiots guide to setting up git for expo - PDF - Brendan's guide. Uses puTTY and GitKraken on WIndows. Read this, but most people will need to use VS Code instead of Git Kraken.

Some software, such as the commercial (but free) GitKraken, requires that you click a checkbox to say that you are "using local SSH agent" rather than specifying ssh private keys explicitly (File->Preferences->Authentication in GitKraken).

Things that cause problems

Filenames

Linux allows characters in filenames which Windows doesn't. There are also apparently normal filenames which Windows rejects (such as "CON") for historical reasons. Linux filenames are case-senstitive and Windows filenames aren't: beware.

Symbolic links and file-transfer

Linux people like to use links. This is where there is really only one file, but it is referred to by different names. This is particularly useful when a file is moved, but you want people who have got the old location to still be able to find it. This happens quite a lot when updating handbooks.

The links you are most likely to come across are that what looks like /home/expo/expoweb is really just a link to the folder /home/expo/repositories/git/expoweb,
and that expoweb/essentials.gpx is a link to the file /home/expo/expofiles/gpslogs/essentials/essentials2019.gpx

But that example is in the :expoweb: repository, so you won't be using sFTP to download it. Instead you will be using the version control software which handles it without problems. But we use it as an example of what to look out for when using sFTP.

There are two types of linux links: hard links and symbolic links. Symbolic links are much the same thing as Window's "Shortcuts" but there is no equivalent on Windows to Linux hard links. Fortunately we don't seem to have any hard links anywhere.

What really makes things unpleasant is that sFTP software won't tell you when it comes across a link and will just do something stupid. Our recommended sFTP software - Filezilla - is guilty of this,as it pftp (puTTY) working in eith sFTP or scp mode.. So what happens is that when you download a load of files onto your laptop using Filezilla it will simply turn every link it finds into a complete copy of the file. Then when you upload those files to the server, the copied file overwrites the link. So the server now has two files with the same content - which is a maintenance nightmare. This is painfully stupid because if it is a symbolic link there is no reason why Filezilla couldn't just create a Windows Shortcut which would do exactly the same thing. But it doesn't.

So the ordinary user won't notice any problems, but the nerds behind the scenes start to cuss and shout and generally carry-on in an expletive-heavy manner.

What is even more irritating is that Filezilla displays an link (essentials.gpx in the image) with a little arrow - it knows perfectly well that it is a symbolic link (although it does display it with a folder icon) - but it downloads it as a file copy.

Symbolic links: the solution for Windows

Level 02 - Windows Bulk Synchronisation with rsync

TLDR just don't do this: please.

When using Windows please, please

rsync is a Linux command-line application, so we need a terminal window to run it and a Windows client executable. None of the packaged software already documented (Filezilla, PuTTY) includes a Windows rsync client.

Windows comes with a terminal window (cmd.exe) so we 'just' need a native Windows rsync executable rsync.exe.

If you just want rsync, then please try the Cygwin method first. If you struggle with Cygwin, then you are unlikely to get any of the other methods to work either. So use Filezilla or WinScp.

If you don't like Cygwin, and want to use a bash terminal environment instead of Windows cmd.exe, then try the MINGW32 method.

Only install WSL if you are pretty sure that you want to use WSL for things other than rsync.


Go on to: Troggle architecture
Return to: Troggle programmers' guide
Troggle index: Index of all troggle documents
Go to: ※ Basic laptop
Go to: ⁂ Survey laptop
Go to: ☆ Bulk Update laptopWindows Bulk Update laptop
Go to: ⚒ Troggle development laptopTroggle development WSL laptop