1 --- /dev/null 1 Jan 1970 00:00:00 -0000
2 +++ instsetoo_native/res/osx_langpackinstall.applescript 19 Jan 2008 21:58:12 -0000 1.1.2.3
5 +This script is meant to
6 + 1) Identify installed instances of OOo
7 + 2) check whether the user has write-access (and if not
8 + ask for authentification)
9 + 3) install the shipped tarball
12 +-- strings for localisations - to be meant to be replaced
13 +-- by a makefile or similar
15 +set AbortLabel to "Abort"
16 +set intro to "Welcome to the OpenOffice.org Languagepack Installer
18 +The next step will try to detect installed versions of OpenOffice.org
19 +This might take a moment"
20 +set chooseMyOwn to "not listed (choose location in an extra step)"
21 +set listPrompt to "Choose the installation for which you want to install the languagepack"
22 +set chooseManual to "Point the dialog to your OOo installation"
23 +set listOKLabel to "Continue"
24 +set listCancelLabel to "Abort installation"
25 +set appInvalid to " doesn't look like an OpenOffice.org installation
26 +If the chosen application really is OpenOffice.org, please contact the developers. Otherwise just run the installer again and choose a valid OpenOffice.org installation" -- string will begin with the chosen application's name
27 +set startInstall to "Click " & OKLabel & " to start the installation
29 +(installation might take a minute...)"
30 +set IdentifyQ to "Installation failed, most likely your account doesn't have the necessary privileges. Do you want to identify as administrator and try again?"
31 +set IdentifyYES to "Yes, identify"
32 +set IdentifyNO to "No, abort installation"
33 +set installFailed to "Installation failed"
34 +set installComplete to "Installation is completed - you should now be able to switch the UI language"
36 +set sourcedir to (do shell script "dirname " & quoted form of POSIX path of (path to of me))
38 +display dialog intro buttons {AbortLabel, OKLabel} default button 2
40 +if (button returned of result) is AbortLabel then
44 +set the found_ooos to (do shell script "mdfind \"kMDItemContentType == 'com.apple.application-bundle' && kMDItemDisplayName == 'OpenOffice.org*' && kMDItemDisplayName != 'OpenOffice.org Languagepack.app'\"") & "
47 +-- the choice returned is of type "list"
48 +set the choice to (choose from list of paragraphs in found_ooos default items (get first paragraph of found_ooos) with prompt listPrompt OK button name listOKLabel cancel button name listCancelLabel)
50 +if choice is false then
51 + -- do nothing, the user cancelled the installation
52 + return 2 --aborted by user
53 +else if (choice as string) is chooseMyOwn then
54 + -- yeah, one needs to use "choose file", otherwise
55 + -- the user would not be able to select the .app
56 + set the choice to POSIX path of (choose file with prompt chooseManual of type "com.apple.application-bundle" without showing package contents and invisibles)
59 +-- now only check whether the path is really from OOo
62 + do shell script "grep '<string>org.openoffice.script</string>' " & quoted form of (choice as string) & "/Contents/Info.plist"
64 + display dialog (choice as string) & appInvalid buttons {OKLabel} default button 1 with icon 0
65 + return 3 --wrong target-directory
68 +display dialog startInstall buttons {AbortLabel, OKLabel} default button 2
70 +if (button returned of result) is AbortLabel then
74 +set tarCommand to "/usr/bin/tar -C " & quoted form of (choice as string) & " -xjf " & quoted form of sourcedir & "/tarball.tar.bz2"
76 + do shell script tarCommand
78 +on error errMSG number errNUM
79 + display dialog IdentifyQ buttons {IdentifyYES, IdentifyNO} with icon 2
80 + if (button returned of result) is IdentifyYES then
82 + do shell script tarCommand with administrator privileges
83 + on error errMSG number errNUM
84 + display dialog installFailed buttons {OKLabel} default button 1 with icon 0
85 + -- -60005 username/password wrong
86 + -- -128 aborted by user
87 + -- 2 error from tar - tarball not found (easy to test)
91 + return 2 -- aborted by user
95 +display dialog installComplete buttons {OKLabel} default button 1
96 --- /dev/null 1 Jan 1970 00:00:00 -0000
97 +++ instsetoo_native/res/osx_langpackinstall.sh 14 Sep 2007 18:13:05 -0000 1.1.2.1
101 +# shell script as a workaraound since it is hard to impossible to store compiled
102 +# applescript in CVS and running osacompile would require a GUI session while
103 +# building (or root privileges)
104 +# using osascript only works when the shell script is camouflaged as application
106 +MY_DIR=$(dirname "$0")
108 +osascript "$MY_DIR/osx_langpackinstall.applescript"
109 --- instsetoo_native/util/makefile.mk
110 +++ instsetoo_native/util/makefile.mk
111 @@ -47,7 +47,7 @@ PYTHONPATH:=$(PWD)$/$(BIN):$(SOLARLIBDIR
112 .ENDIF # "$(GUI)"=="WNT"
115 -.IF "$(CWS_WORK_STAMP)"=="" || "$(UPDATER)"!=""
116 +.IF ("$(CWS_WORK_STAMP)"=="" || "$(UPDATER)"!="") && "$(OS)"!="MACOSX"
117 ENABLE_DOWNLOADSETS*=TRUE
118 .ENDIF # "$(CWS_WORK_STAMP)"=="" || "$(UPDATER)"!=""
119 .IF "$(FORCE_DOWNLOADSETS)"!=""
120 @@ -214,7 +214,11 @@ $(MAKETARGETS) : $(ADDDEPS)
121 .IF "$(OS)" == "MACOSX"
122 DMGDEPS=$(BIN)$/{osxdndinstall.png DS_Store DS_Store_Langpack}
123 $(foreach,i,$(alllangiso) {openoffice openofficedev openofficewithjre ooolanguagepack broffice brofficedev brofficewithjre}_$i) : $(DMGDEPS)
124 -.ENDIF # "$(OS)" == "MACOSX"
126 +BUILDROOT_LANGPACK=$(subst,$(@:s/_/ /:1)_,$(OUT)$/OpenOffice_languagepack$/install$/ $(@:b))
127 +OOO_PKG_VERSION:=$(shell sed -n '/^OpenOffice$$/,/^}$$/ s/^[[:space:]]*PACKAGEVERSION //p' openoffice.lst)
128 +MAC_APPDIR:=$(shell sed -n '/^OpenOffice$$/,/^}$$/ s/.*PRODUCTNAME //p' openoffice.lst).app
129 +.ENDIF # "$(OS)"=="MACOSX"
131 .IF "$(PKGFORMAT)"!=""
132 $(foreach,i,$(alllangiso) openoffice_$i) : $$@{$(PKGFORMAT:^".")}
133 @@ -254,7 +258,22 @@ ooolanguagepack_%{$(PKGFORMAT:^".")} :
134 .ELSE # "$(PKGFORMAT)"!=""
136 .ENDIF # "$(PKGFORMAT)"!=""
137 +.IF "$(OS)"!="MACOSX"
138 $(PERL) -w $(SOLARENV)$/bin$/make_installer.pl -f $(PRJ)$/util$/openoffice.lst -l $(subst,$(@:s/_/ /:1)_, $(@:b)) -p OpenOffice -u $(OUT) -buildid $(BUILD) -msitemplate $(MSILANGPACKTEMPLATEDIR) -msilanguage $(COMMONMISC)$/win_ulffiles -languagepack $(subst,xxx,$(@:e:s/.//) $(PKGFORMATSWITCH) $(VERBOSESWITCH))
139 +.ELSE # "$(OS)"!="MACOSX"
140 + $(PERL) -w $(SOLARENV)$/bin$/make_installer.pl -f $(PRJ)$/util$/openoffice.lst -l $(subst,$(@:s/_/ /:1)_, $(@:b)) -p OpenOffice -u $(OUT) -buildid $(BUILD) -languagepack -destdir $(BUILDROOT_LANGPACK)_inprogress$/ -simple staging
141 + $(MKDIRHIER) $(BUILDROOT_LANGPACK)$/staging$/"OpenOffice.org Languagepack.app"$/Contents
142 + $(COPY) $(PRJ)$/res$/osx_langpackinstall.sh $(BUILDROOT_LANGPACK)$/staging$/"OpenOffice.org Languagepack.app"$/Contents$/"OpenOffice.org Languagepack"
143 + $(COPY) $(PRJ)$/res$/osx_langpackinstall.applescript $(BUILDROOT_LANGPACK)$/staging$/"OpenOffice.org Languagepack.app"$/Contents$/
144 + chmod a+x $(BUILDROOT_LANGPACK)$/staging$/"OpenOffice.org Languagepack.app"$/Contents$/"OpenOffice.org Languagepack"
145 + chmod a+x $(BUILDROOT_LANGPACK)$/staging$/"OpenOffice.org Languagepack.app"$/Contents$/osx_langpackinstall.applescript
146 + tar -cjf $(BUILDROOT_LANGPACK)$/staging$/"OpenOffice.org Languagepack.app"$/Contents$/tarball.tar.bz2 -C $(BUILDROOT_LANGPACK)$/staging$/"$(MAC_APPDIR)" Contents
147 + $(RM) -r $(BUILDROOT_LANGPACK)$/staging$/"$(MAC_APPDIR)"
148 + cd $(BUILDROOT_LANGPACK) && hdiutil makehybrid -hfs -hfs-openfolder staging staging \
149 + -hfs-volume-name "OpenOffice.org Languagepack" -ov -o tmp && hdiutil convert -ov -format UDZO tmp.dmg \
150 + -o $(subst,$(@:s/_/ /:1),OpenOffice.org-langpack-$(OOO_PKG_VERSION) $(@:b)) && $(RM) tmp.dmg
151 + $(RM) -r $(BUILDROOT_LANGPACK)$/staging
152 +.ENDIF # "$(OS)"!="MACOSX"
154 .IF "$(PKGFORMAT)"!=""
155 $(foreach,i,$(alllangiso) ooodevlanguagepack_$i) : $$@{$(PKGFORMAT:^".")}