Advertisement
rick78

Untitled

Nov 12th, 2012
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.73 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2. <installer-gui-script minSpecVersion="1">
  3. <options type="firmware" customize="never" hostArchitectures="i386" rootVolumeOnly="true"/>
  4. <title>SU_TITLE</title>
  5. <script>
  6. </script>
  7. <volume-check script="VolumeCheck()"/>
  8. <installation-check script="InstallationCheck()"/>
  9. <script>
  10. function InstallationCheck(prefix) {
  11. var models = ['MacBookPro8,1','MacBookPro8,2','MacBookPro8,3',];
  12. var model = system.sysctl('hw.model');
  13. if (models.indexOf(model) == -1) {
  14. my.result.message = system.localizedString('ERROR_1');
  15. my.result.type = 'Fatal';
  16. return false;
  17. }
  18. var versions = ['MBP81.88Z.0047.B00.1101231136','MBP81.88Z.0047.B04.1102071707','MBP81.88Z.0047.B0E.1104221557','MBP81.88Z.0047.B1E.1109091244','MBP81.88Z.0047.B22.1109281426','MBP81.88Z.0047.B24.1110141131','MBP81.88Z.0047.B26.1110311252',];
  19. var rom = system.ioregistry.fromPath('IODeviceTree:/rom@0');
  20. if (!rom || !(rom.version) || versions.indexOf(rom.version) == -1) {
  21. my.result.message = system.localizedString('ERROR_1');
  22. my.result.type = 'Fatal';
  23. return false;
  24. }
  25. if (system.compareVersions(system.version.ProductVersion, '10.6.8') &lt; 0) {
  26. my.result.message = system.localizedStringWithFormat('ERROR_0', '10.6.8');
  27. my.result.type = 'Fatal';
  28. return false;
  29. }
  30. my.result.message = system.localizedString('ERROR_1');
  31. if (!LogicalOr0("/")) {
  32. my.result.type = 'Fatal';
  33. return false;
  34. }
  35. return true;
  36. }
  37. function LogicalOr0(prefix) {
  38. if (LogicalAnd1(prefix) || PlistCheck4(prefix)) {
  39. return true;
  40. }
  41. return false;
  42. }
  43. function LogicalAnd1(prefix) {
  44. if (PlistCheck2(prefix) &amp;&amp; PlistCheck3(prefix)) {
  45. return true;
  46. }
  47. return false;
  48. }
  49. function PlistCheck2(prefix) {
  50. var plist = system.files.plistAtPath(prefix + '/System/Library/CoreServices/SystemVersion.plist');
  51. if (!plist) {
  52. return false;
  53. }
  54. var plistKeyValue = plist['ProductVersion'];
  55. if (!plistKeyValue) {
  56. return false;
  57. }
  58. if (system.compareVersions(plistKeyValue, '10.7') >= 0) {
  59. return false;
  60. }
  61. return true;
  62. }
  63. function PlistCheck3(prefix) {
  64. var plist = system.files.plistAtPath(prefix + '/System/Library/CoreServices/SystemVersion.plist');
  65. if (!plist) {
  66. return false;
  67. }
  68. var plistKeyValue = plist['ProductVersion'];
  69. if (!plistKeyValue) {
  70. return false;
  71. }
  72. if (system.compareVersions(plistKeyValue, '10.6.8') &lt; 0) {
  73. return false;
  74. }
  75. return true;
  76. }
  77. function PlistCheck4(prefix) {
  78. var plist = system.files.plistAtPath(prefix + '/System/Library/CoreServices/SystemVersion.plist');
  79. if (!plist) {
  80. return false;
  81. }
  82. var plistKeyValue = plist['ProductVersion'];
  83. if (!plistKeyValue) {
  84. return false;
  85. }
  86. if (system.compareVersions(plistKeyValue, '10.7.3') &lt; 0) {
  87. return false;
  88. }
  89. return true;
  90. }
  91. function VolumeCheck(prefix) {
  92. if (system.env.OS_INSTALL == 1) return true;
  93. var hasOS = system.files.fileExistsAtPath(my.target.mountpoint + "/System/Library/CoreServices/SystemVersion.plist");
  94. if (!hasOS || system.compareVersions(my.target.systemVersion.ProductVersion, '10.6.8') &lt; 0) {
  95. my.result.message = system.localizedStringWithFormat('ERROR_0', '10.6.8');
  96. my.result.type = 'Fatal';
  97. return false;
  98. }
  99. return true;
  100. }
  101. </script>
  102. <license file="License.rtf"/>
  103. <readme file="ReadMe.html"/>
  104. <choices-outline>
  105. <line choice="manual"/>
  106. </choices-outline>
  107. <choice id="manual" title="SU_TITLE">
  108. <pkg-ref id="MacBookProTwo" auth="Root" onConclusion="RequireRestart">#MacBookPro2011EFIUpdate.pkg</pkg-ref>
  109. </choice>
  110.  
  111. <pkg-ref id='MacBookProTwo' installKBytes='5435' version='2.7.0.0.1.1330468277'/>
  112.  
  113. <pkg-ref id='MacBookProTwo' installKBytes='5435' version='2.7.0.0.1.1330468277'/>
  114. </installer-gui-script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement