Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

149 lines
6.3 KiB

  1. if (!$__SPGBUILDPM ) { use spg::build; }
  2. sub BuildMSI($)
  3. {
  4. # ** msm/msi files to be built by devenv
  5. # localConfigFileDir is prepended w/ $SAPIROOT\msi (or msi dir, whatever that is)
  6. # localConfigFileDir => cfgFName => localMSIFile/localMSMFile => remoteTargetFile
  7. local (@lMSIs) =
  8. (
  9. # RELEASE:
  10. "release\\1033\\Sp5 => Sp5 => Output\\Sp5.msm => ".$sDropDir."\\release\\msm\\".PROC."\\1033\\Sp5.msm",
  11. "release\\1033\\Sp5Intl => Sp5Intl => Output\\Sp5Intl.msm => ".$sDropDir."\\release\\msm\\".PROC."\\1033\\Sp5Intl.msm",
  12. "release\\1033\\Sp5SR => Sp5SR => Output\\Sp5SR.msm => ".$sDropDir."\\release\\msm\\".PROC."\\1033\\Sp5SR.msm",
  13. "release\\1033\\Sp5Itn => Sp5Itn => Output\\Sp5Itn.msm => ".$sDropDir."\\release\\msm\\".PROC."\\1033\\Sp5Itn.msm",
  14. "release\\1041\\Sp5Itn => Sp5Itn => Output\\Sp5Itn.msm => ".$sDropDir."\\release\\msm\\".PROC."\\1041\\Sp5Itn.msm",
  15. "release\\1033\\Sp5CCInt => Sp5CCInt => Output\\Sp5CCInt.msm => ".$sDropDir."\\release\\msm\\".PROC."\\1033\\Sp5CCInt.msm",
  16. "release\\1041\\Sp5CCInt => Sp5CCInt => Output\\Sp5CCInt.msm => ".$sDropDir."\\release\\msm\\".PROC."\\1041\\Sp5CCInt.msm",
  17. "release\\2052\\Sp5CCInt => Sp5CCInt => Output\\Sp5CCInt.msm => ".$sDropDir."\\release\\msm\\".PROC."\\2052\\Sp5CCInt.msm",
  18. "release\\1033\\Sp5DCInt => Sp5DCInt => Output\\Sp5DCInt.msm => ".$sDropDir."\\release\\msm\\".PROC."\\1033\\Sp5DCInt.msm",
  19. "release\\1041\\Sp5DCInt => Sp5DCInt => Output\\Sp5DCInt.msm => ".$sDropDir."\\release\\msm\\".PROC."\\1041\\Sp5DCInt.msm",
  20. "release\\2052\\Sp5DCInt => Sp5DCInt => Output\\Sp5DCInt.msm => ".$sDropDir."\\release\\msm\\".PROC."\\2052\\Sp5DCInt.msm",
  21. "release\\1033\\Sp5TTInt => Sp5TTInt => Output\\Sp5TTInt.msm => ".$sDropDir."\\release\\msm\\".PROC."\\1033\\Sp5TTInt.msm",
  22. "release\\SDK => sp5SDK => Output\\disk_1\\SP5SDK.msi => ".$sDropDir."\\release\\msi\\".PROC."\\SP5SDK.msi",
  23. # DEBUG:
  24. "debug\\1033\\Sp5 => Sp5 => Output\\Sp5.msm => ".$sDropDir."\\debug\\msm\\".PROC."\\1033\\Sp5.msm",
  25. "debug\\1033\\Sp5Intl => Sp5Intl => Output\\Sp5Intl.msm => ".$sDropDir."\\debug\\msm\\".PROC."\\1033\\Sp5Intl.msm",
  26. "debug\\1033\\Sp5SR => Sp5SR => Output\\Sp5SR.msm => ".$sDropDir."\\debug\\msm\\".PROC."\\1033\\Sp5SR.msm",
  27. "debug\\1033\\Sp5Itn => Sp5Itn => Output\\Sp5Itn.msm =>".$sDropDir."\\debug\\msm\\".PROC."\\1033\\Sp5Itn.msm",
  28. "debug\\1041\\Sp5Itn => Sp5Itn => Output\\Sp5Itn.msm =>".$sDropDir."\\debug\\msm\\".PROC."\\1041\\Sp5Itn.msm",
  29. "debug\\1033\\Sp5TTInt => Sp5TTInt => Output\\Sp5TTInt.msm => ".$sDropDir."\\debug\\msm\\".PROC."\\1033\\Sp5TTInt.msm",
  30. "debug\\SDK => sp5SDK => Output\\disk_1\\SP5SDK.msi => ".$sDropDir."\\debug\\msi\\".PROC."\\SP5SDK.msi",
  31. );
  32. # ** files not requiring separate build command
  33. # files are copied only if dir exists
  34. # localFile => remoteTargetFile
  35. local (@lMiscMSIFiles) =
  36. (
  37. # RELEASE:
  38. $sMSIDir."\\release\\SDK\\Output\\DISK_1\\setup.exe => ".$sDropDir."\\release\\msi\\".PROC."\\setup.exe",
  39. $sMSIDir."\\release\\SDK\\Output\\DISK_1\\setup.ini => ".$sDropDir."\\release\\msi\\".PROC."\\setup.ini",
  40. $sMSIDir."\\release\\SDK\\Output\\DISK_1\\instmsia.exe => ".$sDropDir."\\release\\msi\\".PROC."\\instmsia.exe",
  41. $sMSIDir."\\release\\SDK\\Output\\DISK_1\\instmsiw.exe => ".$sDropDir."\\release\\msi\\".PROC."\\instmsiw.exe",
  42. $SAPIROOT."\\build\\release\\readme.txt => ".$sDropDir."\\release\\msm\\".PROC."\\readme.txt",
  43. # DEBUG:
  44. $sMSIDir."\\debug\\SDK\\Output\\DISK_1\\setup.exe => ".$sDropDir."\\debug\\msi\\".PROC."\\setup.exe",
  45. $sMSIDir."\\debug\\SDK\\Output\\DISK_1\\setup.ini => ".$sDropDir."\\debug\\msi\\".PROC."\\setup.ini",
  46. $sMSIDir."\\debug\\SDK\\Output\\DISK_1\\instmsia.exe => ".$sDropDir."\\debug\\msi\\".PROC."\\instmsia.exe",
  47. $sMSIDir."\\debug\\SDK\\Output\\DISK_1\\instmsiw.exe => ".$sDropDir."\\debug\\msi\\".PROC."\\instmsiw.exe",
  48. $SAPIROOT."\\build\\debug\\readme.txt => ".$sDropDir."\\debug\\msm\\".PROC."\\readme.txt",
  49. );
  50. if ($sShortBuildName eq "BuildMSIExtWrap")
  51. {
  52. $sBuildLog = $SAPIROOT."\\logs\\buildmsilog.html";
  53. $fhBuildLog = OpenFile($sBuildLog, "write");
  54. }
  55. local($sTargetDir) = $_[0];
  56. my($rc) = 1;
  57. PushD($SAPIROOT);
  58. PrintL("\nBuilding SAPI 5 MSI packages\n\n", PL_SUBHEADER);
  59. Delnode($sTargetDir);
  60. EchoedMkdir($sTargetDir);
  61. PushD($sTargetDir);
  62. foreach $elem (@lMSIs)
  63. {
  64. my($sConfigFileDir, $sConfigFile, $sMSIFile, $sDestFile) = split(/\s*=>\s*/, $elem, 4);
  65. my($sMSIName) = "";
  66. ++$nTotalMSIs;
  67. EchoedMkdir("\"".$sConfigFileDir."\"");
  68. PushD($sConfigFileDir);
  69. EchoedCopy($SAPIROOT."\\build\\".$sConfigFileDir."\\".$sConfigFile.".wip", cwd()."\\".$sConfigFile.".wip");
  70. PrintL("\n - Building '".$sConfigFile."'\n", PL_BLUE);
  71. EchoedMkdir(GetPath($sDestFile));
  72. if (Execute($cmdDevEnv." /make \"".$sConfigFile.".wip\" /out \"".$sConfigFile.".log\""))
  73. {
  74. PrintL("'".$sConfigFile."' Build Successful\n", PL_MSG | PL_GREEN);
  75. if (-e $sConfigFile.".log")
  76. {
  77. PrintL(GetAllTextFromFile($sConfigFile.".log"));
  78. }
  79. if (!$bNoCopy && ($sMSIFile ne "") && ($sDestFile ne ""))
  80. {
  81. EchoedCopy($sMSIFile, $sDestFile);
  82. }
  83. }
  84. else
  85. {
  86. PrintL("'".$sConfigFile."' Build FAILED\n", PL_BIGERROR);
  87. if (-e $sConfigFile.".log")
  88. {
  89. my($str) = GetAllTextFromFile($sConfigFile.".log");
  90. PrintMsgBlock($str);
  91. PrintL($str);
  92. }
  93. ++$nFailedMSIs;
  94. $rc = 0;
  95. }
  96. PopD(); #$sConfigFileDir
  97. }
  98. if (!$bNoCopy)
  99. {
  100. foreach $file (@lMiscMSIFiles)
  101. {
  102. my ($sSrc, $sTgt) = split(/\s*=>\s*/, $file, 2);
  103. if (IsDirectory(GetPath($sTgt)))
  104. {
  105. EchoedCopy($sSrc, $sTgt);
  106. }
  107. }
  108. }
  109. PopD(); #$sTargetDir
  110. PopD(); #$SAPIROOT
  111. if ($sShortBuildName eq "BuildMSIExtWrap")
  112. {
  113. CloseFile($fhBuildLog);
  114. Execute($sBuildLog);
  115. }
  116. return($rc);
  117. }
  118. $__BUILDMSIPM = 1;
  119. 1;