Such injunction may be issued on the complaint of the attorney general in behalf of the state, or of any creditor or stockholder of the corporation. When it issues against a bank for any violation of its charter, on complaint of a creditor, the court shall proceed to final judgment, and, if the proof be sufficient, adjudge a forfeiture, notwithstanding such creditor may settle with the corporation and relinquish a claim against it. In such cases the attorney general or a creditor may appear and prosecute the action, which shall not be discontinued if either of them so appears and prosecutes the same. At any stage of the proceedings the court may appoint one or more receivers to take charge of the property and effects of such corporation. If the injunction be upon application of a creditor of a corporation whose directors or stockholders are liable by law for the payment of such debts in any event or contingency, such directors or stockholders, or any of them, may be made parties to the action, either at the time of filing the complaint or at any subsequent time when it becomes necessary to enforce such liability.