Bump for 3.6-28
[LibreOffice.git] / odk / cfgWin.js
blobf333a858f1fe53472034fbbc74c02946f1da276d
1 // This script asks for variables, which are necessary for building the
2 // examples of the Office Development Kit. The script duplicates the template
3 // script and inserts the variables into the copied script.
4 // The Script was developed for the operating systems Microsoft Windows.
5 var regKeyOfficeCurrentUser = "HKEY_CURRENT_USER\\Software\\LibreOffice\\UNO\\InstallPath\\";
6 var regKeyOfficeLocaleMachine = "HKEY_LOCAL_MACHINE\\Software\\LibreOffice\\UNO\\InstallPath\\";
7 var regKeyDotNetInstallRoot = "HKEY_LOCAL_MACHINE\\Software\\Microsoft\\.NETFramework\\InstallRoot";
8 var regKeyDotNet1_1 = "HKLM\\Software\\Microsoft\\.NETFramework\\policy\\v1.1\\4322";
9 var sDirDotNet1_1 = "v1.1.4322";
10 var regKeyDotNet2_0 = "HKLM\\Software\\Microsoft\\.NETFramework\\Policy\\v2.0\\50727";
11 var sDirDotNet2_0 = "v2.0.50727";
13 var regKeyJDK = "HKLM\\Software\\JavaSoft\\Java Development Kit\\";
14 //var regKeyVC70 = "HKLM\\SOFTWARE\\Microsoft\\VisualStudio\\7.0\\Setup\\VC\\ProductDir";
15 //var regKeyVC71 = "HKLM\\SOFTWARE\\Microsoft\\VisualStudio\\7.1\\Setup\\VC\\ProductDir";
16 var regKeyVC90 = "HKLM\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VC\\ProductDir";
18 //var regKeyVCExpress80 = "HKLM\\SOFTWARE\\Microsoft\\VCExpress\\8.0\\Setup\\VC\\ProductDir";
19 var regKeyVCExpress90 = "HKLM\\SOFTWARE\\Microsoft\\VCExpress\\9.0\\Setup\\VC\\ProductDir";
21 var regKeyWindowsSDK = "HKLM\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\CurrentInstallFolder";
23 var WshShell = WScript.CreateObject("WScript.Shell");
24 var WshSysEnv = WshShell.Environment("process");
25 var aFileSystemObject = new ActiveXObject("Scripting.FileSystemObject");
26 var stdin = WScript.StdIn;
27 var stdout = WScript.StdOut;
29 stdout.WriteLine("\n" +
30 " *** Configure your SDK environment ***\n\n" +
31 " NOTE: This script is working only for Windows 2000, Windows XP or newer versions!\n");
33 var oo_sdk_name=WshSysEnv("OO_SDK_NAME");
34 var oo_sdk_home=getSdkHome();
35 var oo_user_sdk_dir=WshSysEnv("APPDATA") + "\\" + oo_sdk_name;
36 var oo_user_sdk_env_script=oo_user_sdk_dir + "\\setsdkenv_windows.bat";
38 var office_home=getOfficeHome();
39 var oo_sdk_ure_home=office_home + "\\URE";
41 var oo_sdk_make_home=getMakeHome();
42 var oo_sdk_zip_home=getZipHome();
43 var oo_sdk_manifest_used="";
44 var oo_sdk_windowssdk="";
45 var oo_sdk_cpp_home=getCppHome();
46 var oo_sdk_cli_home=getCliHome();
47 var oo_sdk_java_home=getJavaHome();
48 var oo_sdk_out=getOutputDir();
49 var sdk_auto_deployment=getAutoDeployment();
51 writeBatFile(oo_user_sdk_dir, oo_user_sdk_env_script);
53 stdout.Write(
54 "\n ******************************************************************\n" +
55 " * ... \"" + oo_user_sdk_env_script + "\"\n" +
56 " * batch file has been prepared.\n" +
57 " * This batch file will be used in the future to prepare your\n" +
58 " * personal configured SDK environment.\n" +
59 " ******************************************************************\n\n");
60 // " * For each time you want to use this configured SDK environment,\n" +
61 // " * you have to run the \"setsdkenv_windows.bat\" file in a new shell!\n" +
63 // done -------------------------------------------------------------------------
66 function skipChoice(msg)
68 stdout.Write("\n Do you want to skip the choice of " + msg + " (YES/NO) [YES]:");
69 var sChoice = stdin.ReadLine();
70 if (sChoice == "" || sChoice.toLowerCase() == "yes")
71 return true;
73 return false;
76 function getSdkHome()
78 var sSuggestedHome = WshSysEnv("OO_SDK_HOME");
79 if (sSuggestedHome.length == 0) {
80 var scriptname = WScript.ScriptFullName;
81 sSuggestedHome = scriptname.substr(0,scriptname.length-10);
84 while(true)
86 stdout.Write("\n Enter the Office Software Development Kit directory [" +
87 sSuggestedHome + "]:");
88 var sHome = stdin.ReadLine();
89 if (sHome.length == 0)
91 //No user input, use default.
92 if ( ! aFileSystemObject.FolderExists(sSuggestedHome))
94 stdout.WriteLine("\n Error: Could not find directory \"" +
95 sSuggestedHome + "\". An SDK is required, please" +
96 " specify the path to a valid installation.");
97 continue;
99 sHome = sSuggestedHome;
101 else
103 //validate the user input
104 if ( ! aFileSystemObject.FolderExists(sHome))
106 stdout.WriteLine("\n Error: The directory \"" + sHome +
107 "\" does not exist. Please enter the path to a" +
108 "valid SDK installation.");
109 continue;
112 //Check if this is an sdk folder by looking for the idl sub - dir
113 var idlDir = sHome + "\\idl";
114 if (! aFileSystemObject.FolderExists(idlDir))
116 stdout.WriteLine("\n Error: Could not find directory \"" +
117 idlDir + "\". An SDK is required, please specify " +
118 "the path to a valid SDK installation.");
119 continue;
122 return sHome;
126 function getOfficeHome()
128 var sSuggestedHome = WshSysEnv("OFFICE_HOME");
129 if (sSuggestedHome.length == 0)
131 try {
132 sSuggestedHome = WshShell.RegRead(regKeyOfficeCurrentUser);
133 //The registry entry points to the program folder but we need the
134 //installation folder
135 } catch(exc) {}
136 if (sSuggestedHome.length == 0)
138 try {
139 sSuggestedHome = WshShell.RegRead(regKeyOfficeLocaleMachine);
140 //The registry entry points to the program folder but we need
141 //the installation folder
142 } catch (exc) {}
145 var index=0;
146 if ((index = sSuggestedHome.lastIndexOf("\\")) != -1)
147 sSuggestedHome = sSuggestedHome.substr(0, index);
149 if (sSuggestedHome.length == 0)
150 sSuggestedHome = searchOffice();
153 while(true)
155 stdout.Write("\n Enter the Office base installation directory [" +
156 sSuggestedHome + "]:");
157 var sHome = stdin.ReadLine();
158 if (sHome.length == 0)
160 //No user input, use default.
161 if ( ! aFileSystemObject.FolderExists(sSuggestedHome))
163 stdout.WriteLine("\n Error: Could not find directory \"" +
164 sSuggestedHome + "\" An office installation is " +
165 "required, please specify the path to a valid " +
166 "office installation.");
167 sSuggestedHome = "";
168 continue;
170 sHome = sSuggestedHome;
171 } else
173 //validate the user input
174 if ( ! aFileSystemObject.FolderExists(sHome))
176 stdout.WriteLine("\n Error: The directory \"" + sHome +
177 "\" does not exist. Please specify the path to " +
178 "a valid office installation.");
179 continue;
182 //Check if this is a valid office installtion folder by looking for the
183 //program sub-directory
184 var progDir = sHome + "\\program";
185 if (! aFileSystemObject.FolderExists(progDir))
187 stdout.WriteLine("\n Error: Could not find directory \"" +
188 progDir + "\". An office installation is required, " +
189 "please specify the path to a valid office " +
190 "installation.");
191 continue;
193 return sHome;
197 function searchOffice()
199 var tmp = oo_sdk_home;
201 if (aFileSystemObject.FileExists(tmp + "\\program\\soffice.exe")) {
202 return tmp;
205 return "";
208 function getMakeHome()
210 var sSuggestedHome = WshSysEnv("OO_SDK_MAKE_HOME");
212 while(true)
214 stdout.Write("\n Enter GNU make (3.79.1 or higher) tools directory [" +
215 sSuggestedHome + "]:");
216 var sHome = stdin.ReadLine();
217 if (sHome.length == 0)
219 //No user input, use default.
220 if ( ! aFileSystemObject.FolderExists(sSuggestedHome))
222 stdout.WriteLine("\n Error: Could not find directory \"" +
223 sSuggestedHome + "\". GNU make is required, " +
224 "please specify a GNU make tools directory.");
225 sSuggestedHome = "";
226 continue;
228 sHome = sSuggestedHome;
229 } else
231 //validate the user input
232 if ( ! aFileSystemObject.FolderExists(sHome))
234 stdout.WriteLine("\n Error: The directory \"" + sHome +
235 "\" does not exist. GNU make is required, " +
236 "please specify a GNU make tools directory.");
237 continue;
240 //Check for the make executable
241 var sMakePath = sHome + "\\make.exe";
242 if (! aFileSystemObject.FileExists(sMakePath))
244 sMakePath = sHome + "\\mingw32-make.exe";
246 if (! aFileSystemObject.FileExists(sMakePath))
248 stdout.WriteLine("\n Error: Could not find \"" + sMakePath +
249 "\". GNU make is required, please specify a GNU " +
250 "make tools directory.");
251 continue;
253 return sHome;
257 function getZipHome()
259 var sSuggestedHome = WshSysEnv("OO_SDK_ZIP_HOME");
261 while(true)
263 stdout.Write("\n Enter a zip (2.3 or higher) tools directory [" +
264 sSuggestedHome + "]:");
265 var sHome = stdin.ReadLine();
266 if (sHome.length == 0)
268 //No user input, use default.
269 if ( ! aFileSystemObject.FolderExists(sSuggestedHome))
271 stdout.WriteLine("\n Error: Could not find directory \"" +
272 sSuggestedHome + "\". zip is required, please " +
273 "specify a zip tools directory.");
274 sSuggestedHome = "";
275 continue;
277 sHome = sSuggestedHome;
279 else
281 //validate the user input
282 if ( ! aFileSystemObject.FolderExists(sHome))
284 stdout.WriteLine("\n Error: The directory \"" + sHome +
285 "\" does not exist. zip is required, please " +
286 "specify a zip tools directory.");
287 continue;
290 //Check for the make executable
291 var sZipPath = sHome + "\\zip.exe";
292 if (! aFileSystemObject.FileExists(sZipPath))
294 stdout.WriteLine("\n Error: Could not find \"" + sZipPath +
295 "\". zip is required, please specify a zip tools " +
296 "directory.");
297 continue;
299 return sHome;
303 function getCppHome()
305 var sSuggestedHome = WshSysEnv("OO_SDK_CPP_HOME");
306 if (sSuggestedHome.length == 0)
308 var sVC="";
309 try {
310 sVC = WshShell.RegRead(regKeyVCExpress90);
311 }catch (exc) {}
312 if (sVC.length == 0)
314 try {
315 sVC = WshShell.RegRead(regKeyVC90);
316 }catch (exc) {}
318 // check Windows SDK if VC 9
319 if (sVC.length > 0)
321 oo_sdk_manifest_used="true";
322 try {
323 oo_sdk_windowssdk = WshShell.RegRead(regKeyWindowsSDK);
324 }catch (exc) {}
326 if (sVC.length == 0)
328 try {
329 sVC = WshShell.RegRead(regKeyVCExpress80);
330 }catch (exc) {}
331 if (sVC.length > 0)
332 oo_sdk_manifest_used="true";
334 if (sVC.length == 0)
336 try {
337 sVC = WshShell.RegRead(regKeyVC80);
338 }catch (exc) {}
339 if (sVC.length > 0)
340 oo_sdk_manifest_used="true";
342 if (sVC.length == 0)
344 try {
345 sVC = WshShell.RegRead(regKeyVC71);
346 }catch (exc) {}
348 if (sVC.length > 0)
350 sVC += "bin";
351 if (aFileSystemObject.FileExists(sVC + "\\cl.exe"))
352 sSuggestedHome = sVC;
356 var bSkip = false;
357 while(true)
359 stdout.Write("\n Enter the directory of the C++ compiler (optional) [" +
360 sSuggestedHome + "]:");
361 var sHome = stdin.ReadLine();
362 if (sHome.length == 0)
364 //No user input, check OO_SDK_CPP_HOME or suggested value
365 if ( sSuggestedHome.length == 0 ) {
366 bSkip = true;
367 } else {
368 if ( !aFileSystemObject.FolderExists(sSuggestedHome) )
370 stdout.WriteLine("\n Error: Could not find directory \"" +
371 sSuggestedHome + "\".");
372 sSuggestedHome = "";
373 bSkip = true;
377 sHome = sSuggestedHome;
378 } else
380 //validate the user input
381 if ( ! aFileSystemObject.FolderExists(sHome))
383 stdout.WriteLine("\n Error: Could not find directory \"" +
384 sHome + "\".");
385 bSkip = true;
389 if ( !bSkip) {
390 //Check if the C++ compiler exist
391 var cl = sHome + "\\cl.exe";
392 var mt = sHome + "\\mt.exe";
394 if (! aFileSystemObject.FileExists(cl))
396 stdout.WriteLine("\n Error: Could not find the C++ compiler \""
397 + cl + "\".");
398 sHome = "";
399 bSkip = true;
400 } else {
401 if (aFileSystemObject.FileExists(mt)) {
402 oo_sdk_vc8_used="true";
407 if ( bSkip ) {
408 if ( skipChoice("the C++ compiler") ) {
409 return "";
410 } else {
411 bSkip = false;
412 continue;
416 return sHome;
420 function getCliHome()
422 var sSuggestedHome = WshSysEnv("OO_SDK_CLI_HOME");
424 if (sSuggestedHome.length == 0)
426 try {
427 var _ver = WshShell.RegRead(regKeyDotNet2_0);
428 if (_ver.length > 0)
430 sSuggestedHome = WshShell.RegRead(regKeyDotNetInstallRoot);
431 sSuggestedHome += sDirDotNet2_0;
432 if ( ! aFileSystemObject.FolderExists(sSuggestedHome))
433 sSuggestedHome = "";
436 if (sSuggestedHome.length == 0)
438 _ver = WshShell.RegRead(regKeyDotNet1_1);
439 if (_ver.length > 0)
441 sSuggestedHome = WshShell.RegRead(regKeyDotNetInstallRoot);
442 sSuggestedHome += sDirDotNet1_1;
443 if ( ! aFileSystemObject.FolderExists(sSuggestedHome))
444 sSuggestedHome = "";
447 } catch (exc) {}
450 var bSkip = false;
451 while(true)
453 stdout.Write("\n Enter the directory of the C# and VB.NET compilers (optional) [" + sSuggestedHome + "]:");
454 var sHome = stdin.ReadLine();
455 if (sHome.length == 0)
457 //No user input, check OO_SDK_CLI_HOME or suggested value
458 if ( sSuggestedHome.length == 0 ) {
459 bSkip = true;
460 } else {
461 if ( !aFileSystemObject.FolderExists(sSuggestedHome) )
463 stdout.WriteLine("\n Error: Could not find directory \"" +
464 sSuggestedHome + "\".");
465 sSuggestedHome = "";
466 bSkip = true;
470 sHome = sSuggestedHome;
472 else
474 //validate the user input
475 if ( ! aFileSystemObject.FolderExists(sHome))
477 stdout.WriteLine("\n Error: The directory \"" + sHome +
478 "\" does not exist.");
479 bSkip = true;
483 if ( !bSkip ) {
484 //Check if the C# and VB.NET compiler exist
485 var csc = sHome + "\\csc.exe";
486 var vbc = sHome + "\\vbc.exe";
488 if (! aFileSystemObject.FileExists(csc))
490 stdout.WriteLine("\n Error: Could not find the C# compiler \"" +
491 csc + "\".");
492 bSkip = true;
494 if (! aFileSystemObject.FileExists(vbc))
496 stdout.WriteLine("\n Error: Could not find the VB.NET compiler \"" +
497 vbc + "\".");
498 bSkip = true;
502 if ( bSkip ) {
503 if ( skipChoice("the C# and VB.NET compilers") ) {
504 return "";
505 } else {
506 bSkip = false;
507 continue;
511 return sHome;
515 function getJavaHome()
517 var sSuggestedHome = WshSysEnv("OO_SDK_JAVA_HOME");
518 if (sSuggestedHome.length == 0)
520 try {
521 var currentVersion = WshShell.RegRead(regKeyJDK + "CurrentVersion");
522 if (currentVersion.length > 0)
524 sSuggestedHome = WshShell.RegRead(regKeyJDK + currentVersion +
525 "\\JavaHome");
526 if ( ! aFileSystemObject.FolderExists(sSuggestedHome) )
527 sSuggestedHome = "";
529 } catch (exc) {}
532 var bSkip = false;
533 while(true)
535 stdout.Write("\n Enter JAVA SDK (1.4.1_01 or higher) installation directory (optional) [" + sSuggestedHome + "]:");
536 var sHome = stdin.ReadLine();
537 if (sHome.length == 0)
539 //No user input, check OO_SDK_JAVA_HOME or suggested value
540 if ( sSuggestedHome.length == 0 ) {
541 bSkip = true;
542 } else {
543 if ( !aFileSystemObject.FolderExists(sSuggestedHome) )
545 stdout.WriteLine("\n Error: Could not find directory \"" +
546 sSuggestedHome + "\".");
547 sSuggestedHome = "";
548 bSkip=true;
552 sHome = sSuggestedHome;
553 } else
555 //validate the user input
556 if ( ! aFileSystemObject.FolderExists(sHome))
558 stdout.WriteLine("\n Error: The directory \"" + sHome +
559 "\" does not exist.");
560 bSkip = true;
564 if ( !bSkip) {
565 //Check if this is an sdk folder by looking for the javac compiler
566 var javacompiler = sHome + "\\bin\\javac.exe";
567 if (! aFileSystemObject.FileExists(javacompiler))
569 stdout.WriteLine("\n Error: Could not find \"" +
570 javacompiler + "\".");
571 bSkip = true;
575 if ( bSkip ) {
576 if ( skipChoice("the Java SDK") ) {
577 return "";
578 } else {
579 bSkip = false;
580 continue;
584 return sHome;
588 function getOutputDir()
590 var defaultdir = "c:\\" + oo_sdk_name;
591 var sSuggestedDir = WshSysEnv("OO_SDK_OUT");
592 if (sSuggestedDir.length == 0)
593 sSuggestedDir = defaultdir;
595 var bSkip = false;
596 while(true)
598 stdout.Write(
599 "\n Default output directory is the \"c:\\" + oo_sdk_name + "\".\n" +
600 " Enter an existent directory if you prefer a different one. But note" +
601 " that only\n a path without spaces is allowed because of a" +
602 " limitation of gnu make. (optional) [" + sSuggestedDir + "]:");
603 var sDir = stdin.ReadLine();
604 if (sDir.length == 0)
606 //No user input, check OO_SDK_OUT or suggested value
607 if ( sSuggestedDir.length == 0 ) {
608 bSkip = true;
609 } else {
610 if (sSuggestedDir == oo_user_sdk_dir || sSuggestedDir == defaultdir) {
611 var fso = new ActiveXObject("Scripting.FileSystemObject");
612 if ( !fso.FolderExists(sSuggestedDir) )
613 fso.CreateFolder(sSuggestedDir);
615 if ( !aFileSystemObject.FolderExists(sSuggestedDir) )
617 stdout.WriteLine("\n Error: Could not find directory \"" +
618 sSuggestedDir + "\".");
619 sSuggestedDir = "";
620 bSkip = true;
624 sDir = sSuggestedDir;
626 else
628 if (sDir.indexOf(' ') != -1) {
629 stdout.WriteLine("\n Error: your specified output directory " +
630 "\"" + sDir + "\" " +
631 "contains one or more spaces.\n That " +
632 "causes problems with gnu make. Please specifiy" +
633 " a directory without spaces.");
634 bSkip = true;
636 //validate the user input
637 if ( ! aFileSystemObject.FolderExists(sDir))
639 stdout.WriteLine("\n Error: Could not find directory \"" +
640 sDir + "\".");
641 bSkip = true;
645 if ( bSkip ) {
646 if ( skipChoice("a special output directory") ) {
647 return "";
648 } else {
649 bSkip = false;
650 continue;
654 return sDir;
658 function getAutoDeployment()
660 var sSuggestedAuto = WshSysEnv("SDK_AUTO_DEPLOYMENT");
661 if (sSuggestedAuto.length == 0)
662 sSuggestedAuto = "YES";
664 while(true)
666 stdout.Write("\n Automatic deployment of UNO components (YES/NO) ["+
667 sSuggestedAuto + "]:");
668 var sAuto = stdin.ReadLine();
669 if (sAuto.length == 0)
670 sAuto = sSuggestedAuto;
671 else
673 sAutoU = sAuto.toUpperCase();
674 if (sAutoU != "YES" && sAutoU != "NO")
676 stdout.WriteLine("\n Error: The value \"" + sAuto + "\" is " +
677 "invalid. Please answer YES or NO.")
678 continue;
680 sAuto = sAutoU;
682 return sAuto;
686 //The function uses sp2bv.exe to obtain a file URL from a
687 //system path. The URL is already escaped for use as bootstrap variable.
688 //($ -> \$). Then the resulting string is escaped for use in a bat file.
689 //That is % signs are made to double % (% -> %%);
690 function makeBootstrapFileUrl(systemPath)
692 var oExec = WshShell.Exec("sp2bv.exe \"" + systemPath + "\"");
693 var output="";
694 while (true)
696 if (!oExec.StdOut.AtEndOfStream)
698 var next = oExec.StdOut.Read(1);
699 if (next == '%')
700 output += "%%";
701 else
702 output += next;
704 else
705 break;
707 return output;
710 function writeBatFile(fdir, file)
712 var fso = new ActiveXObject("Scripting.FileSystemObject");
713 if ( !fso.FolderExists(fdir) )
714 fso.CreateFolder(fdir);
715 var newFile = fso.CreateTextFile(file, true);
717 newFile.Write(
718 "@echo off\n" +
719 "REM This script sets all enviroment variables, which\n" +
720 "REM are necessary for building the examples of the Office Development Kit.\n" +
721 "REM The Script was developed for the operating systems Windows.\n" +
722 "REM The SDK name\n" +
723 "REM Example: set OO_SDK_NAME=libreoffice3.4_sdk\n" +
724 "set OO_SDK_NAME=" + oo_sdk_name +
725 "\n\n" +
726 "REM Installation directory of the Software Development Kit.\n" +
727 "REM Example: set OO_SDK_HOME=C:\\Program Files\\LibreOffice 3\\sdk\n" +
728 "set OO_SDK_HOME=" + oo_sdk_home +
729 "\n\n" +
730 "REM Office installation directory.\n" +
731 "REM Example: set OFFICE_HOME=C:\\Program Files\\LibreOffice 3\n" +
732 "set OFFICE_HOME=" + office_home +
733 "\n\n" +
734 "REM URE installation directory.\n" +
735 "REM Example: set OO_SDK_URE_HOME=C:\\Program Files\\LibreOffice 3\\URE\n" +
736 "set OO_SDK_URE_HOME=" + oo_sdk_ure_home +
737 "\n\n" +
738 "REM Directory of the make command.\n" +
739 "REM Example: set OO_SDK_MAKE_HOME=D:\\NextGenerationMake\\make\n" +
740 "set OO_SDK_MAKE_HOME=" + oo_sdk_make_home +
741 "\n\n" +
742 "REM Directory of the zip tool.\n" +
743 "REM Example: set OO_SDK_ZIP_HOME=D:\\infozip\\bin\n" +
744 "set OO_SDK_ZIP_HOME=" + oo_sdk_zip_home +
745 "\n\n" +
746 "REM Directory of the C++ compiler.\n" +
747 "REM Example:set OO_SDK_CPP_HOME=C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\bin\n" +
748 "set OO_SDK_CPP_HOME=" + oo_sdk_cpp_home +
749 "\nset CPP_MANIFEST=" + oo_sdk_manifest_used +
750 "\nset CPP_WINDOWS_SDK=" + oo_sdk_windowssdk +
751 "\n\n" +
752 "REM Directory of the C# and VB.NET compilers.\n" +
753 "REM Example:set OO_SDK_CLI_HOME=C:\\WINXP\\Microsoft.NET\\Framework\\v1.0.3705\n" +
754 "set OO_SDK_CLI_HOME=" + oo_sdk_cli_home +
755 "\n\n" +
756 "REM Java SDK installation directory.\n" +
757 "REM Example: set OO_SDK_JAVA_HOME=C:\\Program Files\\Java\\jdk1.6.0_05\n" +
758 "set OO_SDK_JAVA_HOME=" + oo_sdk_java_home +
759 "\n\n" +
760 "REM Special output directory\n" +
761 "REM Example: set OO_SDK_OUT=C:\\" + oo_sdk_name + "\n" +
762 "set OO_SDK_OUT=" + oo_sdk_out +
763 "\n\n" +
764 "REM Automatic deployment\n" +
765 "REM Example: set SDK_AUTO_DEPLOYMENT=YES\n" +
766 "set SDK_AUTO_DEPLOYMENT=" + sdk_auto_deployment +
767 "\n\n" +
768 "REM Check installation path for the Office Development Kit.\n" +
769 "if not defined OO_SDK_HOME (\n" +
770 " echo Error: the variable OO_SDK_HOME is missing!\n" +
771 " goto :error\n" +
772 " )\n" +
773 "\n" +
774 "REM Check installation path for the office.\n" +
775 "REM if not defined OFFICE_HOME (\n" +
776 "REM if not defined OO_SDK_URE_HOME (\n" +
777 "REM echo Error: either of the variables OFFICE_HOME and\n" +
778 "REM echo OO_SDK_URE_HOME is missing!\n" +
779 "REM goto :error\n" +
780 "REM )\n" +
781 "REM )\n" +
782 "\n" +
783 "REM Check installation path for GNU make.\n" +
784 "if not defined OO_SDK_MAKE_HOME (\n" +
785 " echo Error: the variable OO_SDK_MAKE_HOME is missing!\n" +
786 " goto :error\n" +
787 " )\n" +
788 "\n" +
789 "REM Check installation path for the zip tool.\n" +
790 "if not defined OO_SDK_ZIP_HOME (\n" +
791 " echo Error: the variable OO_SDK_ZIP_HOME is missing!\n" +
792 " goto :error\n" +
793 " )\n" +
794 "\n" +
795 "REM Set library path. \n" +
796 "set LIB=%OO_SDK_HOME%\\lib;%LIB%\n" +
797 "if defined CPP_WINDOWS_SDK (\n" +
798 " set LIB=%LIB%;%CPP_WINDOWS_SDK%\\lib\n" +
799 " )\n" +
800 "\n" +
801 "REM Set office program path.\n" +
802 "if defined OFFICE_HOME (\n" +
803 " set OFFICE_PROGRAM_PATH=%OFFICE_HOME%\\program\n" +
804 " )\n" +
805 "\n" +
806 "REM Set UNO path, necessary to ensure that the cpp examples using the\n" +
807 "REM new UNO bootstrap mechanism use the configured office installation\n" +
808 "REM (only set when using an Office).\n" +
809 "if defined OFFICE_HOME (\n" +
810 " set UNO_PATH=%OFFICE_PROGRAM_PATH%\n" +
811 " )\n" +
812 "\n" +
813 "REM if defined OO_SDK_URE_HOME (\n" +
814 "set OO_SDK_URE_BIN_DIR=%OO_SDK_URE_HOME%\\bin\n" +
815 "set OO_SDK_URE_LIB_DIR=%OO_SDK_URE_HOME%\\bin\n" +
816 "set OO_SDK_URE_JAVA_DIR=%OO_SDK_URE_HOME%\\java\n" +
817 "REM ) else (\n" +
818 "set OO_SDK_OFFICE_BIN_DIR=%OFFICE_PROGRAM_PATH%\n" +
819 "set OO_SDK_OFFICE_LIB_DIR=%OFFICE_PROGRAM_PATH%\n" +
820 "set OO_SDK_OFFICE_JAVA_DIR=%OFFICE_PROGRAM_PATH%\\classes\n" +
821 "REM )\n" +
822 "\n" +
823 "REM Set classpath\n" +
824 "set CLASSPATH=%OO_SDK_URE_JAVA_DIR%\\juh.jar;%OO_SDK_URE_JAVA_DIR%\\jurt.jar;%OO_SDK_URE_JAVA_DIR%\\ridl.jar;%OO_SDK_URE_JAVA_DIR%\\unoloader.jar;%OO_SDK_OFFICE_JAVA_DIR%\\unoil.jar\n" +
825 "REM if defined OFFICE_HOME (\n" +
826 "REM set CLASSPATH=%CLASSPATH%;%OO_SDK_OFFICE_JAVA_DIR%\\unoil.jar\n" +
827 "REM )\n" +
828 "\n" +
829 "REM Add directory of the SDK tools to the path.\n" +
830 "set PATH=%OO_SDK_HOME%\\bin;%OO_SDK_URE_BIN_DIR%;%OO_SDK_OFFICE_BIN_DIR%;%OO_SDK_HOME%\\WINexample.out\\bin;%PATH%\n" +
831 "\n" +
832 "REM Set PATH appropriate to the output directory\n" +
833 "if defined OO_SDK_OUT (\n" +
834 " set PATH=%OO_SDK_OUT%\\WINexample.out\\bin;%PATH%\n" +
835 " ) else (\n" +
836 " set PATH=%OO_SDK_HOME%\\WINexample.out\\bin;%PATH%\n" +
837 " )\n" +
838 "\n" +
839 "REM Add directory of the command make to the path, if necessary.\n" +
840 "if defined OO_SDK_MAKE_HOME set PATH=%OO_SDK_MAKE_HOME%;%PATH%\n" +
841 "\n" +
842 "REM Add directory of the zip tool to the path, if necessary.\n" +
843 "if defined OO_SDK_ZIP_HOME set PATH=%OO_SDK_ZIP_HOME%;%PATH%\n" +
844 "\n" +
845 "REM Add directory of the C++ compiler to the path, if necessary.\n" +
846 "if defined OO_SDK_CPP_HOME set PATH=%OO_SDK_CPP_HOME%;%PATH%\n" +
847 "\n" +
848 "REM Add directory of the Win SDK to the path, if necessary.\n" +
849 "if defined CPP_WINDOWS_SDK (\n" +
850 " set PATH=%CPP_WINDOWS_SDK%\\bin;%PATH%\n" +
851 " set INCLUDE=%CPP_WINDOWS_SDK%\\Include;%INCLUDE%\n" +
852 ")\n" +
853 "REM Add directory of the C# and VB.NET compilers to the path, if necessary.\n" +
854 "if defined OO_SDK_CLI_HOME set PATH=%OO_SDK_CLI_HOME%;%PATH%\n" +
855 "\n" +
856 "REM Add directory of the Java tools to the path, if necessary.\n" +
857 "if defined OO_SDK_JAVA_HOME set PATH=%OO_SDK_JAVA_HOME%\\bin;%OO_SDK_JAVA_HOME%\\jre\\bin;%PATH%\n" +
858 "\n" +
859 "REM Set environment for C++ compiler tools, if necessary.\n" +
860 "if defined OO_SDK_CPP_HOME call \"%OO_SDK_CPP_HOME%\\VCVARS32.bat\"\n" +
861 "\n" +
862 "REM Set tilte to identify the prepared shell.\n" +
863 "title Shell prepared for SDK\n" +
864 "\nREM Prepare shell with all necessary environment variables.\n" +
865 "echo.\n" +
866 "echo ******************************************************************\n" +
867 "echo *\n" +
868 "echo * SDK environment is prepared for Windows\n" +
869 "echo *\n" +
870 "echo * SDK = %OO_SDK_HOME%\n" +
871 "echo * Office = %OFFICE_HOME%\n" +
872 "echo * URE = %OO_SDK_URE_HOME%\n" +
873 "echo * Make = %OO_SDK_MAKE_HOME%\n" +
874 "echo * Zip = %OO_SDK_ZIP_HOME%\n" +
875 "echo * C++ Compiler = %OO_SDK_CPP_HOME%\n" +
876 "echo * C# and VB.NET compilers = %OO_SDK_CLI_HOME%\n" +
877 "echo * Java = %OO_SDK_JAVA_HOME%\n" +
878 "echo * Special Output directory = %OO_SDK_OUT%\n" +
879 "echo * Auto deployment = %SDK_AUTO_DEPLOYMENT%\n" +
880 "echo *\n" +
881 "echo ******************************************************************\n" +
882 "echo.\n" +
883 "goto end\n" +
884 "\n" +
885 " :error\n" +
886 "Error: Please insert the necessary environment variables into the batch file.\n" +
887 "\n" +
888 " :end\n"
890 newFile.Close();