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.

710 lines
19 KiB

  1. #################################################################################
  2. #
  3. # Script: muimsi.pm
  4. #
  5. # (c) 2000 Microsoft Corporation. All rights reserved.
  6. #
  7. # Purpose: This script creates the msi package
  8. #
  9. # Version: 1.00 (06/27/2001) : (lguindon) Created
  10. #
  11. ##################################################################################
  12. # Set Package
  13. package muimsi;
  14. # Set the script name
  15. $ENV{script_name} = 'muimsi.pm';
  16. $cmdPrompt = 0;
  17. # Set version
  18. $VERSION = '1.00';
  19. # Set required perl version
  20. require 5.003;
  21. # Use section
  22. use lib $ENV{ "RazzleToolPath" };
  23. use lib $ENV{ "RazzleToolPath" } . "\\PostBuildScripts";
  24. use GetParams;
  25. use LocalEnvEx;
  26. use Logmsg;
  27. use strict;
  28. no strict 'vars';
  29. use HashText;
  30. use ParseTable;
  31. use File::Copy;
  32. use File::Find;
  33. use Cwd;
  34. use DirHandle;
  35. # Require Section
  36. require Exporter;
  37. # Global variable section
  38. ##################################################################################
  39. #
  40. # Main entry point.
  41. #
  42. ##################################################################################
  43. sub Main
  44. {
  45. # Check environment variables
  46. if (!&VerifyEnvironment())
  47. {
  48. # wrnmsg ("The environment is not correct for MSI Package build.");
  49. # return 1;
  50. errmsg ("The environment is not correct for MSI Package build.");
  51. return 0;
  52. }
  53. elsif (!($ENV{_BuildArch} =~/x86/i))
  54. {
  55. logmsg ("Skip non-x86 build environment");
  56. return 1;
  57. }
  58. # Get language's LCID and ISO code
  59. if (!&GetCodes())
  60. {
  61. errmsg ("The language's LCID and ISO code could not be extracted from the CODEFILE.");
  62. return 0;
  63. }
  64. # Define some constants
  65. if (!&DefineConstants())
  66. {
  67. errmsg ("Constants could not be defined.");
  68. return 0;
  69. }
  70. # Make sure directories exist
  71. if (!&CheckDirs())
  72. {
  73. errmsg ("The required directorys do not exist.");
  74. return 0;
  75. }
  76. # Search for current build number
  77. if (!&LookForBuildNumber())
  78. {
  79. errmsg ("No build number information found.");
  80. }
  81. # Generate file contents files
  82. if (!&FileContents())
  83. {
  84. errmsg ("File contents couldn't be created.");
  85. }
  86. # Generate custom action files
  87. if (!&CustomAction())
  88. {
  89. errmsg ("Error with Custom Action script.");
  90. }
  91. # Apply XMLVAR to the template
  92. if (!&XMLVAR())
  93. {
  94. errmsg ("Error with XMLVAR script.");
  95. }
  96. # Make MSI package
  97. if (!&MakeMSI())
  98. {
  99. errmsg ("Error making the MSI Package.");
  100. }
  101. } # Main
  102. ##################################################################################
  103. #
  104. # VerifyEnvironment()
  105. #
  106. # Validates necessary environment variables.
  107. #
  108. ##################################################################################
  109. sub VerifyEnvironment
  110. {
  111. logmsg ("Validating the environment.");
  112. $RAZZLETOOLPATH=$ENV{RazzleToolPath};
  113. $_NTPOSTBLD=$ENV{_NTPOSTBLD};
  114. logmsg("------- RAZZLETOOLPATH is $RAZZLETOOLPATH");
  115. logmsg("------- _NTPOSBLD is $_NTPOSTBLD");
  116. if ($LANG=~/psu_(.*)/i)
  117. {
  118. $Special_Lang=$1;
  119. }
  120. elsif ($LANG=~/psu/i || $LANG=~/mir/i )
  121. {
  122. if (defined( $ENV{"LANG_MUI"} ) )
  123. {
  124. $Special_Lang=$ENV{"LANG_MUI"};
  125. }
  126. elsif ($LANG=~/psu/i)
  127. {
  128. $Special_Lang="ro";
  129. }
  130. else
  131. {
  132. $Special_Lang="ara";
  133. }
  134. }
  135. else
  136. {
  137. $Special_Lang=$LANG;
  138. }
  139. logmsg ("------- special lang is $Special_Lang");
  140. $PROCESSOR=$ENV{PROCESSOR};
  141. if ($ENV{_BuildArch} =~/x86/i)
  142. {
  143. $_BuildArch="i386";
  144. }
  145. else
  146. {
  147. $_BuildArch=$ENV{_BuildArch};
  148. }
  149. $LOGS=$ENV{temp};
  150. logmsg("------- Build architecture is $_BuildArch");
  151. logmsg("------- LOGS is $LOGS");
  152. if ($ENV{_BuildType} =~ /^chk$/i)
  153. {
  154. wrnmsg ("This does not run on chk machines");
  155. return 0;
  156. }
  157. if(defined($SAFEMODE=$ENV{SAFEMODE}))
  158. {
  159. logmsg ("SAFEMODE is ON");
  160. }
  161. logmsg ("Success: Validating the environment.");
  162. return 1;
  163. } # VerifyEnvironment
  164. ##################################################################################
  165. #
  166. # DefineConstants()
  167. #
  168. # Defines global constants.
  169. #
  170. ##################################################################################
  171. sub DefineConstants
  172. {
  173. logmsg ("Definition of global constants.");
  174. # Directories
  175. # $LOCBINDIR = "d:\\"; // removed hardcoded path
  176. # $MUIDIR = "d:\\mui"; // removed hardcoded path
  177. $LOCBINDIR = "$_NTPOSTBLD";
  178. $MUIDIR = "$LOCBINDIR\\mui";
  179. $MSIDIR = "$MUIDIR\\MSI";
  180. $CONTROLDIR = "$MUIDIR\\control";
  181. $SOURCEDIR = "$MUIDIR\\$Special_Lang\\$_BuildArch.uncomp";
  182. $DESTDIR = "$MUIDIR\\release\\$_BuildArch\\MSI";
  183. $TMPBUILD = "$MUIDIR\\$Special_Lang\\tmp";
  184. logmsg("------- LOCBINDIR is $LOCBINDIR");
  185. logmsg("------- MUIDIR is $MUIDIR");
  186. logmsg("------- MSIDIR is $MSIDIR");
  187. logmsg("------- CONTROLDIR is $CONTROLDIR");
  188. logmsg("------- SOURCEDIR is $SOURCEDIR");
  189. logmsg("------- DESTDIR is $DESTDIR");
  190. logmsg("------- TMPBUILD is $TMPBUILD");
  191. # Filenames
  192. # $TEMPLATE = "$CONTROLDIR\\muimsi_template.wim"; // removed hardcoded path
  193. # $WISCHEMA = "$CONTROLDIR\\WiSchema.xml";
  194. $TEMPLATE = "$MSIDIR\\muimsi_template.wim";
  195. $MUIMSIXML = "$TMPBUILD\\$LCID_SHORT.wim";
  196. $MUIMSIWIX = "$TMPBUILD\\$LCID_SHORT.msi";
  197. $MUIMSI = "$DESTDIR\\$LCID_SHORT.msi";;
  198. $FILECNT_CORE = "$TMPBUILD\\FileContent_CORE.wxm";
  199. $FILECNT_PRO = "$TMPBUILD\\FileContent_PRO.wxm";
  200. $FILECNT_SRV = "$TMPBUILD\\FileContent_SRV.wxm";
  201. $FILELST_CORE = "$TMPBUILD\\FileContent_CORE.msm";
  202. $FILELST_PRO = "$TMPBUILD\\FileContent_PRO.msm";
  203. $FILELST_SRV = "$TMPBUILD\\FileContent_SRV.msm";
  204. $CUSTACTION = "$CONTROLDIR\\Custom_action.wxm";
  205. $CUSTACTIONCOMP = "$CONTROLDIR\\Custom_action.msm";
  206. $MSIPACKAGE = "$DESTDIR\\$Special_Lang.msi";
  207. $WISCHEMA = "$MSIDIR\\WiSchema.xml";
  208. # Applications
  209. # $INFPARSER = "c:\\document\\work\\infparser\\debug\\infparser.exe"; // removed hardcoded paths
  210. # $CANDLE = "e:\\wix\\src\\candle\\candle.wsf"; // removed hardcoded paths
  211. # $LIGHT = "e:\\wix\\src\\light\\light.wsf"; // removed hardcoded paths
  212. # $XMLVAR = "$RAZZLETOOLPATH\\x86\\perl\\bin\\perl.exe d:\\mui\\control\\xmlvar.bat"; // removed hardcoded paths
  213. $INFPARSER = "infparser.exe";
  214. $CANDLE = "CScript.exe $MSIDIR\\candle.wsf";
  215. $LIGHT = "CScript.exe $MSIDIR\\light.wsf";
  216. $XMLVAR = "perl.exe $MSIDIR\\xmlvar.bat";
  217. # Flavor
  218. if($_BuildArch =~ /i386/i)
  219. {
  220. $FLAVOR = "32";
  221. }
  222. elsif ($_BuildArch =~ /ia64/i)
  223. {
  224. $FLAVOR = "64";
  225. }
  226. logmsg("------- FLAVOR is $FLAVOR");
  227. # GUID - read the language guid off the language-guid file, if it's not there
  228. # generate one and put it in the file.
  229. $GUIDFILE = "$MSIDIR\\guidlang.txt";
  230. logmsg ("Get the language's MSI package ID from $GUIDFILE.");
  231. my(@langguids, @newcontent);
  232. # Search GUIDFILE for $Special_Lang and the associated MSI package guid
  233. if(!open(GUIDFILE, "$GUIDFILE"))
  234. {
  235. errmsg ("Can't open language guid file $GUIDFILE for reading.");
  236. return 0;
  237. }
  238. GUID_LOOP: while (<GUIDFILE>)
  239. {
  240. # add the file content to an array, in case we need to append additional data
  241. # push(@newcontent, $_);
  242. if (/^$Special_Lang\s+/i)
  243. {
  244. @langguids = split(/\s+/,$_);
  245. $MSIGUID = $langguids[1]; # 2nd field should be the language guid
  246. last GUID_LOOP; # exit out of the loop if found
  247. }
  248. }
  249. close(GUIDFILE);
  250. # if the language is not found, add a new guid entry into GUIDFILE
  251. if(!@langguids)
  252. {
  253. logmsg ("$Special_Lang is not found in $GUIDFILE, adding an entry for it.");
  254. ($MSIGUID) = `uuidgen`;
  255. chomp $MSIGUID;
  256. $MSIGUID =~ tr/a-z/A-Z/;
  257. # $GUIDENTRY = "\n".$Special_Lang." ".$MSIGUID;
  258. # push(@newcontent, $GUIDENTRY);
  259. # if(!open(GUIDFILE, ">$GUIDFILE")) {
  260. # errmsg ("Cannot open $GUIDFILE for writing.");
  261. # return 0;
  262. # }
  263. # print GUIDFILE @newcontent;
  264. # close(GUIDFILE);
  265. }
  266. logmsg("------- MSIGUID is $MSIGUID");
  267. # Other GUIDs
  268. $UPGRADEGUID = "177146D4-5102-4BD9-98A0-114A3ED39076";
  269. $CONTENTGUID = "1AFE112F-290F-4A94-2000-AB4D3FD8B102";
  270. # MSI version number
  271. my ($src, $isdst);
  272. ($src, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime;
  273. eval $hour;
  274. eval $min;
  275. eval $yday;
  276. eval $wday;
  277. $VERSIONNUMBER = 100*(12*($year-101)+$mon+1)+$mday;
  278. logmsg("------- VERSIONNUMBER is $VERSIONNUMBER");
  279. # Package name
  280. $PACKAGENAME = "muiMSITemplate ($VERSIONNUMBER)";
  281. logmsg("------- PACKAGENAME is $PACKAGENAME");
  282. logmsg ("Success: Definition of global constants.");
  283. $BuildChecksum=1;
  284. return 1;
  285. } # DefineConstants
  286. ##################################################################################
  287. #
  288. # GetCodes
  289. #
  290. # Gets the language's LCID and ISO language code from CODEFILE.
  291. #
  292. ##################################################################################
  293. sub GetCodes
  294. {
  295. #set the code file name to read
  296. $CODEFILE = "$RAZZLETOOLPATH\\codes.txt";
  297. logmsg ("Get the language's LCID and ISO language code from $CODEFILE.");
  298. my(@data);
  299. # Don't allow nec_98 or CHT to be processed!
  300. if($Special_Lang =~ /^(NEC_98|CHT)$/i)
  301. {
  302. logmsg ("No MUI available for $Special_Lang");
  303. exit 0;
  304. }
  305. # Search CODEFILE for $Special_Lang, $LCID, $LANG_ISO, etc.
  306. if(!open(CODEFILE, "$CODEFILE"))
  307. {
  308. errmsg ("Can't open lcid file $CODEFILE for reading.");
  309. return 0;
  310. }
  311. CODES_LOOP: while (<CODEFILE>)
  312. {
  313. if (/^$Special_Lang\s+/i)
  314. {
  315. @data = split(/\s+/,$_);
  316. last CODES_LOOP;
  317. }
  318. }
  319. close(CODEFILE);
  320. if(!@data)
  321. {
  322. logmsg ("$Special_Lang is an unknown language");
  323. &Usage;
  324. return 0;
  325. }
  326. $LCID = $data[2];
  327. $LCID_SHORT = $LCID;
  328. $LCID_SHORT =~ s/^0x//;
  329. $LANG_ISO = $data[8];
  330. $GUID = $data[11];
  331. #extract the language description - this is the concatenated strings of element 13 to the last element in the array
  332. $LANG_NAME = $data[13];
  333. for ($i = 14; $i <= $#data; $i++)
  334. {
  335. $LANG_NAME = "$LANG_NAME $data[$i]";
  336. }
  337. logmsg ("Success: Get the language's LCID and ISO language code frrm $CODEFILE.");
  338. logmsg("------- LCID is $LCID");
  339. logmsg("------- LCID_SHORT is $LCID_SHORT");
  340. logmsg("------- LANG_ISO is $LANG_ISO");
  341. logmsg("------- GUID is $GUID");
  342. logmsg("------- LANG_NAME is $LANG_NAME");
  343. return 1;
  344. } # GetCodes
  345. ##################################################################################
  346. #
  347. # CheckDirs
  348. #
  349. # Makes sure that the necessary directories exist.
  350. #
  351. ##################################################################################
  352. sub CheckDirs
  353. {
  354. logmsg ("Make sure the necessary directories exist.");
  355. my($status);
  356. # Make sure the source directories exist
  357. foreach ($LOCBINDIR,$MUIDIR,$CONTROLDIR,$SOURCEDIR,$MSIDIR)
  358. {
  359. if(! -e $_)
  360. {
  361. logmsg ("$0: ERROR: $_ does not exist");
  362. return 0;
  363. }
  364. }
  365. # Make sure destination directories exist
  366. foreach ($DESTDIR,$TMPBUILD)
  367. {
  368. if(! -e $_)
  369. {
  370. $status = system("md $_");
  371. if($status)
  372. {
  373. logmsg ("$0: ERROR: cannot create $_");
  374. return 0;
  375. }
  376. }
  377. }
  378. logmsg ("del /q /f $TMPBUILD\\*.*");
  379. `del /q /f $TMPBUILD\\*.*`;
  380. logmsg ("Success: Make sure the necessary directories exist.");
  381. return 1;
  382. } # CheckDirs
  383. ##################################################################################
  384. #
  385. # LookForBuildNumber
  386. #
  387. # Scan build log for the build number.
  388. #
  389. ##################################################################################
  390. sub LookForBuildNumber
  391. {
  392. logmsg ("Update mui.inf with the current build number.");
  393. # Get current build number
  394. $LOGS="$_NTPOSTBLD\\build_logs";
  395. my $filename="$LOGS\\buildname.txt";
  396. open (BUILDNAME, "< $filename") or die "Can't open $filename for reading: $!\n";
  397. while (<BUILDNAME>)
  398. {
  399. $BLDNO = $_;
  400. $BLDNO =~ s/\.[\w\W]*//i;
  401. }
  402. close BUILDNAME;
  403. if ($BLDNO =~ /(^\d+)-*\d*$/) {
  404. $BLDNO = $1;
  405. }
  406. else
  407. {
  408. errmsg ("Errorin LookForBuildNumber: BLDNO is $BLDNO");
  409. return 0;
  410. }
  411. chomp($BLDNO);
  412. logmsg("------- BLDNO is $BLDNO");
  413. logmsg ("Success: Update mui.inf with the current build number.");
  414. return 1;
  415. } # LookForBuildNumber
  416. ##################################################################################
  417. #
  418. # FileContents()
  419. #
  420. # Generate different flavor of filecontents.wxm.
  421. #
  422. ##################################################################################
  423. sub FileContents
  424. {
  425. logmsg ("Generate MSI file contents.");
  426. # Generate core file content
  427. logmsg ("Generate MSI Core content.");
  428. logmsg ("$INFPARSER /b:$FLAVOR /l:$Special_Lang /f:c /s:$MUIDIR /o:$FILECNT_CORE");
  429. `$INFPARSER /b:$FLAVOR /l:$Special_Lang /f:c /s:$MUIDIR /o:$FILECNT_CORE`;
  430. # Compile core file content
  431. logmsg ("Compile MSI Core content.");
  432. logmsg ("$CANDLE -c $FILELST_CORE $FILECNT_CORE");
  433. `$CANDLE -c $FILELST_CORE $FILECNT_CORE`;
  434. # Link core file content
  435. logmsg ("Link MSI Core contents.");
  436. logmsg ("$LIGHT $FILELST_CORE");
  437. `$LIGHT $FILELST_CORE`;
  438. # Generate file content for Professional
  439. logmsg ("Generate MSI contents for Professional.");
  440. logmsg("$INFPARSER /b:$FLAVOR /l:$Special_Lang /f:p /s:$MUIDIR /o:$FILECNT_PRO");
  441. `$INFPARSER /b:$FLAVOR /l:$Special_Lang /f:p /s:$MUIDIR /o:$FILECNT_PRO`;
  442. # Compile file content for Professional
  443. logmsg ("Compile MSI contents for Professional.");
  444. logmsg("$CANDLE -c $FILELST_PRO $FILECNT_PRO");
  445. `$CANDLE -c $FILELST_PRO $FILECNT_PRO`;
  446. # Link file content for Professional
  447. logmsg ("Link MSI content for Professional.");
  448. logmsg("$LIGHT $FILELST_PRO");
  449. `$LIGHT $FILELST_PRO`;
  450. # Generate file content for Server
  451. logmsg ("Generate MSI contents for Server.");
  452. logmsg("$INFPARSER /b:$FLAVOR /l:$Special_Lang /f:s /s:$MUIDIR /o:$FILECNT_SRV");
  453. `$INFPARSER /b:$FLAVOR /l:$Special_Lang /f:s /s:$MUIDIR /o:$FILECNT_SRV`;
  454. # Compile file content for Server
  455. logmsg ("Compile MSI contents for Server.");
  456. logmsg("$CANDLE -c $FILELST_SRV $FILECNT_SRV;");
  457. `$CANDLE -c $FILELST_SRV $FILECNT_SRV`;
  458. # Link file content for Server
  459. logmsg ("Link MSI contents for Server.");
  460. logmsg ("$LIGHT $FILELST_SRV");
  461. `$LIGHT $FILELST_SRV`;
  462. logmsg ("Success: Generate MSI file contents.");
  463. return 1;
  464. } #FileContents
  465. ##################################################################################
  466. #
  467. # CustomAction()
  468. #
  469. # Generate file associated with custom action if needed.
  470. #
  471. ##################################################################################
  472. sub CustomAction
  473. {
  474. logmsg ("Generate MSI file contents.");
  475. # Do something
  476. logmsg ("Success: Generate MSI file contents.");
  477. return 1;
  478. } #CustomAction
  479. ##################################################################################
  480. #
  481. # XMLVAR()
  482. #
  483. # Generate a language specific msi template.
  484. #
  485. ##################################################################################
  486. sub XMLVAR
  487. {
  488. logmsg ("Generate language specific msi template.");
  489. # Generate [LCID].WIM based on the template
  490. logmsg ("Run XMLVAR on the generic template.");
  491. # `$XMLVAR guid="$MSIGUID" namePackage="$PACKAGENAME" ver="1.0.$VERSIONNUMBER.0" guidUpgradeCode="$UPGRADEGUID" debugdir="$TMPBUILD" Language="$Special_Lang" BLD="$BLDNO" LCID="$LCID_SHORT" srcSchema="$WISCHEMA" < $TEMPLATE > $MUIMSIXML`;
  492. logmsg("$XMLVAR msiguid=\"$MSIGUID\" namePackage=\"$PACKAGENAME\" ver=\"1.0.$VERSIONNUMBER.0\" guidUpgradeCode=\"$UPGRADEGUID\" debugdir=\"$TMPBUILD\" Language=\"$LANG_NAME\" BLD=\"$BLDNO\" CORESRC=\"$FILELST_CORE\" PROSRC=\"$FILELST_PRO\" LCID=\"$LCID_SHORT\" srcSchema=\"$WISCHEMA\" < $TEMPLATE > $MUIMSIXML;");
  493. `$XMLVAR msiguid="$MSIGUID" namePackage="$PACKAGENAME" ver="1.0.$VERSIONNUMBER.0" guidUpgradeCode="$UPGRADEGUID" debugdir="$TMPBUILD" Language="$LANG_NAME" BLD="$BLDNO" CORESRC="$FILELST_CORE" PROSRC="$FILELST_PRO" LCID="$LCID_SHORT" srcSchema="$WISCHEMA" < $TEMPLATE > $MUIMSIXML`;
  494. logmsg ("Success: Generate language specific msi template.");
  495. return 1;
  496. } #XMLVAR
  497. ##################################################################################
  498. #
  499. # MakeMSI()
  500. #
  501. # Build the MSI package.
  502. #
  503. ##################################################################################
  504. sub MakeMSI
  505. {
  506. $MEGEMODDLL = "$RAZZLETOOLPATH\\x86\\mergemod.dll";
  507. logmsg ("Create MSI package.");
  508. logmsg ("Registering mergemod.dll");
  509. logmsg ("regsvr32 /s $MEGEMODDLL");
  510. `regsvr32 /s $MEGEMODDLL`;
  511. # Compile language specific template
  512. logmsg ("Compile the language specific template.");
  513. logmsg("$CANDLE -e -v -c $MUIMSIWIX $MUIMSIXML");
  514. `$CANDLE -e -v -c $MUIMSIWIX $MUIMSIXML`;
  515. # Link language specific template
  516. logmsg ("Link the language specific template.");
  517. logmsg ("$LIGHT -v -o $MUIMSI $MUIMSIWIX");
  518. `$LIGHT -v -o $MUIMSI $MUIMSIWIX `;
  519. logmsg ("Success: Create MSI package.");
  520. return 1;
  521. } #MakeMSI
  522. ##################################################################################
  523. #
  524. # ValidateParams()
  525. #
  526. # VAlidate parameters.
  527. #
  528. ##################################################################################
  529. sub ValidateParams
  530. {
  531. #<Add your code for validating the parameters here>
  532. }
  533. ##################################################################################
  534. #
  535. # Usage()
  536. #
  537. # Print usage.
  538. #
  539. ##################################################################################
  540. sub Usage
  541. {
  542. print <<USAGE;
  543. Create the MUI MSI package for the specified language
  544. Usage: $0 [-l lang]
  545. -l Language
  546. -? Displays usage
  547. Example:
  548. $0 -l jpn
  549. USAGE
  550. }
  551. ##################################################################################
  552. #
  553. # GetParams()
  554. #
  555. # Get language parameter.
  556. #
  557. ##################################################################################
  558. sub GetParams
  559. {
  560. # Step 1: Call pm getparams with specified arguments
  561. &GetParams::getparams(@_);
  562. # Step 2: Set the language into the enviroment
  563. $ENV{lang}=$lang;
  564. logmsg("-------- lang parameter passed in is $lang");
  565. # Step 3: Call the usage if specified by /?
  566. if ($HELP)
  567. {
  568. &Usage();
  569. exit 1;
  570. }
  571. }
  572. ##################################################################################
  573. #
  574. # Cmd entry point for script.
  575. #
  576. ##################################################################################
  577. if (eval("\$0 =~ /" . __PACKAGE__ . "\\.pm\$/i"))
  578. {
  579. # Step 1: Parse the command line
  580. # <run perl.exe GetParams.pm /? to get the complete usage for GetParams.pm>
  581. &GetParams ('-o', 'l:', '-p', 'lang', @ARGV);
  582. # Include local environment extensions
  583. &LocalEnvEx::localenvex('initialize');
  584. # Set lang from the environment
  585. $LANG=$ENV{lang};
  586. # $Special_Lang = "JPN"; // commented out, these are set in GetCodes
  587. # $LCID_SHORT = "0411"; // commented out, these are set in GetCodes
  588. # Validate the option given as parameter.
  589. &ValidateParams;
  590. # Set flag indicating that we run from command prompt.
  591. $cmdPrompt = 1;
  592. # Step 4: Call the main function
  593. &muimsi::Main();
  594. # End local environment extensions.
  595. &LocalEnvEx::localenvex('end');
  596. }