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_dotnet_root=getDotnetRoot();
66 var oo_sdk_java_home=getJavaHome();
67 var oo_sdk_out=getOutputDir();
68 var sdk_auto_deployment=getAutoDeployment();
70 writeBatFile(oo_user_sdk_dir, oo_user_sdk_env_script);
73 "\n ******************************************************************\n" +
74 " * ... \"" + oo_user_sdk_env_script + "\"\n" +
75 " * batch file has been prepared.\n" +
76 " * This batch file will be used in the future to prepare your\n" +
77 " * personal configured SDK environment.\n" +
78 " ******************************************************************\n\n");
79 // " * For each time you want to use this configured SDK environment,\n" +
80 // " * you have to run the \"setsdkenv_windows.bat\" file in a new shell!\n" +
82 // done -------------------------------------------------------------------------
85 function skipChoice(msg)
87 stdout.Write("\n Do you want to skip the choice of " + msg + " (YES/NO) [YES]:");
88 var sChoice = stdin.ReadLine();
89 if (sChoice == "" || sChoice.toLowerCase() == "yes")
97 var sSuggestedHome = WshSysEnv("OO_SDK_HOME");
98 if (sSuggestedHome.length == 0) {
99 var scriptname = WScript.ScriptFullName;
100 sSuggestedHome = scriptname.substr(0,scriptname.length-10);
105 stdout.Write("\n Enter the Office Software Development Kit directory [" +
106 sSuggestedHome + "]:");
107 var sHome = stdin.ReadLine();
108 if (sHome.length == 0)
110 //No user input, use default.
111 if ( ! aFileSystemObject.FolderExists(sSuggestedHome))
113 stdout.WriteLine("\n Error: Could not find directory \"" +
114 sSuggestedHome + "\". An SDK is required, please" +
115 " specify the path to a valid installation.");
118 sHome = sSuggestedHome;
122 //validate the user input
123 if ( ! aFileSystemObject.FolderExists(sHome))
125 stdout.WriteLine("\n Error: The directory \"" + sHome +
126 "\" does not exist. Please enter the path to a" +
127 "valid SDK installation.");
131 //Check if this is an sdk folder by looking for the examples sub - dir
132 var examplesDir = sHome + "\\examples";
133 if (! aFileSystemObject.FolderExists(examplesDir))
135 stdout.WriteLine("\n Error: Could not find directory \"" +
136 examplesDir + "\". An SDK is required, please specify " +
137 "the path to a valid SDK installation.");
145 function getOfficeHome()
147 var sSuggestedHome = WshSysEnv("OFFICE_HOME");
148 if (sSuggestedHome.length == 0)
151 sSuggestedHome = WshShell.RegRead(regKeyOfficeCurrentUser);
152 //The registry entry points to the program folder but we need the
153 //installation folder
155 if (sSuggestedHome.length == 0)
158 sSuggestedHome = WshShell.RegRead(regKeyOfficeLocaleMachine);
159 //The registry entry points to the program folder but we need
160 //the installation folder
165 if ((index = sSuggestedHome.lastIndexOf("\\")) != -1)
166 sSuggestedHome = sSuggestedHome.substr(0, index);
168 if (sSuggestedHome.length == 0)
169 sSuggestedHome = searchOffice();
174 stdout.Write("\n Enter the Office base installation directory [" +
175 sSuggestedHome + "]:");
176 var sHome = stdin.ReadLine();
177 if (sHome.length == 0)
179 //No user input, use default.
180 if ( ! aFileSystemObject.FolderExists(sSuggestedHome))
182 stdout.WriteLine("\n Error: Could not find directory \"" +
183 sSuggestedHome + "\" An office installation is " +
184 "required, please specify the path to a valid " +
185 "office installation.");
189 sHome = sSuggestedHome;
192 //validate the user input
193 if ( ! aFileSystemObject.FolderExists(sHome))
195 stdout.WriteLine("\n Error: The directory \"" + sHome +
196 "\" does not exist. Please specify the path to " +
197 "a valid office installation.");
201 //Check if this is a valid office installation folder by looking for the
202 //program sub-directory
203 var progDir = sHome + "\\program";
204 if (! aFileSystemObject.FolderExists(progDir))
206 stdout.WriteLine("\n Error: Could not find directory \"" +
207 progDir + "\". An office installation is required, " +
208 "please specify the path to a valid office " +
216 function searchOffice()
218 var tmp = oo_sdk_home;
220 if (aFileSystemObject.FileExists(tmp + "\\program\\soffice.exe")) {
227 function getMakeHome()
229 var sSuggestedHome = WshSysEnv("OO_SDK_MAKE_HOME");
233 stdout.Write("\n Enter GNU make (3.79.1 or higher) tools directory [" +
234 sSuggestedHome + "]:");
235 var sHome = stdin.ReadLine();
236 if (sHome.length == 0)
238 //No user input, use default.
239 if ( ! aFileSystemObject.FolderExists(sSuggestedHome))
241 stdout.WriteLine("\n Error: Could not find directory \"" +
242 sSuggestedHome + "\". GNU make is required, " +
243 "please specify a GNU make tools directory.");
247 sHome = sSuggestedHome;
250 //validate the user input
251 if ( ! aFileSystemObject.FolderExists(sHome))
253 stdout.WriteLine("\n Error: The directory \"" + sHome +
254 "\" does not exist. GNU make is required, " +
255 "please specify a GNU make tools directory.");
259 //Check for the make executable
260 var sMakePath = sHome + "\\make.exe";
261 if (! aFileSystemObject.FileExists(sMakePath))
263 sMakePath = sHome + "\\mingw32-make.exe";
265 if (! aFileSystemObject.FileExists(sMakePath))
267 stdout.WriteLine("\n Error: Could not find \"" + sMakePath +
268 "\". GNU make is required, please specify a GNU " +
269 "make tools directory.");
276 function getZipHome()
278 var sSuggestedHome = WshSysEnv("OO_SDK_ZIP_HOME");
282 stdout.Write("\n Enter a zip (2.3 or higher) tools directory [" +
283 sSuggestedHome + "]:");
284 var sHome = stdin.ReadLine();
285 if (sHome.length == 0)
287 //No user input, use default.
288 if ( ! aFileSystemObject.FolderExists(sSuggestedHome))
290 stdout.WriteLine("\n Error: Could not find directory \"" +
291 sSuggestedHome + "\". zip is required, please " +
292 "specify a zip tools directory.");
296 sHome = sSuggestedHome;
300 //validate the user input
301 if ( ! aFileSystemObject.FolderExists(sHome))
303 stdout.WriteLine("\n Error: The directory \"" + sHome +
304 "\" does not exist. zip is required, please " +
305 "specify a zip tools directory.");
309 //Check for the make executable
310 var sZipPath = sHome + "\\zip.exe";
311 if (! aFileSystemObject.FileExists(sZipPath))
313 stdout.WriteLine("\n Error: Could not find \"" + sZipPath +
314 "\". zip is required, please specify a zip tools " +
322 function getCatHome()
324 var sSuggestedHome = WshSysEnv("OO_SDK_CAT_HOME");
328 stdout.Write("\n Enter a cat (2.0 or higher) tools directory [" +
329 sSuggestedHome + "]:");
330 var sHome = stdin.ReadLine();
331 if (sHome.length == 0)
333 //No user input, use default.
334 if ( ! aFileSystemObject.FolderExists(sSuggestedHome))
336 stdout.WriteLine("\n Error: Could not find directory \"" +
337 sSuggestedHome + "\". cat is required, please " +
338 "specify a cat tools directory." +
339 "\nYou can get cat from " +
340 "http://sourceforge.net/projects/unxutils/files/latest/download");
344 sHome = sSuggestedHome;
348 //validate the user input
349 if ( ! aFileSystemObject.FolderExists(sHome))
351 stdout.WriteLine("\n Error: The directory \"" + sHome +
352 "\" does not exist. cat is required, please " +
353 "specify a cat tools directory." +
354 "\nYou can get cat from " +
355 "http://sourceforge.net/projects/unxutils/files/latest/download");
359 //Check for the make executable
360 var sCatPath = sHome + "\\cat.exe";
361 if (! aFileSystemObject.FileExists(sCatPath))
363 stdout.WriteLine("\n Error: Could not find \"" + sCatPath +
364 "\". cat is required, please specify a cat tools " +
366 "\nYou can get cat from " +
367 "http://sourceforge.net/projects/unxutils/files/latest/download");
374 function getSedHome()
376 var sSuggestedHome = WshSysEnv("OO_SDK_SED_HOME");
380 stdout.Write("\n Enter a sed (3.02 or higher) tools directory [" +
381 sSuggestedHome + "]:");
382 var sHome = stdin.ReadLine();
383 if (sHome.length == 0)
385 //No user input, use default.
386 if ( ! aFileSystemObject.FolderExists(sSuggestedHome))
388 stdout.WriteLine("\n Error: Could not find directory \"" +
389 sSuggestedHome + "\". sed is required, please " +
390 "specify a sed tools directory." +
391 "\nYou can get sed from " +
392 "http://sourceforge.net/projects/unxutils/files/latest/download");
396 sHome = sSuggestedHome;
400 //validate the user input
401 if ( ! aFileSystemObject.FolderExists(sHome))
403 stdout.WriteLine("\n Error: The directory \"" + sHome +
404 "\" does not exist. sed is required, please " +
405 "specify a sed tools directory." +
406 "\nYou can get sed from " +
407 "http://sourceforge.net/projects/unxutils/files/latest/download");
411 //Check for the make executable
412 var sSedPath = sHome + "\\sed.exe";
413 if (! aFileSystemObject.FileExists(sSedPath))
415 stdout.WriteLine("\n Error: Could not find \"" + sSedPath +
416 "\". sed is required, please specify a sed tools " +
418 "\nYou can get sed from " +
419 "http://sourceforge.net/projects/unxutils/files/latest/download");
426 function getCppHome()
428 var sSuggestedHome = WshSysEnv("OO_SDK_CPP_HOME");
429 if (sSuggestedHome.length == 0)
433 sVC = WshShell.RegRead(regKeyVCExpress90);
438 sVC = WshShell.RegRead(regKeyVC90);
441 // check Windows SDK if VC 9
444 oo_sdk_manifest_used="true";
446 oo_sdk_windowssdk = WshShell.RegRead(regKeyWindowsSDK);
452 sVC = WshShell.RegRead(regKeyVCExpress80);
455 oo_sdk_manifest_used="true";
460 sVC = WshShell.RegRead(regKeyVC80);
463 oo_sdk_manifest_used="true";
468 sVC = WshShell.RegRead(regKeyVC71);
474 if (aFileSystemObject.FileExists(sVC + "\\cl.exe"))
475 sSuggestedHome = sVC;
482 stdout.Write("\n Enter the directory of the C++ compiler (optional) [" +
483 sSuggestedHome + "]:");
484 var sHome = stdin.ReadLine();
485 if (sHome.length == 0)
487 //No user input, check OO_SDK_CPP_HOME or suggested value
488 if ( sSuggestedHome.length == 0 ) {
491 if ( !aFileSystemObject.FolderExists(sSuggestedHome) )
493 stdout.WriteLine("\n Error: Could not find directory \"" +
494 sSuggestedHome + "\".");
500 sHome = sSuggestedHome;
503 //validate the user input
504 if ( ! aFileSystemObject.FolderExists(sHome))
506 stdout.WriteLine("\n Error: Could not find directory \"" +
513 //Check if the C++ compiler exist
514 var cl = sHome + "\\cl.exe";
515 var mt = sHome + "\\mt.exe";
517 if (! aFileSystemObject.FileExists(cl))
519 stdout.WriteLine("\n Error: Could not find the C++ compiler \""
524 if (aFileSystemObject.FileExists(mt)) {
525 oo_sdk_vc8_used="true";
531 if ( skipChoice("the C++ compiler") ) {
543 function getCliHome()
545 var sSuggestedHome = WshSysEnv("OO_SDK_CLI_HOME");
547 if (sSuggestedHome.length == 0)
550 var _ver = WshShell.RegRead(regKeyDotNet2_0);
553 sSuggestedHome = WshShell.RegRead(regKeyDotNetInstallRoot);
554 sSuggestedHome += sDirDotNet2_0;
555 if ( ! aFileSystemObject.FolderExists(sSuggestedHome))
559 if (sSuggestedHome.length == 0)
561 _ver = WshShell.RegRead(regKeyDotNet1_1);
564 sSuggestedHome = WshShell.RegRead(regKeyDotNetInstallRoot);
565 sSuggestedHome += sDirDotNet1_1;
566 if ( ! aFileSystemObject.FolderExists(sSuggestedHome))
576 stdout.Write("\n Enter the directory of the C# and VB.NET compilers (optional) [" + sSuggestedHome + "]:");
577 var sHome = stdin.ReadLine();
578 if (sHome.length == 0)
580 //No user input, check OO_SDK_CLI_HOME or suggested value
581 if ( sSuggestedHome.length == 0 ) {
584 if ( !aFileSystemObject.FolderExists(sSuggestedHome) )
586 stdout.WriteLine("\n Error: Could not find directory \"" +
587 sSuggestedHome + "\".");
593 sHome = sSuggestedHome;
597 //validate the user input
598 if ( ! aFileSystemObject.FolderExists(sHome))
600 stdout.WriteLine("\n Error: The directory \"" + sHome +
601 "\" does not exist.");
607 //Check if the C# and VB.NET compiler exist
608 var csc = sHome + "\\csc.exe";
609 var vbc = sHome + "\\vbc.exe";
611 if (! aFileSystemObject.FileExists(csc))
613 stdout.WriteLine("\n Error: Could not find the C# compiler \"" +
617 if (! aFileSystemObject.FileExists(vbc))
619 stdout.WriteLine("\n Error: Could not find the VB.NET compiler \"" +
626 if ( skipChoice("the C# and VB.NET compilers") ) {
638 function getDotnetRoot()
640 var sSuggestedHome = WshSysEnv("OO_SDK_DOTNET_ROOT");
641 if (sSuggestedHome.length == 0)
644 var sWhereResult = WshShell.Exec("where.exe dotnet.exe").StdOut.ReadLine();
645 if (sWhereResult.length > 0)
647 sSuggestedHome = sWhereResult;
648 if (!aFileSystemObject.FolderExists(sSuggestedHome))
657 stdout.Write("\n Enter .NET SDK (8 or higher) installation directory (optional) [" + sSuggestedHome + "]:");
658 var sHome = stdin.ReadLine();
659 if (sHome.length == 0)
661 //No user input, check OO_SDK_DOTNET_ROOT 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 dotnet executable
688 var dotnetExe = sHome + "\\dotnet.exe";
689 if (! aFileSystemObject.FileExists(dotnetExe))
691 stdout.WriteLine("\n Error: Could not find \"" +
698 if ( skipChoice("the .NET SDK") ) {
710 function getJavaHome()
712 var sSuggestedHome = WshSysEnv("OO_SDK_JAVA_HOME");
713 if (sSuggestedHome.length == 0)
716 var currentVersion = WshShell.RegRead(regKeyJDK + "CurrentVersion");
717 if (currentVersion.length > 0)
719 sSuggestedHome = WshShell.RegRead(regKeyJDK + currentVersion +
721 if ( ! aFileSystemObject.FolderExists(sSuggestedHome) )
730 stdout.Write("\n Enter JAVA SDK (1.6 or higher) installation directory (optional) [" + sSuggestedHome + "]:");
731 var sHome = stdin.ReadLine();
732 if (sHome.length == 0)
734 //No user input, check OO_SDK_JAVA_HOME or suggested value
735 if ( sSuggestedHome.length == 0 ) {
738 if ( !aFileSystemObject.FolderExists(sSuggestedHome) )
740 stdout.WriteLine("\n Error: Could not find directory \"" +
741 sSuggestedHome + "\".");
747 sHome = sSuggestedHome;
750 //validate the user input
751 if ( ! aFileSystemObject.FolderExists(sHome))
753 stdout.WriteLine("\n Error: The directory \"" + sHome +
754 "\" does not exist.");
760 //Check if this is an sdk folder by looking for the javac compiler
761 var javacompiler = sHome + "\\bin\\javac.exe";
762 if (! aFileSystemObject.FileExists(javacompiler))
764 stdout.WriteLine("\n Error: Could not find \"" +
765 javacompiler + "\".");
771 if ( skipChoice("the Java SDK") ) {
783 function getOutputDir()
785 var defaultdir = "c:\\" + oo_sdk_name;
786 var sSuggestedDir = WshSysEnv("OO_SDK_OUT");
787 if (sSuggestedDir.length == 0)
788 sSuggestedDir = defaultdir;
794 "\n Default output directory is the \"c:\\" + oo_sdk_name + "\".\n" +
795 " Enter an existent directory if you prefer a different one. But note" +
796 " that only\n a path without spaces is allowed because of a" +
797 " limitation of gnu make. (optional) [" + sSuggestedDir + "]:");
798 var sDir = stdin.ReadLine();
799 if (sDir.length == 0)
801 //No user input, check OO_SDK_OUT or suggested value
802 if ( sSuggestedDir.length == 0 ) {
805 if (sSuggestedDir == oo_user_sdk_dir || sSuggestedDir == defaultdir) {
806 var fso = new ActiveXObject("Scripting.FileSystemObject");
807 if ( !fso.FolderExists(sSuggestedDir) )
808 fso.CreateFolder(sSuggestedDir);
810 if ( !aFileSystemObject.FolderExists(sSuggestedDir) )
812 stdout.WriteLine("\n Error: Could not find directory \"" +
813 sSuggestedDir + "\".");
819 sDir = sSuggestedDir;
823 if (sDir.indexOf(' ') != -1) {
824 stdout.WriteLine("\n Error: your specified output directory " +
825 "\"" + sDir + "\" " +
826 "contains one or more spaces.\n That " +
827 "causes problems with gnu make. Please specify" +
828 " a directory without spaces.");
831 //validate the user input
832 if ( ! aFileSystemObject.FolderExists(sDir))
834 stdout.WriteLine("\n Error: Could not find directory \"" +
841 if ( skipChoice("a special output directory") ) {
853 function getAutoDeployment()
855 var sSuggestedAuto = WshSysEnv("SDK_AUTO_DEPLOYMENT");
856 if (sSuggestedAuto.length == 0)
857 sSuggestedAuto = "YES";
861 stdout.Write("\n Automatic deployment of UNO components (YES/NO) ["+
862 sSuggestedAuto + "]:");
863 var sAuto = stdin.ReadLine();
864 if (sAuto.length == 0)
865 sAuto = sSuggestedAuto;
868 sAutoU = sAuto.toUpperCase();
869 if (sAutoU != "YES" && sAutoU != "NO")
871 stdout.WriteLine("\n Error: The value \"" + sAuto + "\" is " +
872 "invalid. Please answer YES or NO.")
881 //The function uses sp2bv.exe to obtain a file URL from a
882 //system path. The URL is already escaped for use as bootstrap variable.
883 //($ -> \$). Then the resulting string is escaped for use in a bat file.
884 //That is % signs are made to double % (% -> %%);
885 function makeBootstrapFileUrl(systemPath)
887 var oExec = WshShell.Exec("sp2bv.exe \"" + systemPath + "\"");
891 if (!oExec.StdOut.AtEndOfStream)
893 var next = oExec.StdOut.Read(1);
905 function writeBatFile(fdir, file)
907 var fso = new ActiveXObject("Scripting.FileSystemObject");
908 if ( !fso.FolderExists(fdir) )
909 fso.CreateFolder(fdir);
910 var newFile = fso.CreateTextFile(file, true);
914 "REM This script sets all environment variables, which\n" +
915 "REM are necessary for building the examples of the Office Development Kit.\n" +
916 "REM The Script was developed for the operating systems Windows.\n" +
917 "REM The SDK name\n" +
918 "REM Example: set OO_SDK_NAME=libreoffice3.4_sdk\n" +
919 "set OO_SDK_NAME=" + oo_sdk_name +
921 "REM Installation directory of the Software Development Kit.\n" +
922 "REM Example: set OO_SDK_HOME=C:\\Program Files\\LibreOffice 3\\sdk\n" +
923 "set OO_SDK_HOME=" + oo_sdk_home +
925 "REM Office installation directory.\n" +
926 "REM Example: set OFFICE_HOME=C:\\Program Files\\LibreOffice 3\n" +
927 "set OFFICE_HOME=" + office_home +
929 "REM Directory of the make command.\n" +
930 "REM Example: set OO_SDK_MAKE_HOME=D:\\NextGenerationMake\\make\n" +
931 "set OO_SDK_MAKE_HOME=" + oo_sdk_make_home +
933 "REM Directory of the zip tool.\n" +
934 "REM Example: set OO_SDK_ZIP_HOME=D:\\infozip\\bin\n" +
935 "set OO_SDK_ZIP_HOME=" + oo_sdk_zip_home +
937 "REM Directory of the cat tool.\n" +
938 "REM Example: set OO_SDK_CAT_HOME=C:\\UnxUtils\\usr\\local\\wbin\n" +
939 "set OO_SDK_CAT_HOME=" + oo_sdk_cat_home +
941 "REM Directory of the sed tool.\n" +
942 "REM Example: set OO_SDK_SED_HOME=C:\\UnxUtils\\usr\\local\\wbin\n" +
943 "set OO_SDK_SED_HOME=" + oo_sdk_sed_home +
945 "REM Directory of the C++ compiler.\n" +
946 "REM Example:set OO_SDK_CPP_HOME=C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\bin\n" +
947 "set OO_SDK_CPP_HOME=" + oo_sdk_cpp_home +
948 "\nset CPP_MANIFEST=" + oo_sdk_manifest_used +
949 "\nset CPP_WINDOWS_SDK=" + oo_sdk_windowssdk +
951 "REM Directory of the C# and VB.NET compilers.\n" +
952 "REM Example:set OO_SDK_CLI_HOME=C:\\WINXP\\Microsoft.NET\\Framework\\v1.0.3705\n" +
953 "set OO_SDK_CLI_HOME=" + oo_sdk_cli_home +
955 "REM .NET SDK installation directory.\n" +
956 "REM Example: set OO_SDK_DOTNET_ROOT=C:\\Program Files\\Java\\jdk1.6.0_05\n" +
957 "set OO_SDK_DOTNET_ROOT=" + oo_sdk_dotnet_root +
959 "REM Java SDK installation directory.\n" +
960 "REM Example: set OO_SDK_JAVA_HOME=C:\\Program Files\\Java\\jdk1.6.0_05\n" +
961 "set OO_SDK_JAVA_HOME=" + oo_sdk_java_home +
963 "REM Special output directory\n" +
964 "REM Example: set OO_SDK_OUT=C:\\" + oo_sdk_name + "\n" +
965 "set OO_SDK_OUT=" + oo_sdk_out +
967 "REM Automatic deployment\n" +
968 "REM Example: set SDK_AUTO_DEPLOYMENT=YES\n" +
969 "set SDK_AUTO_DEPLOYMENT=" + sdk_auto_deployment +
971 "REM Check installation path for the Office Development Kit.\n" +
972 "if not defined OO_SDK_HOME (\n" +
973 " echo Error: the variable OO_SDK_HOME is missing!\n" +
977 "REM Check installation path for the office.\n" +
978 "REM if not defined OFFICE_HOME (\n" +
979 "REM echo Error: the variable OFFICE_HOME is missing!\n" +
980 "REM goto :error\n" +
983 "REM Check installation path for GNU make.\n" +
984 "if not defined OO_SDK_MAKE_HOME (\n" +
985 " echo Error: the variable OO_SDK_MAKE_HOME is missing!\n" +
989 "REM Check installation path for the zip tool.\n" +
990 "if not defined OO_SDK_ZIP_HOME (\n" +
991 " echo Error: the variable OO_SDK_ZIP_HOME is missing!\n" +
995 "REM Check installation path for the cat tool.\n" +
996 "if not defined OO_SDK_CAT_HOME (\n" +
997 " echo Error: the variable OO_SDK_CAT_HOME is missing!\n" +
1001 "REM Check installation path for the sed tool.\n" +
1002 "if not defined OO_SDK_SED_HOME (\n" +
1003 " echo Error: the variable OO_SDK_SED_HOME is missing!\n" +
1007 "REM Set library path. \n" +
1008 "set \"LIB=%OO_SDK_HOME%\\lib;%LIB%\"\n" +
1009 "if defined CPP_WINDOWS_SDK (\n" +
1010 " set \"LIB=%LIB%;%CPP_WINDOWS_SDK%\\lib\"\n" +
1013 "REM Set office program path.\n" +
1014 "if defined OFFICE_HOME (\n" +
1015 " set OFFICE_PROGRAM_PATH=%OFFICE_HOME%\\program\n" +
1018 "REM Set UNO path, necessary to ensure that the cpp examples using the\n" +
1019 "REM new UNO bootstrap mechanism use the configured office installation\n" +
1020 "REM (only set when using an Office).\n" +
1021 "if defined OFFICE_HOME (\n" +
1022 " set UNO_PATH=%OFFICE_PROGRAM_PATH%\n" +
1025 "set OO_SDK_URE_BIN_DIR=%OFFICE_PROGRAM_PATH%\n" +
1026 "set OO_SDK_URE_LIB_DIR=%OFFICE_PROGRAM_PATH%\n" +
1027 "set OO_SDK_URE_JAVA_DIR=%OFFICE_PROGRAM_PATH%\\classes\n" +
1028 "set OO_SDK_URE_DOTNET_DIR=%OFFICE_PROGRAM_PATH%\\dotnet\n" +
1029 "set OO_SDK_OFFICE_BIN_DIR=%OFFICE_PROGRAM_PATH%\n" +
1030 "set OO_SDK_OFFICE_LIB_DIR=%OFFICE_PROGRAM_PATH%\n" +
1031 "set OO_SDK_OFFICE_JAVA_DIR=%OFFICE_PROGRAM_PATH%\\classes\n" +
1032 "set OO_SDK_OFFICE_DOTNET_DIR=%OFFICE_PROGRAM_PATH%\\dotnet\n" +
1034 "REM Set classpath\n" +
1035 "set CLASSPATH=%OO_SDK_URE_JAVA_DIR%\\libreoffice.jar;%OO_SDK_URE_JAVA_DIR%\\unoloader.jar\n" +
1037 "REM Add directory of the SDK tools to the path.\n" +
1038 "set PATH=%OO_SDK_HOME%\\bin;%OO_SDK_URE_BIN_DIR%;%OO_SDK_OFFICE_BIN_DIR%;%OO_SDK_HOME%\\WINexample.out\\bin;%PATH%\n" +
1040 "REM Set PATH appropriate to the output directory\n" +
1041 "if defined OO_SDK_OUT set PATH=%OO_SDK_OUT%\\WINexample.out\\bin;%PATH%\n" +
1042 "if not defined OO_SDK_OUT set PATH=%OO_SDK_HOME%\\WINexample.out\\bin;%PATH%\n" +
1044 "REM Add directory of the command make to the path, if necessary.\n" +
1045 "if defined OO_SDK_MAKE_HOME set PATH=%OO_SDK_MAKE_HOME%;%PATH%\n" +
1047 "REM Add directory of the zip tool to the path, if necessary.\n" +
1048 "if defined OO_SDK_ZIP_HOME set PATH=%OO_SDK_ZIP_HOME%;%PATH%\n" +
1050 "REM Add directory of the cat tool to the path, if necessary.\n" +
1051 "if defined OO_SDK_CAT_HOME set PATH=%OO_SDK_CAT_HOME%;%PATH%\n" +
1053 "REM Add directory of the sed tool to the path, if necessary.\n" +
1054 "if defined OO_SDK_SED_HOME set PATH=%OO_SDK_SED_HOME%;%PATH%\n" +
1056 "REM Add directory of the C++ compiler to the path, if necessary.\n" +
1057 "if defined OO_SDK_CPP_HOME set PATH=%OO_SDK_CPP_HOME%;%PATH%\n" +
1059 "REM Add directory of the Win SDK to the path, if necessary.\n" +
1060 "if defined CPP_WINDOWS_SDK set PATH=%CPP_WINDOWS_SDK%\\bin;%PATH%\n" +
1061 "if defined CPP_WINDOWS_SDK set INCLUDE=%CPP_WINDOWS_SDK%\\Include;%INCLUDE%\n" +
1062 "REM Add directory of the C# and VB.NET compilers to the path, if necessary.\n" +
1063 "if defined OO_SDK_CLI_HOME set PATH=%OO_SDK_CLI_HOME%;%PATH%\n" +
1065 "REM Add directory of the dotnet command-line tool to the path, if necessary.\n" +
1066 "if defined OO_SDK_DOTNET_ROOT set PATH=%OO_SDK_DOTNET_ROOT%;%PATH%\n" +
1068 "REM Add directory of the Java tools to the path, if necessary.\n" +
1069 "if defined OO_SDK_JAVA_HOME set PATH=%OO_SDK_JAVA_HOME%\\bin;%OO_SDK_JAVA_HOME%\\jre\\bin;%PATH%\n" +
1071 "REM Set environment for C++ compiler tools, if necessary.\n" +
1072 "if defined OO_SDK_CPP_HOME call \"%OO_SDK_CPP_HOME%\\VCVARS32.bat\"\n" +
1074 "REM Set title to identify the prepared shell.\n" +
1075 "title Shell prepared for SDK\n" +
1076 "\nREM Prepare shell with all necessary environment variables.\n" +
1078 "echo ******************************************************************\n" +
1080 "echo * SDK environment is prepared for Windows\n" +
1082 "echo * SDK = %OO_SDK_HOME%\n" +
1083 "echo * Office = %OFFICE_HOME%\n" +
1084 "echo * Make = %OO_SDK_MAKE_HOME%\n" +
1085 "echo * Zip = %OO_SDK_ZIP_HOME%\n" +
1086 "echo * cat = %OO_SDK_CAT_HOME%\n" +
1087 "echo * sed = %OO_SDK_SED_HOME%\n" +
1088 "echo * C++ Compiler = %OO_SDK_CPP_HOME%\n" +
1089 "echo * C# and VB.NET compilers = %OO_SDK_CLI_HOME%\n" +
1090 "echo * Dotnet = %OO_SDK_DOTNET_ROOT%\n" +
1091 "echo * Java = %OO_SDK_JAVA_HOME%\n" +
1092 "echo * Special Output directory = %OO_SDK_OUT%\n" +
1093 "echo * Auto deployment = %SDK_AUTO_DEPLOYMENT%\n" +
1095 "echo ******************************************************************\n" +
1100 "Error: Please insert the necessary environment variables into the batch file.\n" +