According to biographer Bernard Fay, Louis made the Vow under the guidance of his non-juring confessor, a Eudist priest Fr. Hebert. In the 1600's a Visitation nun, Saint Margaret Mary, had claimed that Jesus had requested that the King of France consecrate France to His Sacred Heart. The consecration had never been performed. So, with the help of Fr. Hebert, Louis drafted the following Vow, which he sealed in the walls of his apartments.
The Vow was not found until the palace had been partially burned by the Commune and was being torn down in 1871. It was discovered still sealed in the wall of the king's room. Louis was a locksmith and was fascinated with construction, so building a hiding place for his papers would not have been beyond him. He was known for his penchant for secrecy and his hiding of private papers from prying eyes. The fact that the Vow was not discovered until the 1870's demolishes the claim of some that it was merely a product of pious forgery during the 1814-1830 Restoration. The methodical legality of the document is typical of Louis XVI, who as an amateur cartographer was characterized by his precision and attention to detail. I found the Vow on this site; the translation is a bit rough because it is mine, with some help from Google.
Dedication of France to the Sacred Heart of Jesus by King Louis XVI
You see, ô my God! all the wounds which tear my heart, and depth of the abyss into which I have fallen. Evils without number surround me on all sides. My personal misfortunes and those of my family, which are dreadful, overwhelm my heart, as well as those which cover the face of the kingdom. The cries of all the unfortunate ones, the moaning of oppressed religion resounds in my ears, and an interior voice still informs me that perhaps Your justice reproaches me with all these calamities, because, in the days of my power, I did not repress the license of the people and the irreligion, which are the principal sources; because I served the weapons of heresy which triumphed, by supporting it by laws which doubled its forces and gave it the audacity to dare all.
I will not have temerity, ô my God! to justify to myself before You; but You know that my heart was always subject to faith and morals; my faults are the fruit of my weakness and seem worthy of Your great mercy. You forgave King David, who caused your enemies to blaspheme You and King Manassès, who had involved his people in the idolatry. Disarmed by their penitence, you restored them one and the other on the throne of Juda; you made them reign with peace and glory. Would You be inexorable today towards a son of Saint Louis, who takes these penitent kings for models, and which, with their example, wishes to repair his faults and to become a King according to Your Heart?
O Jesus-Christ! divine Redeemer of all our iniquities, it is in Your Adorable Heart that I want to deposit the overflowing of my afflicted heart. I call upon the help of the tender Heart of Mary, my majestic protector and my mother, and the assistance of Saint Louis, my most famous patron and of my ancestor. O adorable Heart, by the so pure hands of my powerful intercessors, receive with kindness the wishes that confidence inspires in me and that I offer to You like the humble expression of my feelings. If, by an effect of the infinite kindness of God, I recover my freedom, my crown and my royal power, I promise solemnly:
1. To revoke as soon as possible all the laws which will be indicated to me, either by the Pope, or by a Council, or by the four Bishops chosen among most enlightened and most virtuous of my kingdom, with the purity and the integrity of the faith, the discipline and the spiritual jurisdiction of Holy Catholic, Apostolic Church, Roman, and in particular to revoke the Civil Constitution of the Clergy.
2. To take, in a one year interval, in union with the Pope and the Bishops of my kingdom, all measurements necessary to establish, according to the canonical forms, a solemn festival in honor of the Sacred Heart of Jesus, which will be celebrated in perpetuity in all France, on the first Friday after the octave of the Blessed Sacrament, and always followed by a general procession, in repair of the insults and profanations made in the time of the disorders, by the schismatics, the heretics and the bad Christians.
3. To go myself in person, within three months from the day of my delivery, to the church of Notre-Dame of Paris, or in any other principal church of the place where I will be, and to pronounce, one day of Sunday or festival, at the foot of the high altar, after the offertory of the Mass, and between the hands of the celebrant, a solemn act of dedication of my person, my family and my kingdom to the Sacred Heart of Jesus, promising to give to all my subjects, the example of the worship and the devotion which are due to this adorable Heart.
4. To set up and to decorate at my own expense, in the church which I will choose for it, within one year from the day of my delivery, an altar which will be dedicated to the Sacred Heart of Jesus, and which will be used as an eternal monument of my recognition and my confidence without end in the infinite merits and in the inexhaustible treasures of grace which are contained in this Crowned Heart.
5. Finally, to renew every year, in the place where I will be, on the Feast of the Sacred Heart, the act of dedication expressed in the third article, and to attend the general procession which will follow the Mass of this day. Today I pronounce only in secrecy this promise, but I would sign it my blood if it were needed; and the most beautiful day of my life will be that where I will be able to aloud publish it in the temple. O Adorable Heart of my Savior! Let my right hand be forgotten and let me curse myself, if I forget Your blessings and my promises, if I cease to love You, finding my confidence in You and all of my consolation. Amen.