View | Details | Raw Unified | Return to issue 120322
Collapse All | Expand All

(-)build.xml (+36 lines)
Lines 39-44 Link Here
39
	<property name="test.result" value="${test.output}/result" />
39
	<property name="test.result" value="${test.output}/result" />
40
	<property name="test.report" value="${test.output}/report" />
40
	<property name="test.report" value="${test.output}/report" />
41
	<property name="junit.style.dir" value="./reportstyle" />
41
	<property name="junit.style.dir" value="./reportstyle" />
42
	<property name="install.win" location="install.bat" />	
43
	<property name="product.name" value="OpenOffice.org" />
44
	<property name="product.name.dev" value="OOo-dev" />
42
45
43
	<path id="classpath">
46
	<path id="classpath">
44
		<pathelement location="${classes}" />
47
		<pathelement location="${classes}" />
Lines 185-191 Link Here
185
		<fail unless="openoffice.home" />
188
		<fail unless="openoffice.home" />
186
		<echo>Openoffice is installed to ${openoffice.home}</echo>
189
		<echo>Openoffice is installed to ${openoffice.home}</echo>
187
	</target>
190
	</target>
191
	
192
	<target name="install.silent" unless="install.test.skip" description="install the build to local via silent mode">	
193
		<property name="build.location" location="${testspace}/testbuild" />
194
		<exec osfamily="windows" executable="cmd" failifexecutionfails="false">
195
			<arg value="/c" />
196
			<arg value="${install.win}" />
197
			<arg value="${build.location}" />
198
		</exec>			
199
		<exec os="Linux" executable="sh" failifexecutionfails="false">
200
			<arg value="install" /> 
201
			<arg value="${build.location}" /> 
202
		</exec>
203
		<exec osfamily="mac" executable="bash" failifexecutionfails="false">	
204
			<arg value="macinstall" /> 
205
			<arg value="${build.location}" /> 
206
		</exec>
207
	</target>
208
	<target name="uninstall.silent" unless="uninstall.test.skip" description="uninstall the build via silent mode">				
209
		<exec osfamily="windows" executable="cmd" failifexecutionfails="false">
210
			<arg line="/c cscript win32_oo.js Uninstall ${product.name}" />				
211
		</exec>
212
		<!--to remove the ooo-dev snapshot build-->
213
		<exec osfamily="windows" executable="cmd" failifexecutionfails="false">
214
			<arg line="/c cscript win32_oo.js Uninstall ${product.name.dev}" />				
215
		</exec>
216
		<exec os="Linux" executable="sh" failifexecutionfails="false">		
217
			<arg value="uninstall" /> 
218
		</exec>
219
		<exec osfamily="mac" executable="bash" failifexecutionfails="false">		
220
			<arg value="macuninstall" /> 
221
		</exec>
222
	</target>
188
223
224
189
	<target name="clean.test" unless="clean.test.skip" description="Clean testing footprint">
225
	<target name="clean.test" unless="clean.test.skip" description="Clean testing footprint">
190
		<delete dir="${testspace}/oouser" quiet="true" failonerror="false" />
226
		<delete dir="${testspace}/oouser" quiet="true" failonerror="false" />
191
	</target>
227
	</target>
(-)install (+5 lines)
Line 0 Link Here
1
#!/bin/sh
2
echo build location is $1
3
sudo dpkg -i $1/o*.deb || sudo rpm -ivh $1/o*.rpm
4
#install desktop-integration package
5
sudo dpkg -i $1/desktop-integration/*.deb || sudo rpm -ivh $1/desktop-integration/o*-redhat-*.rpm || sudo rpm -ivh $1/desktop-integration/o*-suse-*.rpm || sudo rpm -ivh $1/desktop-integration/o*-freedesktop-*.rpm || sudo rpm -ivh $1/desktop-integration/o*-mandriva-*.rpm
(-)install.bat (+18 lines)
Line 0 Link Here
1
@echo off
2
rem setlocal EnableDelayedExpansion    
3
echo build path is %1
4
set dir=%1
5
set secondstr=%dir:~1,1%
6
7
if not "%secondstr%"==":" (
8
	for /f "delims=" %%i in ("%dir%") do (
9
	set dir=%%~dpi
10
	)
11
)
12
13
set disk=%dir:~0,2%
14
%disk%
15
cd %dir%
16
for /f %%x in ('dir /b Apache_OpenOffice_incubating_*_Win_x86_install*.exe') do @set v=%%x
17
echo run command %v% /S
18
start %v% /S
(-)macinstall (+4 lines)
Line 0 Link Here
1
#!/bin/bash
2
hdiutil attach -mountpoint /Volumes/Aoo $1/Apache*.dmg
3
sudo cp -r /Volumes/Aoo/OpenOffice.org.app /Applications
4
hdiutil detach /Volumes/Aoo
(-)macuninstall (+2 lines)
Line 0 Link Here
1
#!/bin/bash
2
sudo rm -rf /Applications/OpenOffice.org.app
(-)uninstall (+17 lines)
Line 0 Link Here
1
#!/bin/sh
2
#get package names
3
sudo rpm -qa | grep openoffice > rpmlist
4
sudo rpm -qa | grep ooo >> rpmlist
5
6
sudo dpkg -l | grep ^ii | grep openoffice | cut -d' ' -f3 > deblist
7
sudo dpkg -l | grep ^ii | grep ooo | cut -d' ' -f3 >> deblist
8
9
#remove the packages
10
sudo dpkg -P `cat deblist` || sudo rpm -e `cat rpmlist`
11
12
#remove the temp file rmlist
13
rm deblist 
14
rm rpmlist
15
16
#sudo dpkg -l | grep ^ii | grep ooo | cut -d' ' -f3 | sudo xargs dpkg -r || sudo rpm -e `rpm -qa | grep ooo`
17
#sudo dpkg -l | grep ^ii | grep ooo | cut -d' ' -f3 | sudo xargs dpkg -r || sudo rpm -e `rpm -qa | grep ooo`
(-)win32_oo.js (+88 lines)
Line 0 Link Here
1
/**
2
 * In the command line:
3
 * cscript win32.js functionName [function arg0] [function arg1] [function arg2]
4
 **/
5
var exitCode = 0;
6
var FileSystemObject = WScript.CreateObject("Scripting.FileSystemObject");
7
var ShellApplication = WScript.CreateObject("Shell.Application");
8
	
9
function Extract(zipFile, targetDir) {
10
    var objSource = ShellApplication.NameSpace(zipFile).Items();
11
    var objTarget = ShellApplication.NameSpace(targetDir);
12
    //http://msdn2.microsoft.com/en-us/library/ms723207.aspx
13
    intOptions = 256;
14
   //WScript.echo("objTarobjSourceget: \"" + objSource.Count +"\"")
15
    objTarget.CopyHere(objSource, intOptions);
16
    var file = FileSystemObject.GetFile(zipFile);
17
    WScript.echo(FileSystemObject.GetSpecialFolder(2) + "\\*" + file.Name + "*");
18
  //  FileSystemObject.DeleteFolder(FileSystemObject.GetSpecialFolder(2) + "\\*" + file.Name + "*", true);
19
}
20
21
function FindProductCode(product) {
22
	var wi = WScript.CreateObject("WindowsInstaller.Installer");
23
	var prods = wi.ProductsEx("", "", 7);
24
	for(var i = 0; i < prods.Count; i++) {
25
		var prod = prods.Item(i);
26
		var prodName =prod.InstallProperty("ProductName");		
27
		if (prodName.indexOf(product) != -1){
28
			WScript.echo("Product: \"" + prodName +"\" is found");
29
			return prod.ProductCode;
30
		}
31
	}
32
}
33
34
/**
35
 * Uninstall the product with it name
36
 */
37
function Uninstall(prodName) {
38
	WScript.echo("Try to uninstall: \"" + prodName +"\"");
39
	var prodCode = FindProductCode(prodName);
40
	if (prodCode) {
41
		var shell = WScript.CreateObject("WScript.Shell");
42
		//To enable Windows 7 support, change /qn to /passive
43
		WScript.echo("Run: msiexec /x " + prodCode + " /passive");
44
		exitCode = shell.Run("msiexec /x " + prodCode + " /passive", 0, true);
45
	} else {
46
		WScript.echo("Can't find " + prodName + " to uninstall!");
47
	}
48
}
49
50
/**
51
 * Clean up the product msi info with its name by using Windows Installer Clean up
52
 */
53
function CleanUp(prodName) {
54
	WScript.echo("Try to clean: \"" + prodName +"\"");
55
	var prodCode = FindProductCode(prodName);
56
	if (prodCode) {
57
		var shell = WScript.CreateObject("WScript.Shell");
58
		//To enable Windows 7 support, change /qn to /passive
59
		WScript.echo("Run: C:/Program Files/Windows Installer Clean Up/MsiZap.exe' T " + prodCode);
60
		exitCode = shell.Run("\"C:\\Program Files\\Windows Installer Clean Up\\MsiZap.exe\" T " + prodCode, 0, true);
61
	} else {
62
		WScript.echo("Can't find " + prodName + " to clean up!");
63
	}
64
}
65
/**
66
 * Uninstall the product with it name
67
 */
68
function UninstallWithGUI(prodName) {
69
	WScript.echo("Try to uninstall: \"" + prodName +"\"");
70
	var prodCode = FindProductCode(prodName);
71
	if (prodCode) {
72
		var shell = WScript.CreateObject("WScript.Shell");
73
		WScript.echo("Run: msiexec /x " + prodCode);
74
		exitCode = shell.Run("msiexec /x " + prodCode, 1, true);
75
	} else {
76
		WScript.echo("Can't find " + prodName + " to uninstall!");
77
	}
78
}
79
80
var args = WScript.Arguments;
81
var funcName = args(0);
82
var largs = [];
83
for (var i = 1; i < args.Count(); i++) {
84
	largs.push(args(i));
85
}
86
87
this[funcName].apply(this, largs);
88
WScript.Quit(exitCode);

Return to issue 120322