The present invention relates to processes for the preparation of a compound of formula (I) comprising reacting a compound of formula (IV) with a compound of formula III or (IIIA) in the presence of an acid; wherein R1 is C1-C4 haloalkyl; R2 is optionally substituted alkyl, optionally substituted aryl or optionally substituted heteroaryl; R3 is methyl or ethyl; R4 is hydrogen, optionally substituted alkyl, optionally substituted aryl or optionally substituted heteroaryl; and n is 0 or 1.