I got CHDK-Shell to work with Vista

I finally got CHDK Shell to work with vista. It's been 10 years since I last worked in a unix-like environment, and wow did it ever take a while to figure out what was going wrong.

Anyway, here's what seems to work:1) If you've already been trying to get CHDK-Shell to work in Vista, you'll want to pull down a fresh trunk. make clean won't get rid of the detritus in your platform/sub folder if you've previously tried to make CHDK-Shell work with vista. I ended up nuking all of trunk788 and syncing fresh.

2) Install a recent MSys. I used Msys 1.0.11, which I think is currently the latest version. (before installing MSys, I had previously installed MinGW 5.1.4. I do not know if this is a requirement for successful installation of MSys. sorry)

3) Copy the contents of the Msys bin folder (for me this was C:\msys\1.0\bin) into CHDK\gcc4\bin. This will overwrite about 60 files, including the ancient version of sh.exe that doesn't like Vista. I don't know why, but simply replacing sh.exe by itself seemed to cause problems so, as I said, I'd recommend copying the whole folder.

For some reason (new shell? other?) the parsing for the parameter to sed gets totally messed up. It seems to dislike the number of slashes. The recommendation I found in a couple places online is that if you put your sed s expressions in single quotes, that will protect them from the worst of the shell's tendencies to parse slashes. The proposed replacement seems solid, but I'm very open to guidance from someone who actually knows about gnu/make/linux. A lot of this was trial & error

5) also, to get CHDK-Shell to run in Vista you will of course have to add WIN_VISTA to the list of acceptable platforms in CHDK-Shell-v219.au3.

After this, you should be able to use CHDK-shell in Vista. I tried it and, when compiling a720-100c, my resulting file was identical to the file produced on a machine an unmodified version of CHDK-shell on XP. (binary compare revealed three differences - all of them recording the date and time when the file was built).

I'm pretty sure the thing where it's messing around with the path to uniq.exe is to try to ensure that you're picking up and linux flavored sort.exe, and not the one that lives at C:\Windows\System32\sort.exe

It's possible that just using sort.exe without a path will work, but I was assuming that referrencing uniq.exe's path was meant to solve some specific problem. I will admit though that I have no idea what problem that would have been.

It is entirely possible that this is something that's more important when you're not using CHDK-shell. CHDK-Shell sets up your search path so that gcc4/bin will always be the first thing that you hit. So, for you, sort.exe is very likely referring to the correct executable.

I have verified that these changes do not interfere with CHDK-Shell on XP.

I don't know if there's a possibility that these changes will make it into the official CHDK-Shell release. Maybe Whim can comment on that?

i can confirm that this appears to work under XP ! Note that i needed to install MingW 5.1.4 with option 'Candidate' to get the latest versions, then MSYS 1.0.11. Looks like installing MinGW is an essential step, as MSYS seems to use a part of it's files to populate it's own /bin ...

i'll continue testing, and hope to release a new 'full' version with devkits soon.

just a little update: did some more selective copying, CHDK-Shell 2.25 now uses an updated Win32 GCC, version 3.4.5.

thanks to Darkness (WIN_7 testing) i'm now reasonably convinced that it runs on all Windows from2000 up, although it has not been tested on Win 2008 yet ...

i've also finally succeeded in baking an ARM GCC 4.4.0, first tests show a reduction of ~ 4.7 kBin executable size (tested OK with 794 on ixus70_sd1000-101b & ixus870_sd880-101a)You can DL it here: http://drop.io/gcc_for_chdkshell as a selfextracting 7zip: gcc440forCHDK-sfx.exe(it will create a folder 'gcc440', which can replace or coexist with your current 'gcc4' folder)