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();
56 var oo_sdk_ure_home
=office_home
+ "\\URE";
58 var oo_sdk_make_home
=getMakeHome();
59 var oo_sdk_zip_home
=getZipHome();
60 var oo_sdk_cat_home
=getCatHome();
61 var oo_sdk_sed_home
=getSedHome();
62 var oo_sdk_manifest_used
="";
63 var oo_sdk_windowssdk
="";
64 var oo_sdk_cpp_home
=getCppHome();
65 var oo_sdk_cli_home
=getCliHome();
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 idl sub - dir
132 var idlDir
= sHome
+ "\\idl";
133 if (! aFileSystemObject
.FolderExists(idlDir
))
135 stdout
.WriteLine("\n Error: Could not find directory \"" +
136 idlDir
+ "\". 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 installtion 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 getJavaHome()
640 var sSuggestedHome
= WshSysEnv("OO_SDK_JAVA_HOME");
641 if (sSuggestedHome
.length
== 0)
644 var currentVersion
= WshShell
.RegRead(regKeyJDK
+ "CurrentVersion");
645 if (currentVersion
.length
> 0)
647 sSuggestedHome
= WshShell
.RegRead(regKeyJDK
+ currentVersion
+
649 if ( ! aFileSystemObject
.FolderExists(sSuggestedHome
) )
658 stdout
.Write("\n Enter JAVA SDK (1.4.1_01 or higher) installation directory (optional) [" + sSuggestedHome
+ "]:");
659 var sHome
= stdin
.ReadLine();
660 if (sHome
.length
== 0)
662 //No user input, check OO_SDK_JAVA_HOME or suggested value
663 if ( sSuggestedHome
.length
== 0 ) {
666 if ( !aFileSystemObject
.FolderExists(sSuggestedHome
) )
668 stdout
.WriteLine("\n Error: Could not find directory \"" +
669 sSuggestedHome
+ "\".");
675 sHome
= sSuggestedHome
;
678 //validate the user input
679 if ( ! aFileSystemObject
.FolderExists(sHome
))
681 stdout
.WriteLine("\n Error: The directory \"" + sHome
+
682 "\" does not exist.");
688 //Check if this is an sdk folder by looking for the javac compiler
689 var javacompiler
= sHome
+ "\\bin\\javac.exe";
690 if (! aFileSystemObject
.FileExists(javacompiler
))
692 stdout
.WriteLine("\n Error: Could not find \"" +
693 javacompiler
+ "\".");
699 if ( skipChoice("the Java SDK") ) {
711 function getOutputDir()
713 var defaultdir
= "c:\\" + oo_sdk_name
;
714 var sSuggestedDir
= WshSysEnv("OO_SDK_OUT");
715 if (sSuggestedDir
.length
== 0)
716 sSuggestedDir
= defaultdir
;
722 "\n Default output directory is the \"c:\\" + oo_sdk_name
+ "\".\n" +
723 " Enter an existent directory if you prefer a different one. But note" +
724 " that only\n a path without spaces is allowed because of a" +
725 " limitation of gnu make. (optional) [" + sSuggestedDir
+ "]:");
726 var sDir
= stdin
.ReadLine();
727 if (sDir
.length
== 0)
729 //No user input, check OO_SDK_OUT or suggested value
730 if ( sSuggestedDir
.length
== 0 ) {
733 if (sSuggestedDir
== oo_user_sdk_dir
|| sSuggestedDir
== defaultdir
) {
734 var fso
= new ActiveXObject("Scripting.FileSystemObject");
735 if ( !fso
.FolderExists(sSuggestedDir
) )
736 fso
.CreateFolder(sSuggestedDir
);
738 if ( !aFileSystemObject
.FolderExists(sSuggestedDir
) )
740 stdout
.WriteLine("\n Error: Could not find directory \"" +
741 sSuggestedDir
+ "\".");
747 sDir
= sSuggestedDir
;
751 if (sDir
.indexOf(' ') != -1) {
752 stdout
.WriteLine("\n Error: your specified output directory " +
753 "\"" + sDir
+ "\" " +
754 "contains one or more spaces.\n That " +
755 "causes problems with gnu make. Please specifiy" +
756 " a directory without spaces.");
759 //validate the user input
760 if ( ! aFileSystemObject
.FolderExists(sDir
))
762 stdout
.WriteLine("\n Error: Could not find directory \"" +
769 if ( skipChoice("a special output directory") ) {
781 function getAutoDeployment()
783 var sSuggestedAuto
= WshSysEnv("SDK_AUTO_DEPLOYMENT");
784 if (sSuggestedAuto
.length
== 0)
785 sSuggestedAuto
= "YES";
789 stdout
.Write("\n Automatic deployment of UNO components (YES/NO) ["+
790 sSuggestedAuto
+ "]:");
791 var sAuto
= stdin
.ReadLine();
792 if (sAuto
.length
== 0)
793 sAuto
= sSuggestedAuto
;
796 sAutoU
= sAuto
.toUpperCase();
797 if (sAutoU
!= "YES" && sAutoU
!= "NO")
799 stdout
.WriteLine("\n Error: The value \"" + sAuto
+ "\" is " +
800 "invalid. Please answer YES or NO.")
809 //The function uses sp2bv.exe to obtain a file URL from a
810 //system path. The URL is already escaped for use as bootstrap variable.
811 //($ -> \$). Then the resulting string is escaped for use in a bat file.
812 //That is % signs are made to double % (% -> %%);
813 function makeBootstrapFileUrl(systemPath
)
815 var oExec
= WshShell
.Exec("sp2bv.exe \"" + systemPath
+ "\"");
819 if (!oExec
.StdOut
.AtEndOfStream
)
821 var next
= oExec
.StdOut
.Read(1);
833 function writeBatFile(fdir
, file
)
835 var fso
= new ActiveXObject("Scripting.FileSystemObject");
836 if ( !fso
.FolderExists(fdir
) )
837 fso
.CreateFolder(fdir
);
838 var newFile
= fso
.CreateTextFile(file
, true);
842 "REM This script sets all environment variables, which\n" +
843 "REM are necessary for building the examples of the Office Development Kit.\n" +
844 "REM The Script was developed for the operating systems Windows.\n" +
845 "REM The SDK name\n" +
846 "REM Example: set OO_SDK_NAME=libreoffice3.4_sdk\n" +
847 "set OO_SDK_NAME=" + oo_sdk_name
+
849 "REM Installation directory of the Software Development Kit.\n" +
850 "REM Example: set OO_SDK_HOME=C:\\Program Files\\LibreOffice 3\\sdk\n" +
851 "set OO_SDK_HOME=" + oo_sdk_home
+
853 "REM Office installation directory.\n" +
854 "REM Example: set OFFICE_HOME=C:\\Program Files\\LibreOffice 3\n" +
855 "set OFFICE_HOME=" + office_home
+
857 "REM URE installation directory.\n" +
858 "REM Example: set OO_SDK_URE_HOME=C:\\Program Files\\LibreOffice 3\\URE\n" +
859 "set OO_SDK_URE_HOME=" + oo_sdk_ure_home
+
861 "REM Directory of the make command.\n" +
862 "REM Example: set OO_SDK_MAKE_HOME=D:\\NextGenerationMake\\make\n" +
863 "set OO_SDK_MAKE_HOME=" + oo_sdk_make_home
+
865 "REM Directory of the zip tool.\n" +
866 "REM Example: set OO_SDK_ZIP_HOME=D:\\infozip\\bin\n" +
867 "set OO_SDK_ZIP_HOME=" + oo_sdk_zip_home
+
869 "REM Directory of the cat tool.\n" +
870 "REM Example: set OO_SDK_CAT_HOME=C:\\UnxUtils\\usr\\local\\wbin\n" +
871 "set OO_SDK_CAT_HOME=" + oo_sdk_cat_home
+
873 "REM Directory of the sed tool.\n" +
874 "REM Example: set OO_SDK_SED_HOME=C:\\UnxUtils\\usr\\local\\wbin\n" +
875 "set OO_SDK_SED_HOME=" + oo_sdk_sed_home
+
877 "REM Directory of the C++ compiler.\n" +
878 "REM Example:set OO_SDK_CPP_HOME=C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\bin\n" +
879 "set OO_SDK_CPP_HOME=" + oo_sdk_cpp_home
+
880 "\nset CPP_MANIFEST=" + oo_sdk_manifest_used
+
881 "\nset CPP_WINDOWS_SDK=" + oo_sdk_windowssdk
+
883 "REM Directory of the C# and VB.NET compilers.\n" +
884 "REM Example:set OO_SDK_CLI_HOME=C:\\WINXP\\Microsoft.NET\\Framework\\v1.0.3705\n" +
885 "set OO_SDK_CLI_HOME=" + oo_sdk_cli_home
+
887 "REM Java SDK installation directory.\n" +
888 "REM Example: set OO_SDK_JAVA_HOME=C:\\Program Files\\Java\\jdk1.6.0_05\n" +
889 "set OO_SDK_JAVA_HOME=" + oo_sdk_java_home
+
891 "REM Special output directory\n" +
892 "REM Example: set OO_SDK_OUT=C:\\" + oo_sdk_name
+ "\n" +
893 "set OO_SDK_OUT=" + oo_sdk_out
+
895 "REM Automatic deployment\n" +
896 "REM Example: set SDK_AUTO_DEPLOYMENT=YES\n" +
897 "set SDK_AUTO_DEPLOYMENT=" + sdk_auto_deployment
+
899 "REM Check installation path for the Office Development Kit.\n" +
900 "if not defined OO_SDK_HOME (\n" +
901 " echo Error: the variable OO_SDK_HOME is missing!\n" +
905 "REM Check installation path for the office.\n" +
906 "REM if not defined OFFICE_HOME (\n" +
907 "REM if not defined OO_SDK_URE_HOME (\n" +
908 "REM echo Error: either of the variables OFFICE_HOME and\n" +
909 "REM echo OO_SDK_URE_HOME is missing!\n" +
910 "REM goto :error\n" +
914 "REM Check installation path for GNU make.\n" +
915 "if not defined OO_SDK_MAKE_HOME (\n" +
916 " echo Error: the variable OO_SDK_MAKE_HOME is missing!\n" +
920 "REM Check installation path for the zip tool.\n" +
921 "if not defined OO_SDK_ZIP_HOME (\n" +
922 " echo Error: the variable OO_SDK_ZIP_HOME is missing!\n" +
926 "REM Check installation path for the cat tool.\n" +
927 "if not defined OO_SDK_CAT_HOME (\n" +
928 " echo Error: the variable OO_SDK_CAT_HOME is missing!\n" +
932 "REM Check installation path for the sed tool.\n" +
933 "if not defined OO_SDK_SED_HOME (\n" +
934 " echo Error: the variable OO_SDK_SED_HOME is missing!\n" +
938 "REM Set library path. \n" +
939 "set LIB=%OO_SDK_HOME%\\lib;%LIB%\n" +
940 "if defined CPP_WINDOWS_SDK (\n" +
941 " set LIB=%LIB%;%CPP_WINDOWS_SDK%\\lib\n" +
944 "REM Set office program path.\n" +
945 "if defined OFFICE_HOME (\n" +
946 " set OFFICE_PROGRAM_PATH=%OFFICE_HOME%\\program\n" +
949 "REM Set UNO path, necessary to ensure that the cpp examples using the\n" +
950 "REM new UNO bootstrap mechanism use the configured office installation\n" +
951 "REM (only set when using an Office).\n" +
952 "if defined OFFICE_HOME (\n" +
953 " set UNO_PATH=%OFFICE_PROGRAM_PATH%\n" +
956 "REM if defined OO_SDK_URE_HOME (\n" +
957 "set OO_SDK_URE_BIN_DIR=%OO_SDK_URE_HOME%\\bin\n" +
958 "set OO_SDK_URE_LIB_DIR=%OO_SDK_URE_HOME%\\bin\n" +
959 "set OO_SDK_URE_JAVA_DIR=%OO_SDK_URE_HOME%\\java\n" +
961 "set OO_SDK_OFFICE_BIN_DIR=%OFFICE_PROGRAM_PATH%\n" +
962 "set OO_SDK_OFFICE_LIB_DIR=%OFFICE_PROGRAM_PATH%\n" +
963 "set OO_SDK_OFFICE_JAVA_DIR=%OFFICE_PROGRAM_PATH%\\classes\n" +
966 "REM Set classpath\n" +
967 "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" +
968 "REM if defined OFFICE_HOME (\n" +
969 "REM set CLASSPATH=%CLASSPATH%;%OO_SDK_OFFICE_JAVA_DIR%\\unoil.jar\n" +
972 "REM Add directory of the SDK tools to the path.\n" +
973 "set PATH=%OO_SDK_HOME%\\bin;%OO_SDK_URE_BIN_DIR%;%OO_SDK_OFFICE_BIN_DIR%;%OO_SDK_HOME%\\WINexample.out\\bin;%PATH%\n" +
975 "REM Set PATH appropriate to the output directory\n" +
976 "if defined OO_SDK_OUT (\n" +
977 " set PATH=%OO_SDK_OUT%\\WINexample.out\\bin;%PATH%\n" +
979 " set PATH=%OO_SDK_HOME%\\WINexample.out\\bin;%PATH%\n" +
982 "REM Add directory of the command make to the path, if necessary.\n" +
983 "if defined OO_SDK_MAKE_HOME set PATH=%OO_SDK_MAKE_HOME%;%PATH%\n" +
985 "REM Add directory of the zip tool to the path, if necessary.\n" +
986 "if defined OO_SDK_ZIP_HOME set PATH=%OO_SDK_ZIP_HOME%;%PATH%\n" +
988 "REM Add directory of the cat tool to the path, if necessary.\n" +
989 "if defined OO_SDK_CAT_HOME set PATH=%OO_SDK_CAT_HOME%;%PATH%\n" +
991 "REM Add directory of the sed tool to the path, if necessary.\n" +
992 "if defined OO_SDK_SED_HOME set PATH=%OO_SDK_SED_HOME%;%PATH%\n" +
994 "REM Add directory of the C++ compiler to the path, if necessary.\n" +
995 "if defined OO_SDK_CPP_HOME set PATH=%OO_SDK_CPP_HOME%;%PATH%\n" +
997 "REM Add directory of the Win SDK to the path, if necessary.\n" +
998 "if defined CPP_WINDOWS_SDK (\n" +
999 " set PATH=%CPP_WINDOWS_SDK%\\bin;%PATH%\n" +
1000 " set INCLUDE=%CPP_WINDOWS_SDK%\\Include;%INCLUDE%\n" +
1002 "REM Add directory of the C# and VB.NET compilers to the path, if necessary.\n" +
1003 "if defined OO_SDK_CLI_HOME set PATH=%OO_SDK_CLI_HOME%;%PATH%\n" +
1005 "REM Add directory of the Java tools to the path, if necessary.\n" +
1006 "if defined OO_SDK_JAVA_HOME set PATH=%OO_SDK_JAVA_HOME%\\bin;%OO_SDK_JAVA_HOME%\\jre\\bin;%PATH%\n" +
1008 "REM Set environment for C++ compiler tools, if necessary.\n" +
1009 "if defined OO_SDK_CPP_HOME call \"%OO_SDK_CPP_HOME%\\VCVARS32.bat\"\n" +
1011 "REM Set tilte to identify the prepared shell.\n" +
1012 "title Shell prepared for SDK\n" +
1013 "\nREM Prepare shell with all necessary environment variables.\n" +
1015 "echo ******************************************************************\n" +
1017 "echo * SDK environment is prepared for Windows\n" +
1019 "echo * SDK = %OO_SDK_HOME%\n" +
1020 "echo * Office = %OFFICE_HOME%\n" +
1021 "echo * URE = %OO_SDK_URE_HOME%\n" +
1022 "echo * Make = %OO_SDK_MAKE_HOME%\n" +
1023 "echo * Zip = %OO_SDK_ZIP_HOME%\n" +
1024 "echo * cat = %OO_SDK_CAT_HOME%\n" +
1025 "echo * sed = %OO_SDK_SED_HOME%\n" +
1026 "echo * C++ Compiler = %OO_SDK_CPP_HOME%\n" +
1027 "echo * C# and VB.NET compilers = %OO_SDK_CLI_HOME%\n" +
1028 "echo * Java = %OO_SDK_JAVA_HOME%\n" +
1029 "echo * Special Output directory = %OO_SDK_OUT%\n" +
1030 "echo * Auto deployment = %SDK_AUTO_DEPLOYMENT%\n" +
1032 "echo ******************************************************************\n" +
1037 "Error: Please insert the necessary environment variables into the batch file.\n" +