Is the Republican Party forced to support the winner of the presidential primary, or can they choose to support another candidate, for example because that candidate is more in line with the party's political ideals and/or is more likely to win the presidential election?
If a candidate wins 1237 or more delegates, then that candidate will become the Republican nominee. Delegates are bound through the first ballot and that would be enough for a win on the first ballot. However, there are two paths where the leader from the primaries might not be the "Republican supported candidate".
First, it's possible that no candidate will win 1237 delegates. In that case, the nomination will be decided at the convention and someone else could be the nominee. This hasn't happened in a Republican convention since 1948 (Democrats in 1952).
Second, it's possible that Republicans will run a third-party candidate in the general election. Republicans would then have the ability to vote for that candidate rather than the party nominee. Note that officially that candidate would not be a Republican but some other party. While that's never been done successfully, notable attempts at it include Theodore Roosevelt in 1912 and John B. Anderson in 1980.
Assuming that the candidates are bound by their pledge to support the eventual nominee, such a third-party candidate would have to come from outside the existing field. Mitt Romney would be the most likely candidate (existing network and support), although someone like John Thune is also possible.
Note that it would be rather controversial for someone other than the primary leader to be selected as the nominee and rather radical for a third party candidate to run that way. Also, in the latter case, there would be both a Republican nominee (presumably Trump) and an unofficial "Republican candidate".
It really depends what you mean by the "Republican Party". The voters and donors aren't pledged to support anyone in the general election. If Trump wins 1237 or more delegates, he will be listed on ballots as the Republican candidate and no one else will appear on ballots that way.
As has been noted elsewhere the convention (in principle) has the ability to hold a vote prior to the actual nomination to change the rules so that the selection system is changed to something else (a coin toss? a fist fight?) and the 1237 target no longer matters. I'm not sure how this would interact with state laws governing the selection and behaviour of delegates though.
The Republican Party cannot technically "be forced" to administer the rules of a private organization. Legislatures and courts historically only intervene to arbitrate disputes factional disputes over credentials, like notaries, ballot access, candidate eligibility or campaign finance. The Party rules which typically change more during quarterly standing rules committee meetings rather than conventions.To the extent the government does support or influence the primary process is by providing security, e.g. The hundreds of millions the Secret Service for specially designated conventions, or in most open primary states providing the places and ballots and counting. In caucuses however, parties are often a full-stack democracy if you will.
If a candidate receives 1237 delegates before the first ballot then most recently enacted set of rules currently in effect would make virtually impossible to take the nomination away. The reason being, individual states have different rules determined by their own committees or conventions, prior to their voting, which bound delegates to either the congressional, legislative, state primary results. Even states with at large delegates allocated outside of a representative model, e.g. For the state chair still typically bound those delegates on the first ballot. If a delegate attempts to break from their prescribed bounds they will be automatically de-delegated, often that means that your state loses a delegate rather than that actor alone being replaced by their alternate. The rules which govern delegates for whom their primary or controlling jurisdiction's candidate has suspended their campaign vary from defaulting to the next leading vote recipient to being unbound.
States which have already voted were forced during the calendar creation process to establish delegate allocation rules in order to ensure they complied with the new RNC rules which prescribed the carve out states IA -NV, the proportional only or winner-take-all prohibition window and all the rest.
It is possible that rule 40b, a peculiar outcome of the 2012 move to prevent Ron Paul supporters from simply having more than one candidate on the first ballot, and therefor not a unanimous first ballot victory from an optics perspective, could be revisited in the rules committee directly preceding the convention. That rule or other arbitrary variants creates other artificial thresholds for being placed on the ballot, e.g. Winning a majority of delegates in at least 8 states, which Ron Paul did not do, while having won a substantial number of delegates ex-post facto at state conventions. The committee could add additional goal posts, rather than moving the 1237 goal post. The problem is, it takes a bit of creative inspiration to conceive additional hurdles which the candidate whom holds a plurality could not meet more easily than the 2nd or 3rd place delegate holder or esp. an organic on the convention floor nominee could achieve.