Archive for October, 2007

Minimum DLL requirements for a visual c++ 2003 MFC app

Friday, October 5th, 2007

You’ll need:

mfc71.dll msvcr71.dll and msvcp71.dll

Here’s a snippet for your NSIS file as well if you need it:

Var ALREADY_INSTALLED

Section "Runtime support files"
;Add code here that sets $ALREADY_INSTALLED to a non-zero value if the application is already installed. For example:

IfFileExists "$INSTDIR\bin\tbn.exe" 0 new_installation ;Replace MyApp.exe with your application filename
StrCpy $ALREADY_INSTALLED 1
new_installation:
!insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_NOTPROTECTED "c:\windows\system32\mfc71.dll" "$SYSDIR\mfc71.dll" "$SYSDIR"
!insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_NOTPROTECTED "c:\windows\system32\msvcr71.dll" "$SYSDIR\msvcr71.dll" "$SYSDIR"
!insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_NOTPROTECTED "c:\windows\system32\msvcp71.dll" "$SYSDIR\msvcp71.dll" "$SYSDIR"
SectionEnd

QEMU: To think we used to do this crap over and over and over…

Thursday, October 4th, 2007

Where was virtualisation 11 years ago when we used to have to format in reinstall Pentium 100’s over and over and over again every time we needed to fresh test new installations? We thought we were pretty clever when we started to use Norton Ghost and make images of disks. Whilst better, especially when multiple service packs needed to be applied, it still required swapping drives in an out of machines and a fair bit of time re-ghosting drives.

QEMU and their ilk beats the crap out of that.

I now have on my harddisk, installed from an original XP CD, several copies of a virtual windows drive all ready to go.

ss.jpg

When I want to try a new install, I just make a copy of one of my saved images, load her up and I’m good to go.

Wow.

There are a lot of options out there from a variety of vendors, but QEMU seemed like a fit for ubuntu.

QEMU can run with or without a kernel accellerator. I installed XP on the image without too much trouble (took about 40 minutes on a 3.4Ghz Celeron D with 1Gb RAM) and it booted ok. I then installed the KQEMU kernel accelerator (as per the instructions below) and its resulted in a very usable test system. Networking worked out of the box! Browsed the web straight away and after joining my workgroup - network neighbourhood worked just fine as well.

The instructions at: https://help.ubuntu.com/community/WindowsXPUnderQemuHowTo were pretty well spot on. Just an additional chmod to make the /dev/kqemu 0666 was all that was required to remove the complaint about not being able to access the accelerator at boot time.

Very, very, very handy.

NSIS registry keys with front slashes

Thursday, October 4th, 2007

Nullsoft’s installer is really good. Seems a lot more sensible than InstallShield (Granted I haven’t used InstallShield in anger for 7 + years - but christ it used to suck maybe its better now?).

Here’s how to save directories in the registry with front slashes. Handy for saving local urls based on where the application is put (so you end up with file:///C:/program files/myprog/content/page.htmlrather than file:///c:\program files\myprog/content/page.html) or just to have visual c++ talk in front slashes rather than double backslahes in your code.

1. Import the Word replace macro - put it with the other ones at the top of your nsi file.

!include "WordFunc.nsh"

!insertmacro WordReplace

2. Create yourself a variable say UNIXINSTDIR to use instead of INSTDIR

Var /GLOBAL UNIXINSTDIR

3. Find and replace the slashes in $INSTDIR and output it to UNIXINSTDIR

${WordReplace} "$INSTDIR" "\" "/" "+" $UNIXINSTDIR

4. Use$UNIXINSTDIR in place of $INSTDIR

libcurl and visual c++

Tuesday, October 2nd, 2007

http://curl.haxx.se/libcurl/c/visual_studio.pdf