Archive for the ‘Windows’ Category

TapInstalling MinGW

2 Jun 2007 20:47 by Rick

One thing I have noticed about much free and OpenSource software is that often the instructions for complete Noobs are very poor. Many lack

  • Any good advertising of where the packages can be found.
  • Any good description of why you might want them (see Firefox extensions for some good examples)
  • Any “Getting Started” instructions on what to download and how to install it.
  • Any place to get help.

Of course, not all fail in all of the ways, MinGW is better than some.

What is MinGW

MinGW stands for Minimal GNU for Windows and is a project to enable the extensive GNU software library to be run and utilised from a Windows environment. For many people, myself included, this means access to the excellent compilers and accessories. This enables you to compile and distribute your own and OpenSource software without requiring that the end user load a new runtime environment, libraries or DLLs unlike some similar systems like Cygwin. In particular, I use it to build a Win32 version of HTML-Tidy.

This is complemented by MSYS (which stands for Minimal System) which is a subset (fork) of Cygwin and creates a Unix-like Bourne shell environment but it is important to note that neither depends on the other and can be used independently. You can use MinGW from Windows Command Prompt if you like (though there are no GUIs).

How do you install it

This was something I struggled with even though I had done it before; a long time ago. Some of the instructions don’t appear until after it is installed. I am going to describe installing both MSYS and MinGW because it is easier to install the latter using MSYS, but you don’t need to use it again if you don’t want to. On the download page you need to skip past the Candidate section to the Current section. There you will find lots of packages.

Installing MSYS

First you will need the exe bin for MSYS (currently MSYS-1.0.10.exe). This installs very easily as it is a proper Windows Installer. Run it under a Windows Admin account and take all the defaults so that it loads into C:\msys. You get a lot of information pages with pauses; you can make notes but I will cover most of them below. The only thing I have seen which it gets wrong is that it puts the desktop shortcut into the current user rather than “All Users” so you may need to move it.

Preparing for MinGW

Create a new folder C:\mingw ready to accept the files.
The next stage is a bit tricky if you are not familiar with Unix and the “vi” editor so you may need to follow the instructions letter by letter. What we are doing here is connecting the MinGW install folder to the MSYS system. We also connect up a “home directory” in your Windows “My Documents” folder for convenience. Note that the “/”‘s go the other way to what you are used to in Windows and you don’t need to type the “$ ” which is the prompt on many lines.

Open up MSYS either from the desktop icon or from “Start | All Programs | MinGW | MSYS | msys”. This will give you a command-like window but white with coloured bits rather than black.
$ cd /etc
$ vi fstab

Now you need to type the single letter i (for insert) followed by
c:/mingw /mingw
c:/DOCUME~1/Rick/MYDOCU~1/mingw /home/Rick

No newline on the very end but exit from insert using the “Esc” key (top left of the keyboard).
Of course, instead of Rick, substitute the name of your normal day-to-day Windows login account. If it is a long name or in Windows fancy format with spaces etc. then you will need to use the DIR/X command in a Windows CMD shell to find out what its short name is.
Now type ZZ (note they are capitals) which is a shorthand save and exit command and you should now be back to the “$” prompt. Type exit to go out of MSYS. Now when you restart it you should be able to cd /mingw and be in the folder you created at the start of this section.

Installing MinGW

You will now need to download the MinGW packages you need from the web site. In the same “Current” section, I would suggest that you start with “mingw-runtime” (currently version 3.9), “mingw-utils” (currently 0.3) and “binutils” (version 2.15.91). The packages you are looking for are marked “bin” and all end in “tar.gz”. If you are going for the compiler you will also need “gcc-core” (version 3.4.2) from the gcc section, the Windows API “w32api” (version 3.6) and the make command “minggw32-make” (version 3.80.0-3). Curiously the latter is an exe at the moment. Put all these files in c:\mingw. Now if you go to your MSYS window and type
$ cd /mingw
$ ls

you should see the same files.

Now we can start installing them. This is the bit which is most useful to do from MSYS. First a little hint. Copy and paste in MSYS and most Unix-like systems works differently to Windows. Any text selected is immediately copied to the clipboard, you don’t need to type CTRL-C. To paste it to where the cursor is, click the middle mouse button. No middle button? Try clicking the wheel, it usually functions as a button as well. No wheel? Perhaps time for a small monetary investment.

Most of the files you have downloaded are compressed tar files. Compressed you will understand and it needs the “gunzip” program to uncompress them. This is provided in MSYS so, doing the first package, you need to type
$ gunzip mingw-runtime-3.9.tar
Note that it doesn’t have the “.gz” on the end (though it could) and the easiest way to do this is to select the text from the ls you did earlier and paste it onto the command line after typing “gunzip “.
Tar stands for tape archive and is a very old unix file format used for aggregating files for shipping. The tar program is provided in MSYS and one command which can be used to extract the files is
$ tar -xfpvB mingw-runtime-3.9.tar
Note the capital “B” and the file name is identical to the above and is probably still on your clipboard for paste. The files are extracted into multiple directories which you can see with an ls command or Windows Explorer. If you have finished with it you can delete the tar file or archive it somewhere; it is not needed in this directory any more.
You need to do this for each of the packages except “mingw32-make”.

Installing “make”

For some reason, “make” is installed using a Windows installer so you just need to run the exe. You just need to answer the questions and accept the default install folder C:\mingw. Now it needs a little configuration in MSYS.
$ cd /bin
$ mv make.exe mingw32-make.exe
$ cd /mingw/bin
$ mv mingw32-make.exe make.exe

This is to effectively comment out the low function MSYS “make” command and enable the fully functional GNU one.

Finishing up

You can now log out of the Windows Admin account and into your normal day-to-day account. Create a folder “mingw” in “My Documents” and then you can start up MSYS. Type ls and you should be able to see any files in your new personal “mingw” directory and you are ready to go and start using it.

If you are going to use the MinGW stuff from the Windows Command Prompt (CMD) then you need to put C:\mingw\bin into the search path so the programs can be found.
To do this right click on “My Computer” and select properties (or select “System” from the Control Panel). Select the Advanced tab and on there the “Environment Variables” button at the bottom. If there is a PATH variable in the top section then select it and click Edit, if not then click New and create one called PATH. Don’t touch the System variables in the bottom section, that is dangerous. Add the string ;C:\mingw\bin to the value (note the semi-colon which is needed to separate values but not if it is the only one). Click OK three times to get out.
Now you need to logout and log back in again and it will be all ready to go.

Running gcc from MSYS

This couldn’t be easier.
$ cd
$ gcc -o program program.c

and you are there.

Running gcc from Windows Command Prompt

Just as easy; open a CMD window by opening “Start | Run…”, enter cmd into the box and click OK. This will give the familiar black window that used to be called DOS.
cd My Documents\mingw
gcc -o program program.c

and there you are again!

TapEasyWorship Schedule Printer

11 Dec 2006 10:25 by Rick

One of the few flaws in the EasyWorship church projection software relates not to its primary function but the printing facilities. It was perhaps thought that these were entirely secondary but we are aware that some people can’t (or won’t) get on with the projected image and need a paper copy. When the church is geared to a bookless service, perhaps by necessity because the songs now in use are not in the books, there needs to be a way of providing a few paper copies. It is not worth expending large amounts of administrator time in producing these as used to be done when printed orders of service were provided to everyone, so a means to reproduce what otherwise appears on the screen is needed.

The EasyWorship software provides a “Print Schedule (Details)” facility but this is of fixed format and one song (or whatever) to a page. Variations to this may well be needed. In our church we project liturgy, sometimes only two lines per item. This would be very wasteful of paper and a thick pile for someone to handle. The only alternative has been to cut and paste the song details to a word processor document but this was exceedingly tedious and took too much time. The best time to produce this leaflet is just before the service.

To get around this problem I have written a post processor to format the output in a more useful (and customisable) form … [more]

TapAVG Free

22 Nov 2006 14:12 by Rick

In case you are confused by the recent pop-up messages, and the news reports suggest you may be, Grisoft still have a free version of AVG Anti-Virus available and it is even better than it used to be. All that is happening is that v7.1 is going out of currency and you need to upgrade to 7.5. It is not as easy to find as it used to be but is still the best value product out there. I haven’t tried the Anti-Spyware tool yet.

AVG Free Advisor: Free Anti-virus, anti-spyware and anti-malware tools

TapHasta la Vista?

20 Oct 2006 11:44 by Rick

Eyeing the much delayed but imminent Windows Vista operating system you might think that Windows XP was dead but you would be mistaken. It still has life and Microsoft even has plans for an upgrade. SP3 is currently scheduled for mid 2008 (recently delayed—but MS is synonymous with delay). From the previews I can’t see much that is attractive about Vista from an upgrade point of view. Many of the features seem to be cosmetic for initial impact and first sale. Perhaps when software starts to exploit the underlying features rather than just stick the logo on the box then it may make sense.
Incidentally, I think I would need a new machine by then because this one has already been upgraded rather a lot; same old machine just new motherboard (died), cpu (oomph), memory (twice), ME to XP to SP2, power supply (died), screen (dying) and graphics card (soon). What we call around here a “wheels only upgrade” except that it was done piecemeal.

TapWot no Printer!

19 Oct 2006 15:26 by Rick

There are some systems that you put in that have no direct access to a printer; our new church projection system is an example. But some software reports need one to be used effectively. If the software has thought of this in advance then they will have provided a file output option so you can take it away for printing elsewhere but if not then you are a bit stuck.
EasyWorship is an example. It provides options to print the schedule either in detail for those that need a paper copy, or summary as a crib sheet for the leaders. It also provides song usage statistics and database reports the same way; but if you have no printer you can do little more than read the screen.
There are two solutions to this dilemma; There is some free software called CutePDF which allows you to “print” from any application to a PDF file. This preserves all the layout and style as if it went to a high function printer. The second is built into Windows XP; the “Generic / Text Only” printer. This is very easy to set up and produces a plain text file from a text print. Not pretty but very useful if you want to manipulate it further.

TapIE7

16 Oct 2006 18:24 by Rick

In case you haven’t heard, Microsoft are about to release Internet Explorer Version 7 to the world—I am not exactly sure when. Anyway, they are so keen on it that, soon after it becomes available, they are going to push it out as a “fix” on Patch Tuesday like the monthly security repairs.
My opinion, for what it is worth, is that the average user should resist installing this for a while to give it a chance to settle down. Many web sites will not be prepared for the changes. I have not tested it yet because I don’t want to install a pre-release version onto my only working computer, so I haven’t tested and adjusted my web site for it. I expect there are many people in the same position. Give it a few weeks for the gremlins to be worked out and see what the press is like before committing yourself. This is the same even if you use an alternative browser; a surprising amount of internal Windows relies on Internet Explorer, not the least of which is Windows Update.
Of course, if you are configured for automatic updates then you will need to turn this off and set it for notify-and-manual-install for a while so you don’t wake up one day and find it has just happened.

TapManaging passwords

6 Oct 2006 14:21 by Rick

The prompt for this post came from an unlikely source. Taking passwords to the grave (via Bruce Schneier) which talks about the problem of accessing a person’s assets after they are gone. We will come to that at the end.

My problem was an ageing memory and dozens if not hundreds of passwords to remember together with other important information. This had to be kept securely but readily accessible, even when away from my desk. The solution I came up with is as follows.

  • Store all of the passwords and related information in a database. I chose one that is designed for the purpose and had a good encryption scheme. This is PINS. It is a freeware product which seems to have minimal support but it works well so no matter. The encryption is blowfish and it comes with a useful random password generator.
  • Put the database and the software on a USB flash drive. To some extent this steers the selection of the software above because it has to be capable of running without being installed on the PC. It does however limit it to the Windows platform.
  • Take regular backup copies of the database. To do this I use “Pen Drive Manager.” This is not free but very low cost. What it does is every time you plug in your flash drive it synchronises it with a copy on the PC hard drive. I run a copy on my home machine and my office machine so I have two backup copies of the database at all times.

To run this successfully you must make sure that the database that you update is always the one on the flash drive so that it is the master copy. I install a copy of PINS on each machine for convenience but you don’t have to. Also you must have a good password for the encryption of the database. Once you have got it running, all you need to remember to do is update the database copy of the passwords when you change them in real life. Of course the password you cannot store on there is the password to the database itself. You don’t even have to remember the passwords to get into your own PCs because, if pushed, you can borrow someone else’s, plug in your flash drive and run the copy of PINS loaded on there.

If I forget my flash drive, firstly, PINS locks down after a few minutes so no one can access the database. Also I can still access the passwords on the other machine by pointing at the backup database. All I have to remember to do is not update anything and also switch it back to the portable copy as soon as possible. If I lose the flash drive completely then not only is it secure but I have all the information I need to recreate it.

You don’t have to just have passwords in the database. I have network configuration details, software activation keys, credit card numbers and PINs, web upload addresses, and any other information that I mustn’t forget. There are a couple of minor bugs in the software but nothing to stop me using it which I have for over two years now.

And back to the problem that prompted the post. Give your executors a copy of the database password, perhaps in a sealed envelope (and some instructions). This will give them access to all your other passwords and the further instructions and information on the database. That way, if you are lucky, your web site will be kept online containing your life’s work, they will be able to access your email and online banking accounts and anything else they need to manage your estate. Of course if you want to take anything to the grave with you, then keep the password somewhere else.

TapW98 Rest in Peace

11 Jul 2006 06:41 by Rick

W98

Well, it has finally gone after all these years, and it is the full flush this time after an earlier attempt failed to see it off. The one we all loved to hate has gone forever. I am certainly not sad to see it go. I can now say with a clear conscience, “sorry I can’t help you; you could install Linux on the old box.” Much has been said to deride XP but it is an order of magnitude better than 98 (we won’t mention ME which has been in a coma for years).

Of course some people loved it; that is fine, I never had to support them anyway as they were enthusiasts and they could get it to work. Joe User, however had nothing but heartache and blue screens.

Now what?

Using it to let the grandchildren surf the net is not a good move. Just because MS have laid it to rest, doesn’t mean the virus writers will. A botnet of W98 zombies will suit them fine. According to W3Schools, 1.6% of systems connecting to them are still running it. Make yours stand-alone and let them run all those great games you had forgotten about.

If you have an application that absolutely must use 98 then isolate it, use the box for nothing else. If the machine is running reliably then leave it alone. If it is a bit dodgy then consider reinstalling from scratch with all known patches. There is a list at Techspot but I don’t know how long they will remain available at MS so cut them to a CD now. Surely someone will create an online archive, but there may be copyright problems. Install just that one application. You probably won’t be able to get AntiVirus updates for much longer so you need to disconnect from any critical network, especially the open internet. If it has to connect to something then put in a firewall, the current ZoneAlarm should work just fine; close it right down to the bare minimum.

TapWindows phone home

22 Jun 2006 15:13 by Rick

I meant to write about Windows Genuine Advantage communicating back to base every day when it was first announced, but first I wanted to check that blocking it did not hinder the monthly patch cycle—then I forgot. It happens a lot these days.

Anyway, the main problem was first reported at the beginning of the month. I blocked mine immediately and since then we have had Patch Tuesday and all went well.

As far as I can tell there is no need to allow WGA to contact the internet in its own right at all. It does its proper job via an ActiveX call from Windows Update which does the communication to verify that you have a good licence before allowing patch updates.

The sub-agenda function of sending a message back every day is not needed for anything so it is quite easy to block with an outgoing firewall like ZoneAlarm. Just look for the program under W and mark it forbidden for Internet. There is no need to use extra fancy programs like RemoveWGA.

TapAdvent GPS 400 and ActiveSync

17 Jun 2006 14:39 by Rick

This is a follow up to my review of the Advent GPS 400 Personal Navigation Assistant.

When you get the device they provide a CD containing a copy of ActiveSync (v3.7.1). This is a Microsoft program that is designed to handle the communication between PDA devices and a PC for things like the synchronisation of address books and the like. Most of that is irrelevant to the GPS though, as it is running Windows CE under the covers, it could probably be made to act like a proper PDA if you loaded the right software. As it is, you can probably ignore most of the features of ActiveSync but it is still worth installing. When you first connect the device it asks you for a name for it and then asks what you want to synchronise. You may as well untick all the boxes as none of them are relevant. When the main ActiveSync screen starts up, select Tools -> Backup/Restore and set it to (incremental) backup each time it connects. While you are at it, you could do a backup now, it will take a few minutes. Subsequently it will back up each time you connect the device but that only takes a few seconds as the only things that have changed will be small files like your favourites.

Pray that you never have to Hard Reset the device using the concealed on/off button underneath. If you do then ActiveSync will think that it is a different device and go through the install process again. It will NOT let you chose the same name.

As I mentioned to Dean in a comment to the original posting, if you want to copy new maps onto the device you need to open it as a plain storage device. You can do this from My Computer or you can use the Explore button in Active Sync. In here you will find the memory card as “Storage Card”. Just use Windows drag and drop to copy the new maps onto the device … and wait, as it takes a very long time. It is best to do it from the computer hard drive rather than direct from the CD. Then to activate the new map use the big Map button on the front screen (I am embarrassed by the length of time it took to discover this). It will then shut down the navigation and the next time you start it will be on the new map. Note: the device is not capable of navigating across the map boundaries e.g. from England through to France.

While we are in Explore mode on ActiveSync, it is worth noting that the files that are changed when you store new favourites etc are in the \My Flash Disk\mnav_ucf\ folder. If you want to take a safety copy then copy them by hand into a location on your PC (usual drag and drop or select, copy and paste). Although we have set the machine to automatically backup in the section above and there is a restore command I have no confidence in it and the backup file is in some obscure internal format so that selective restores are not possible. I would rather be safe.

If you want to use the Sync Files feature of ActiveSync then, as far as I can tell, it only synchronises the \My Documents folder on the device with a matching folder in My Documents\DeviceName on your PC and even then I couldn’t get it to work properly—the Sync seemed to work but when you plugged the device in again it deleted them from the PC. If anyone does get this to work then please let me know. Similarly the device has a MP3 Player mode, when I selected Add Song it couldn’t find any—perhaps they have to be in a particular location, it couldn’t find ones that I know were there on a card from another PDA.

^ Top