Refactored winecfg function to not depend on a shell script.