This means on a new machine, or one that never had the kext installed, you can't install their driver.
It used to be that pkg installers were just directories, and fixing something like this is easy: find the offending line and comment it out. But OS X 10.5 onwards introduced flat pkgs. These don't give up their secrets so easily.
An article on cnet tipped me off to pkgutil, a program that is installed by default. It lets you expand a flat pkg into a directory, and more importantly, allows to repackage it as a flat pkg after you have excised the cause of your troubles. This last step is important because a flat pkg when unpacked has a different directory structure to a "normal" pkg and thus can not simply be open'd.
Here is what I did to fix Ralink's installer:
- pkgutil --expand installer.pkg ~/Desktop/installer-expanded.pkg
- cd ~/Desktop/installer-expanded.pkg/installroot.pkg/Scripts/
- vim preinstall #alternatively, for ppl unfamilar with vim:
- open .
- right click on preinstall, open in TextEdit.app
- comment out the offending line which is trying to remove the kext
- save and exit your editor
- cd ~/Desktop
- pkgutil --flatten installer-expanded.pkg installer.pkg
- open ./installer.pkg