For pyrylium salts with alkyl substituents such as 2,4,6-trimethylpyrylium salts, the best method uses the Balaban-Nenitzescu-Praill synthesis from tertiary butanol and acetic anhydride in the presence of tetrafluoroboric, perchloric, or trifluoromethanesulfonic acids.
Starting with aspartic acid β esters undergoing acylation to differentiate the first substituent, linked to carbon-2, followed by Dakin-West conversion to keto-amide to introduce the second substituent, and ending with the Robinson-Gabriel cyclodehydration at 90°C for 30 minutes with either phosphorus oxychloride in DMF or catalytic sulfuric acid in acetic anhydride.