2 // This file is part of the LibreOffice project.
4 // This Source Code Form is subject to the terms of the Mozilla Public
5 // License, v. 2.0. If a copy of the MPL was not distributed with this
6 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 // This file incorporates work covered by the following license notice:
10 // Licensed to the Apache Software Foundation (ASF) under one or more
11 // contributor license agreements. See the NOTICE file distributed
12 // with this work for additional information regarding copyright
13 // ownership. The ASF licenses this file to you under the Apache
14 // License, Version 2.0 (the "License"); you may not use this file
15 // except in compliance with the License. You may obtain a copy of
16 // the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 // This script asks for variables, which are necessary for building the
19 // examples of the Office Development Kit. The script duplicates the template
20 // script and inserts the variables into the copied script.
21 // The Script was developed for the operating systems Microsoft Windows.
22 var regKeyOfficeCurrentUser = "HKEY_CURRENT_USER\\Software\\LibreOffice\\UNO\\InstallPath\\";
23 var regKeyOfficeLocaleMachine = "HKEY_LOCAL_MACHINE\\Software\\LibreOffice\\UNO\\InstallPath\\";
24 var regKeyDotNetInstallRoot = "HKEY_LOCAL_MACHINE\\Software\\Microsoft\\.NETFramework\\InstallRoot";
25 var regKeyDotNet1_1 = "HKLM\\Software\\Microsoft\\.NETFramework\\policy\\v1.1\\4322";
26 var sDirDotNet1_1 = "v1.1.4322";
27 var regKeyDotNet2_0 = "HKLM\\Software\\Microsoft\\.NETFramework\\Policy\\v2.0\\50727";
28 var sDirDotNet2_0 = "v2.0.50727";
30 var regKeyJDK = "HKLM\\Software\\JavaSoft\\Java Development Kit\\";
31 //var regKeyVC70 = "HKLM\\SOFTWARE\\Microsoft\\VisualStudio\\7.0\\Setup\\VC\\ProductDir";
32 //var regKeyVC71 = "HKLM\\SOFTWARE\\Microsoft\\VisualStudio\\7.1\\Setup\\VC\\ProductDir";
33 var regKeyVC90 = "HKLM\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VC\\ProductDir";
35 //var regKeyVCExpress80 = "HKLM\\SOFTWARE\\Microsoft\\VCExpress\\8.0\\Setup\\VC\\ProductDir";
36 var regKeyVCExpress90 = "HKLM\\SOFTWARE\\Microsoft\\VCExpress\\9.0\\Setup\\VC\\ProductDir";
38 var regKeyWindowsSDK = "HKLM\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\CurrentInstallFolder";
40 var WshShell = WScript.CreateObject("WScript.Shell");
41 var WshSysEnv = WshShell.Environment("process");
42 var aFileSystemObject = new ActiveXObject("Scripting.FileSystemObject");
43 var stdin = WScript.StdIn;
44 var stdout = WScript.StdOut;
46 stdout.WriteLine("\n" +
47 " *** Configure your SDK environment ***\n\n" +
48 " NOTE: This script is working only for Windows 2000, Windows XP or newer versions!\n");
50 var oo_sdk_name=WshSysEnv("OO_SDK_NAME");
51 var oo_sdk_home=getSdkHome();
52 var oo_user_sdk_dir=WshSysEnv("APPDATA") + "\\" + oo_sdk_name;
53 var oo_user_sdk_env_script=oo_user_sdk_dir + "\\setsdkenv_windows.bat";
55 var office_home=getOfficeHome();
57 var oo_sdk_make_home=getMakeHome();
58 var oo_sdk_zip_home=getZipHome();
59 var oo_sdk_cat_home=getCatHome();
60 var oo_sdk_sed_home=getSedHome();
61 var oo_sdk_manifest_used="";
62 var oo_sdk_windowssdk="";
63 var oo_sdk_cpp_home=getCppHome();
64 var oo_sdk_cli_home=getCliHome();
65 var oo_sdk_java_home=getJavaHome();
66 var oo_sdk_out=getOutputDir();
67 var sdk_auto_deployment=getAutoDeployment();
69 writeBatFile(oo_user_sdk_dir, oo_user_sdk_env_script);
72 "\n ******************************************************************\n" +
73 " * ... \"" + oo_user_sdk_env_script + "\"\n" +
74 " * batch file has been prepared.\n" +
75 " * This batch file will be used in the future to prepare your\n" +
76 " * personal configured SDK environment.\n" +
77 " ******************************************************************\n\n");
78 // " * For each time you want to use this configured SDK environment,\n" +
79 // " * you have to run the \"setsdkenv_windows.bat\" file in a new shell!\n" +
81 // done -------------------------------------------------------------------------
84 function skipChoice(msg)
86 stdout.Write("\n Do you want to skip the choice of " + msg + " (YES/NO) [YES]:");
87 var sChoice = stdin.ReadLine();
88 if (sChoice == "" || sChoice.toLowerCase() == "yes")
96 var sSuggestedHome = WshSysEnv("OO_SDK_HOME");
97 if (sSuggestedHome.length == 0) {
98 var scriptname = WScript.ScriptFullName;
99 sSuggestedHome = scriptname.substr(0,scriptname.length-10);
104 stdout.Write("\n Enter the Office Software Development Kit directory [" +
105 sSuggestedHome + "]:");
106 var sHome = stdin.ReadLine();
107 if (sHome.length == 0)
109 //No user input, use default.
110 if ( ! aFileSystemObject.FolderExists(sSuggestedHome))
112 stdout.WriteLine("\n Error: Could not find directory \"" +
113 sSuggestedHome + "\". An SDK is required, please" +
114 " specify the path to a valid installation.");
117 sHome = sSuggestedHome;
121 //validate the user input
122 if ( ! aFileSystemObject.FolderExists(sHome))
124 stdout.WriteLine("\n Error: The directory \"" + sHome +
125 "\" does not exist. Please enter the path to a" +
126 "valid SDK installation.");
130 //Check if this is an sdk folder by looking for the idl sub - dir
131 var idlDir = sHome + "\\idl";
132 if (! aFileSystemObject.FolderExists(idlDir))
134 stdout.WriteLine("\n Error: Could not find directory \"" +
135 idlDir + "\". An SDK is required, please specify " +
136 "the path to a valid SDK installation.");
144 function getOfficeHome()
146 var sSuggestedHome = WshSysEnv("OFFICE_HOME");
147 if (sSuggestedHome.length == 0)
150 sSuggestedHome = WshShell.RegRead(regKeyOfficeCurrentUser);
151 //The registry entry points to the program folder but we need the
152 //installation folder
154 if (sSuggestedHome.length == 0)
157 sSuggestedHome = WshShell.RegRead(regKeyOfficeLocaleMachine);
158 //The registry entry points to the program folder but we need
159 //the installation folder
164 if ((index = sSuggestedHome.lastIndexOf("\\")) != -1)
165 sSuggestedHome = sSuggestedHome.substr(0, index);
167 if (sSuggestedHome.length == 0)
168 sSuggestedHome = searchOffice();
173 stdout.Write("\n Enter the Office base installation directory [" +
174 sSuggestedHome + "]:");
175 var sHome = stdin.ReadLine();
176 if (sHome.length == 0)
178 //No user input, use default.
179 if ( ! aFileSystemObject.FolderExists(sSuggestedHome))
181 stdout.WriteLine("\n Error: Could not find directory \"" +
182 sSuggestedHome + "\" An office installation is " +
183 "required, please specify the path to a valid " +
184 "office installation.");
188 sHome = sSuggestedHome;
191 //validate the user input
192 if ( ! aFileSystemObject.FolderExists(sHome))
194 stdout.WriteLine("\n Error: The directory \"" + sHome +
195 "\" does not exist. Please specify the path to " +
196 "a valid office installation.");
200 //Check if this is a valid office installtion folder by looking for the
201 //program sub-directory
202 var progDir = sHome + "\\program";
203 if (! aFileSystemObject.FolderExists(progDir))
205 stdout.WriteLine("\n Error: Could not find directory \"" +
206 progDir + "\". An office installation is required, " +
207 "please specify the path to a valid office " +
215 function searchOffice()
217 var tmp = oo_sdk_home;
219 if (aFileSystemObject.FileExists(tmp + "\\program\\soffice.exe")) {
226 function getMakeHome()
228 var sSuggestedHome = WshSysEnv("OO_SDK_MAKE_HOME");
232 stdout.Write("\n Enter GNU make (3.79.1 or higher) tools directory [" +
233 sSuggestedHome + "]:");
234 var sHome = stdin.ReadLine();
235 if (sHome.length == 0)
237 //No user input, use default.
238 if ( ! aFileSystemObject.FolderExists(sSuggestedHome))
240 stdout.WriteLine("\n Error: Could not find directory \"" +
241 sSuggestedHome + "\". GNU make is required, " +
242 "please specify a GNU make tools directory.");
246 sHome = sSuggestedHome;
249 //validate the user input
250 if ( ! aFileSystemObject.FolderExists(sHome))
252 stdout.WriteLine("\n Error: The directory \"" + sHome +
253 "\" does not exist. GNU make is required, " +
254 "please specify a GNU make tools directory.");
258 //Check for the make executable
259 var sMakePath = sHome + "\\make.exe";
260 if (! aFileSystemObject.FileExists(sMakePath))
262 sMakePath = sHome + "\\mingw32-make.exe";
264 if (! aFileSystemObject.FileExists(sMakePath))
266 stdout.WriteLine("\n Error: Could not find \"" + sMakePath +
267 "\". GNU make is required, please specify a GNU " +
268 "make tools directory.");
275 function getZipHome()
277 var sSuggestedHome = WshSysEnv("OO_SDK_ZIP_HOME");
281 stdout.Write("\n Enter a zip (2.3 or higher) tools directory [" +
282 sSuggestedHome + "]:");
283 var sHome = stdin.ReadLine();
284 if (sHome.length == 0)
286 //No user input, use default.
287 if ( ! aFileSystemObject.FolderExists(sSuggestedHome))
289 stdout.WriteLine("\n Error: Could not find directory \"" +
290 sSuggestedHome + "\". zip is required, please " +
291 "specify a zip tools directory.");
295 sHome = sSuggestedHome;
299 //validate the user input
300 if ( ! aFileSystemObject.FolderExists(sHome))
302 stdout.WriteLine("\n Error: The directory \"" + sHome +
303 "\" does not exist. zip is required, please " +
304 "specify a zip tools directory.");
308 //Check for the make executable
309 var sZipPath = sHome + "\\zip.exe";
310 if (! aFileSystemObject.FileExists(sZipPath))
312 stdout.WriteLine("\n Error: Could not find \"" + sZipPath +
313 "\". zip is required, please specify a zip tools " +
321 function getCatHome()
323 var sSuggestedHome = WshSysEnv("OO_SDK_CAT_HOME");
327 stdout.Write("\n Enter a cat (2.0 or higher) tools directory [" +
328 sSuggestedHome + "]:");
329 var sHome = stdin.ReadLine();
330 if (sHome.length == 0)
332 //No user input, use default.
333 if ( ! aFileSystemObject.FolderExists(sSuggestedHome))
335 stdout.WriteLine("\n Error: Could not find directory \"" +
336 sSuggestedHome + "\". cat is required, please " +
337 "specify a cat tools directory." +
338 "\nYou can get cat from " +
339 "http://sourceforge.net/projects/unxutils/files/latest/download");
343 sHome = sSuggestedHome;
347 //validate the user input
348 if ( ! aFileSystemObject.FolderExists(sHome))
350 stdout.WriteLine("\n Error: The directory \"" + sHome +
351 "\" does not exist. cat is required, please " +
352 "specify a cat tools directory." +
353 "\nYou can get cat from " +
354 "http://sourceforge.net/projects/unxutils/files/latest/download");
358 //Check for the make executable
359 var sCatPath = sHome + "\\cat.exe";
360 if (! aFileSystemObject.FileExists(sCatPath))
362 stdout.WriteLine("\n Error: Could not find \"" + sCatPath +
363 "\". cat is required, please specify a cat tools " +
365 "\nYou can get cat from " +
366 "http://sourceforge.net/projects/unxutils/files/latest/download");
373 function getSedHome()
375 var sSuggestedHome = WshSysEnv("OO_SDK_SED_HOME");
379 stdout.Write("\n Enter a sed (3.02 or higher) tools directory [" +
380 sSuggestedHome + "]:");
381 var sHome = stdin.ReadLine();
382 if (sHome.length == 0)
384 //No user input, use default.
385 if ( ! aFileSystemObject.FolderExists(sSuggestedHome))
387 stdout.WriteLine("\n Error: Could not find directory \"" +
388 sSuggestedHome + "\". sed is required, please " +
389 "specify a sed tools directory." +
390 "\nYou can get sed from " +
391 "http://sourceforge.net/projects/unxutils/files/latest/download");
395 sHome = sSuggestedHome;
399 //validate the user input
400 if ( ! aFileSystemObject.FolderExists(sHome))
402 stdout.WriteLine("\n Error: The directory \"" + sHome +
403 "\" does not exist. sed is required, please " +
404 "specify a sed tools directory." +
405 "\nYou can get sed from " +
406 "http://sourceforge.net/projects/unxutils/files/latest/download");
410 //Check for the make executable
411 var sSedPath = sHome + "\\sed.exe";
412 if (! aFileSystemObject.FileExists(sSedPath))
414 stdout.WriteLine("\n Error: Could not find \"" + sSedPath +
415 "\". sed is required, please specify a sed tools " +
417 "\nYou can get sed from " +
418 "http://sourceforge.net/projects/unxutils/files/latest/download");
425 function getCppHome()
427 var sSuggestedHome = WshSysEnv("OO_SDK_CPP_HOME");
428 if (sSuggestedHome.length == 0)
432 sVC = WshShell.RegRead(regKeyVCExpress90);
437 sVC = WshShell.RegRead(regKeyVC90);
440 // check Windows SDK if VC 9
443 oo_sdk_manifest_used="true";
445 oo_sdk_windowssdk = WshShell.RegRead(regKeyWindowsSDK);
451 sVC = WshShell.RegRead(regKeyVCExpress80);
454 oo_sdk_manifest_used="true";
459 sVC = WshShell.RegRead(regKeyVC80);
462 oo_sdk_manifest_used="true";
467 sVC = WshShell.RegRead(regKeyVC71);
473 if (aFileSystemObject.FileExists(sVC + "\\cl.exe"))
474 sSuggestedHome = sVC;
481 stdout.Write("\n Enter the directory of the C++ compiler (optional) [" +
482 sSuggestedHome + "]:");
483 var sHome = stdin.ReadLine();
484 if (sHome.length == 0)
486 //No user input, check OO_SDK_CPP_HOME or suggested value
487 if ( sSuggestedHome.length == 0 ) {
490 if ( !aFileSystemObject.FolderExists(sSuggestedHome) )
492 stdout.WriteLine("\n Error: Could not find directory \"" +
493 sSuggestedHome + "\".");
499 sHome = sSuggestedHome;
502 //validate the user input
503 if ( ! aFileSystemObject.FolderExists(sHome))
505 stdout.WriteLine("\n Error: Could not find directory \"" +
512 //Check if the C++ compiler exist
513 var cl = sHome + "\\cl.exe";
514 var mt = sHome + "\\mt.exe";
516 if (! aFileSystemObject.FileExists(cl))
518 stdout.WriteLine("\n Error: Could not find the C++ compiler \""
523 if (aFileSystemObject.FileExists(mt)) {
524 oo_sdk_vc8_used="true";
530 if ( skipChoice("the C++ compiler") ) {
542 function getCliHome()
544 var sSuggestedHome = WshSysEnv("OO_SDK_CLI_HOME");
546 if (sSuggestedHome.length == 0)
549 var _ver = WshShell.RegRead(regKeyDotNet2_0);
552 sSuggestedHome = WshShell.RegRead(regKeyDotNetInstallRoot);
553 sSuggestedHome += sDirDotNet2_0;
554 if ( ! aFileSystemObject.FolderExists(sSuggestedHome))
558 if (sSuggestedHome.length == 0)
560 _ver = WshShell.RegRead(regKeyDotNet1_1);
563 sSuggestedHome = WshShell.RegRead(regKeyDotNetInstallRoot);
564 sSuggestedHome += sDirDotNet1_1;
565 if ( ! aFileSystemObject.FolderExists(sSuggestedHome))
575 stdout.Write("\n Enter the directory of the C# and VB.NET compilers (optional) [" + sSuggestedHome + "]:");
576 var sHome = stdin.ReadLine();
577 if (sHome.length == 0)
579 //No user input, check OO_SDK_CLI_HOME or suggested value
580 if ( sSuggestedHome.length == 0 ) {
583 if ( !aFileSystemObject.FolderExists(sSuggestedHome) )
585 stdout.WriteLine("\n Error: Could not find directory \"" +
586 sSuggestedHome + "\".");
592 sHome = sSuggestedHome;
596 //validate the user input
597 if ( ! aFileSystemObject.FolderExists(sHome))
599 stdout.WriteLine("\n Error: The directory \"" + sHome +
600 "\" does not exist.");
606 //Check if the C# and VB.NET compiler exist
607 var csc = sHome + "\\csc.exe";
608 var vbc = sHome + "\\vbc.exe";
610 if (! aFileSystemObject.FileExists(csc))
612 stdout.WriteLine("\n Error: Could not find the C# compiler \"" +
616 if (! aFileSystemObject.FileExists(vbc))
618 stdout.WriteLine("\n Error: Could not find the VB.NET compiler \"" +
625 if ( skipChoice("the C# and VB.NET compilers") ) {
637 function getJavaHome()
639 var sSuggestedHome = WshSysEnv("OO_SDK_JAVA_HOME");
640 if (sSuggestedHome.length == 0)
643 var currentVersion = WshShell.RegRead(regKeyJDK + "CurrentVersion");
644 if (currentVersion.length > 0)
646 sSuggestedHome = WshShell.RegRead(regKeyJDK + currentVersion +
648 if ( ! aFileSystemObject.FolderExists(sSuggestedHome) )
657 stdout.Write("\n Enter JAVA SDK (1.4.1_01 or higher) installation directory (optional) [" + sSuggestedHome + "]:");
658 var sHome = stdin.ReadLine();
659 if (sHome.length == 0)
661 //No user input, check OO_SDK_JAVA_HOME or suggested value
662 if ( sSuggestedHome.length == 0 ) {
665 if ( !aFileSystemObject.FolderExists(sSuggestedHome) )
667 stdout.WriteLine("\n Error: Could not find directory \"" +
668 sSuggestedHome + "\".");
674 sHome = sSuggestedHome;
677 //validate the user input
678 if ( ! aFileSystemObject.FolderExists(sHome))
680 stdout.WriteLine("\n Error: The directory \"" + sHome +
681 "\" does not exist.");
687 //Check if this is an sdk folder by looking for the javac compiler
688 var javacompiler = sHome + "\\bin\\javac.exe";
689 if (! aFileSystemObject.FileExists(javacompiler))
691 stdout.WriteLine("\n Error: Could not find \"" +
692 javacompiler + "\".");
698 if ( skipChoice("the Java SDK") ) {
710 function getOutputDir()
712 var defaultdir = "c:\\" + oo_sdk_name;
713 var sSuggestedDir = WshSysEnv("OO_SDK_OUT");
714 if (sSuggestedDir.length == 0)
715 sSuggestedDir = defaultdir;
721 "\n Default output directory is the \"c:\\" + oo_sdk_name + "\".\n" +
722 " Enter an existent directory if you prefer a different one. But note" +
723 " that only\n a path without spaces is allowed because of a" +
724 " limitation of gnu make. (optional) [" + sSuggestedDir + "]:");
725 var sDir = stdin.ReadLine();
726 if (sDir.length == 0)
728 //No user input, check OO_SDK_OUT or suggested value
729 if ( sSuggestedDir.length == 0 ) {
732 if (sSuggestedDir == oo_user_sdk_dir || sSuggestedDir == defaultdir) {
733 var fso = new ActiveXObject("Scripting.FileSystemObject");
734 if ( !fso.FolderExists(sSuggestedDir) )
735 fso.CreateFolder(sSuggestedDir);
737 if ( !aFileSystemObject.FolderExists(sSuggestedDir) )
739 stdout.WriteLine("\n Error: Could not find directory \"" +
740 sSuggestedDir + "\".");
746 sDir = sSuggestedDir;
750 if (sDir.indexOf(' ') != -1) {
751 stdout.WriteLine("\n Error: your specified output directory " +
752 "\"" + sDir + "\" " +
753 "contains one or more spaces.\n That " +
754 "causes problems with gnu make. Please specifiy" +
755 " a directory without spaces.");
758 //validate the user input
759 if ( ! aFileSystemObject.FolderExists(sDir))
761 stdout.WriteLine("\n Error: Could not find directory \"" +
768 if ( skipChoice("a special output directory") ) {
780 function getAutoDeployment()
782 var sSuggestedAuto = WshSysEnv("SDK_AUTO_DEPLOYMENT");
783 if (sSuggestedAuto.length == 0)
784 sSuggestedAuto = "YES";
788 stdout.Write("\n Automatic deployment of UNO components (YES/NO) ["+
789 sSuggestedAuto + "]:");
790 var sAuto = stdin.ReadLine();
791 if (sAuto.length == 0)
792 sAuto = sSuggestedAuto;
795 sAutoU = sAuto.toUpperCase();
796 if (sAutoU != "YES" && sAutoU != "NO")
798 stdout.WriteLine("\n Error: The value \"" + sAuto + "\" is " +
799 "invalid. Please answer YES or NO.")
808 //The function uses sp2bv.exe to obtain a file URL from a
809 //system path. The URL is already escaped for use as bootstrap variable.
810 //($ -> \$). Then the resulting string is escaped for use in a bat file.
811 //That is % signs are made to double % (% -> %%);
812 function makeBootstrapFileUrl(systemPath)
814 var oExec = WshShell.Exec("sp2bv.exe \"" + systemPath + "\"");
818 if (!oExec.StdOut.AtEndOfStream)
820 var next = oExec.StdOut.Read(1);
832 function writeBatFile(fdir, file)
834 var fso = new ActiveXObject("Scripting.FileSystemObject");
835 if ( !fso.FolderExists(fdir) )
836 fso.CreateFolder(fdir);
837 var newFile = fso.CreateTextFile(file, true);
841 "REM This script sets all environment variables, which\n" +
842 "REM are necessary for building the examples of the Office Development Kit.\n" +
843 "REM The Script was developed for the operating systems Windows.\n" +
844 "REM The SDK name\n" +
845 "REM Example: set OO_SDK_NAME=libreoffice3.4_sdk\n" +
846 "set OO_SDK_NAME=" + oo_sdk_name +
848 "REM Installation directory of the Software Development Kit.\n" +
849 "REM Example: set OO_SDK_HOME=C:\\Program Files\\LibreOffice 3\\sdk\n" +
850 "set OO_SDK_HOME=" + oo_sdk_home +
852 "REM Office installation directory.\n" +
853 "REM Example: set OFFICE_HOME=C:\\Program Files\\LibreOffice 3\n" +
854 "set OFFICE_HOME=" + office_home +
856 "REM Directory of the make command.\n" +
857 "REM Example: set OO_SDK_MAKE_HOME=D:\\NextGenerationMake\\make\n" +
858 "set OO_SDK_MAKE_HOME=" + oo_sdk_make_home +
860 "REM Directory of the zip tool.\n" +
861 "REM Example: set OO_SDK_ZIP_HOME=D:\\infozip\\bin\n" +
862 "set OO_SDK_ZIP_HOME=" + oo_sdk_zip_home +
864 "REM Directory of the cat tool.\n" +
865 "REM Example: set OO_SDK_CAT_HOME=C:\\UnxUtils\\usr\\local\\wbin\n" +
866 "set OO_SDK_CAT_HOME=" + oo_sdk_cat_home +
868 "REM Directory of the sed tool.\n" +
869 "REM Example: set OO_SDK_SED_HOME=C:\\UnxUtils\\usr\\local\\wbin\n" +
870 "set OO_SDK_SED_HOME=" + oo_sdk_sed_home +
872 "REM Directory of the C++ compiler.\n" +
873 "REM Example:set OO_SDK_CPP_HOME=C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\bin\n" +
874 "set OO_SDK_CPP_HOME=" + oo_sdk_cpp_home +
875 "\nset CPP_MANIFEST=" + oo_sdk_manifest_used +
876 "\nset CPP_WINDOWS_SDK=" + oo_sdk_windowssdk +
878 "REM Directory of the C# and VB.NET compilers.\n" +
879 "REM Example:set OO_SDK_CLI_HOME=C:\\WINXP\\Microsoft.NET\\Framework\\v1.0.3705\n" +
880 "set OO_SDK_CLI_HOME=" + oo_sdk_cli_home +
882 "REM Java SDK installation directory.\n" +
883 "REM Example: set OO_SDK_JAVA_HOME=C:\\Program Files\\Java\\jdk1.6.0_05\n" +
884 "set OO_SDK_JAVA_HOME=" + oo_sdk_java_home +
886 "REM Special output directory\n" +
887 "REM Example: set OO_SDK_OUT=C:\\" + oo_sdk_name + "\n" +
888 "set OO_SDK_OUT=" + oo_sdk_out +
890 "REM Automatic deployment\n" +
891 "REM Example: set SDK_AUTO_DEPLOYMENT=YES\n" +
892 "set SDK_AUTO_DEPLOYMENT=" + sdk_auto_deployment +
894 "REM Check installation path for the Office Development Kit.\n" +
895 "if not defined OO_SDK_HOME (\n" +
896 " echo Error: the variable OO_SDK_HOME is missing!\n" +
900 "REM Check installation path for the office.\n" +
901 "REM if not defined OFFICE_HOME (\n" +
902 "REM echo Error: the variable OFFICE_HOME is missing!\n" +
903 "REM goto :error\n" +
906 "REM Check installation path for GNU make.\n" +
907 "if not defined OO_SDK_MAKE_HOME (\n" +
908 " echo Error: the variable OO_SDK_MAKE_HOME is missing!\n" +
912 "REM Check installation path for the zip tool.\n" +
913 "if not defined OO_SDK_ZIP_HOME (\n" +
914 " echo Error: the variable OO_SDK_ZIP_HOME is missing!\n" +
918 "REM Check installation path for the cat tool.\n" +
919 "if not defined OO_SDK_CAT_HOME (\n" +
920 " echo Error: the variable OO_SDK_CAT_HOME is missing!\n" +
924 "REM Check installation path for the sed tool.\n" +
925 "if not defined OO_SDK_SED_HOME (\n" +
926 " echo Error: the variable OO_SDK_SED_HOME is missing!\n" +
930 "REM Set library path. \n" +
931 "set LIB=%OO_SDK_HOME%\\lib;%LIB%\n" +
932 "if defined CPP_WINDOWS_SDK (\n" +
933 " set LIB=%LIB%;%CPP_WINDOWS_SDK%\\lib\n" +
936 "REM Set office program path.\n" +
937 "if defined OFFICE_HOME (\n" +
938 " set OFFICE_PROGRAM_PATH=%OFFICE_HOME%\\program\n" +
941 "REM Set UNO path, necessary to ensure that the cpp examples using the\n" +
942 "REM new UNO bootstrap mechanism use the configured office installation\n" +
943 "REM (only set when using an Office).\n" +
944 "if defined OFFICE_HOME (\n" +
945 " set UNO_PATH=%OFFICE_PROGRAM_PATH%\n" +
948 "set OO_SDK_URE_BIN_DIR=%OFFICE_PROGRAM_PATH%\n" +
949 "set OO_SDK_URE_LIB_DIR=%OFFICE_PROGRAM_PATH%\n" +
950 "set OO_SDK_URE_JAVA_DIR=%OFFICE_PROGRAM_PATH%\\classes\n" +
951 "set OO_SDK_OFFICE_BIN_DIR=%OFFICE_PROGRAM_PATH%\n" +
952 "set OO_SDK_OFFICE_LIB_DIR=%OFFICE_PROGRAM_PATH%\n" +
953 "set OO_SDK_OFFICE_JAVA_DIR=%OFFICE_PROGRAM_PATH%\\classes\n" +
955 "REM Set classpath\n" +
956 "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" +
957 "REM if defined OFFICE_HOME (\n" +
958 "REM set CLASSPATH=%CLASSPATH%;%OO_SDK_OFFICE_JAVA_DIR%\\unoil.jar\n" +
961 "REM Add directory of the SDK tools to the path.\n" +
962 "set PATH=%OO_SDK_HOME%\\bin;%OO_SDK_URE_BIN_DIR%;%OO_SDK_OFFICE_BIN_DIR%;%OO_SDK_HOME%\\WINexample.out\\bin;%PATH%\n" +
964 "REM Set PATH appropriate to the output directory\n" +
965 "if defined OO_SDK_OUT set PATH=%OO_SDK_OUT%\\WINexample.out\\bin;%PATH%\n" +
966 "if not defined OO_SDK_OUT set PATH=%OO_SDK_HOME%\\WINexample.out\\bin;%PATH%\n" +
968 "REM Add directory of the command make to the path, if necessary.\n" +
969 "if defined OO_SDK_MAKE_HOME set PATH=%OO_SDK_MAKE_HOME%;%PATH%\n" +
971 "REM Add directory of the zip tool to the path, if necessary.\n" +
972 "if defined OO_SDK_ZIP_HOME set PATH=%OO_SDK_ZIP_HOME%;%PATH%\n" +
974 "REM Add directory of the cat tool to the path, if necessary.\n" +
975 "if defined OO_SDK_CAT_HOME set PATH=%OO_SDK_CAT_HOME%;%PATH%\n" +
977 "REM Add directory of the sed tool to the path, if necessary.\n" +
978 "if defined OO_SDK_SED_HOME set PATH=%OO_SDK_SED_HOME%;%PATH%\n" +
980 "REM Add directory of the C++ compiler to the path, if necessary.\n" +
981 "if defined OO_SDK_CPP_HOME set PATH=%OO_SDK_CPP_HOME%;%PATH%\n" +
983 "REM Add directory of the Win SDK to the path, if necessary.\n" +
984 "if defined CPP_WINDOWS_SDK set PATH=%CPP_WINDOWS_SDK%\\bin;%PATH%\n" +
985 "if defined CPP_WINDOWS_SDK set INCLUDE=%CPP_WINDOWS_SDK%\\Include;%INCLUDE%\n" +
986 "REM Add directory of the C# and VB.NET compilers to the path, if necessary.\n" +
987 "if defined OO_SDK_CLI_HOME set PATH=%OO_SDK_CLI_HOME%;%PATH%\n" +
989 "REM Add directory of the Java tools to the path, if necessary.\n" +
990 "if defined OO_SDK_JAVA_HOME set PATH=%OO_SDK_JAVA_HOME%\\bin;%OO_SDK_JAVA_HOME%\\jre\\bin;%PATH%\n" +
992 "REM Set environment for C++ compiler tools, if necessary.\n" +
993 "if defined OO_SDK_CPP_HOME call \"%OO_SDK_CPP_HOME%\\VCVARS32.bat\"\n" +
995 "REM Set title to identify the prepared shell.\n" +
996 "title Shell prepared for SDK\n" +
997 "\nREM Prepare shell with all necessary environment variables.\n" +
999 "echo ******************************************************************\n" +
1001 "echo * SDK environment is prepared for Windows\n" +
1003 "echo * SDK = %OO_SDK_HOME%\n" +
1004 "echo * Office = %OFFICE_HOME%\n" +
1005 "echo * Make = %OO_SDK_MAKE_HOME%\n" +
1006 "echo * Zip = %OO_SDK_ZIP_HOME%\n" +
1007 "echo * cat = %OO_SDK_CAT_HOME%\n" +
1008 "echo * sed = %OO_SDK_SED_HOME%\n" +
1009 "echo * C++ Compiler = %OO_SDK_CPP_HOME%\n" +
1010 "echo * C# and VB.NET compilers = %OO_SDK_CLI_HOME%\n" +
1011 "echo * Java = %OO_SDK_JAVA_HOME%\n" +
1012 "echo * Special Output directory = %OO_SDK_OUT%\n" +
1013 "echo * Auto deployment = %SDK_AUTO_DEPLOYMENT%\n" +
1015 "echo ******************************************************************\n" +
1020 "Error: Please insert the necessary environment variables into the batch file.\n" +