The Jacobite rising of 1745, also known as the Forty-five Rebellion or simply the '45'  was an attempt by Charles Edward Stuart to regain the British throne for his father, James Francis Edward Stuart, and the House of Stuart. The rising took place during the War of the Austrian Succession, when the bulk of the British Army was in Europe, and was the last in a series of revolts that began in 1689 and continued in 1708, 1715 and 1719. Charles launched the rising on 19 August 1745 at Glenfinnan in the Scottish Highlands, capturing Edinburgh and winning the Battle of Prestonpans in September. The Jacobite army invaded England in early November, reaching Derby on 4 December, where they were forced to retreat by a lack of expected English support, by superior numbers of government forces, and by differences in opinion amongst the Jacobite command. Despite victory at Falkirk Muir in January 1746, the Battle of Culloden in April ended the Rebellion and significant backing for the Stuart cause. Charles escaped to France but was unable to win support for another attempt and died in Rome in 1788.
Question: Which happened first, the capture of Edinburgh or the invasion of England by the Jacobite army?
Answer: capturing Edinburgh