Code

source: microsoft.office2007/CLIENT_DATA/setup32.ins @ 2ccb13

Revision 2ccb13, 7.4 KB checked in by geos_one, 7 years ago (diff)

add odf addin

  • Property mode set to 100644
Line 
1; Copyright (c) uib gmbh (www.uib.de)
2; This sourcecode is owned by uib
3; and published under the Terms of the General Public License.
4; credits: http://www.opsi.org/en/credits/
5
6[Actions]
7requiredWinstVersion >= "4.11.2.6"
8
9DefVar $MsiIdOld$
10DefVar $IniFile$
11DefVar $IniCfgFile$
12DefVar $LogDir$
13DefVar $ProductId$ 
14DefVar $MinimumSpace$
15DefVar $InstallDir$
16DefVar $ExitCode$
17DefVar $LicenseRequired$
18DefVar $LicenseKey$
19DefVar $LicensePool$
20DefVar $OLD_VERSION$
21DefVar $OLD_CREATOR_TAG$
22DefVar $OLD_RELEASE$
23
24Set $LogDir$ = "%SystemDrive%\tmp"
25
26; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh
27; and adds the following variables:
28;   from builder-product.cfg :  all variables definded by attribute WINST[index]
29;   from builder-product.cfg :  VENDOR PN VERSION RELEASE PRIORITY ADVICE TYPE   
30;   from opsi-builder.cfg    :  CREATOR_TAG CREATOR_NAME CREATOR_EMAIL           
31;   auto generated winst-variables
32;         $IconFile$: path to product picture
33;
34@@BUILDER_VARIABLES@@
35
36; ----------------------------------------------------------------
37; - Please edit the following values                             -
38; ----------------------------------------------------------------
39;$ProductId$ should be the name of the product in opsi
40; therefore please: only lower letters, no umlauts,
41; no white space use '-' as a seperator
42Set $MinimumSpace$    = "1500 MB"
43; the path were we find the product after the installation
44Set $InstallDir$      = "%ProgramFiles32Dir%\Microsoft Office\Office12"
45Set $LicenseRequired$ = "true"
46Set $LicensePool$     = "p_" + $ProductId$
47; ----------------------------------------------------------------
48
49Set $IniCfgFile$ = "%ScriptPath%\opsi-" + $ProductId$ + ".ini"
50
51if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$))
52        LogError "Not enough space on %SystemDrive%, " + $MinimumSpace$ + " on drive %SystemDrive% needed for " + $ProductId$
53        isFatalError "No Space"
54        ; Stop process and set installation status to failed
55else
56        comment "Show product picture"
57        ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $NAME$
58       
59        if FileExists("%ScriptPath%\delsub32.ins")
60                comment "Start uninstall sub section"
61                Sub "%ScriptPath%\delsub32.ins"
62        endif
63       
64        Message "Installing " + $ProductId$ + " "+ $VERSION$ + "-" + $CREATOR_TAG$ + $RELEASE$ + " ..."
65       
66        if $LicenseRequired$ = "true"
67                comment "Licensing required, reserve license and get license key"
68                Sub_get_licensekey
69        endif
70       
71        comment "Remove Install Files"
72        Winbatch_remove
73
74        comment "Extract Office"
75        Winbatch_extract
76        Sub_check_exitcode
77
78        comment "Extract Office Updates"
79        Winbatch_update
80        Sub_check_exitcode
81
82        comment "Create License File"
83        Dosbatch_license
84        Sub_check_exitcode
85
86        comment "Start setup program"
87        Winbatch_install
88        Sub_check_exitcode
89
90        comment "Remove Install Files"
91        Winbatch_remove
92        Sub_check_exitcode
93
94        comment "Start setup program"
95        ChangeDirectory "%SCRIPTPATH%"
96        Winbatch_install
97        Sub_check_exitcode
98       
99        Winbatch_install_odf
100        Sub_check_exitcode
101       
102        comment "Copy files"
103        Files_install /32Bit
104       
105        comment "Patch Registry"
106        Registry_install /32Bit
107       
108        comment "Create shortcuts"
109        LinkFolder_install
110       
111endif
112
113[Winbatch_extract]
114$InstallExe$ /quiet /extract:$LogDir$\msoffice2007
115
116[Winbatch_update]
117$InstallSp3Exe$ /quiet /extract:$LogDir$\msoffice2007\Updates
118
119[Dosbatch_license]
120xml ed -O -u "/Configuration/PIDKEY/@Value" -v $LicenseKey$ -u "/Configuration/USERNAME/@Value" -v %HostID% -u "/Configuration/COMPANYNAME/@Value" -v %HostID% -u "/Configuration/INSTALLLOCATION/@Value" -v "$InstallDir$" %ScriptPath%\config.xml > $LogDir$\msoffice2007.xml
121
122[Winbatch_install]
123"$LogDir$\msoffice2007\SETUP.EXE" /config "$LogDir$\msoffice2007.xml"
124
125[Winbatch_install_odf]
126msiexec /i "$OdfAddInExe$" /l* "$LogDir$\$ProductId$.install_log.txt" /qb! ALLUSERS=1 REBOOT=ReallySuppress
127
128[Winbatch_remove]
129delete -sf "$LogDir$\msoffice2007\"
130
131[Files_install]
132; copy the ini file to the InstallDir
133copy "$IniCfgFile$" "$InstallDir$"
134
135; Example of recursively copying some files into the installation directory:
136;
137; copy -s "%ScriptPath%\files\*.*" "$InstallDir$"
138
139[Registry_install]
140; Example of setting some values of an registry key:
141;
142; openkey [HKEY_LOCAL_MACHINE\Software\$ProductId$]
143; set "name1" = "some string value"
144; set "name2" = REG_DWORD:0001
145; set "name3" = REG_BINARY:00 af 99 cd
146
147[LinkFolder_install]
148; Example of deleting a folder from AllUsers startmenu:
149;
150; set_basefolder common_programs
151; delete_subfolder $ProductId$
152;
153; Example of creating an shortcut to the installed exe in AllUsers startmenu:
154;
155; set_basefolder common_programs
156; set_subfolder $ProductId$
157;
158; set_link
159;       name: $ProductId$
160;       target: <path to the program>
161;       parameters:
162;       working_dir: $InstallDir$
163;       icon_file:
164;       icon_index:
165; end_link
166;
167; Example of creating an shortcut to the installed exe on AllUsers desktop:
168;
169; set_basefolder common_desktopdirectory
170; set_subfolder ""
171;
172; set_link
173;       name: $ProductId$
174;       target: <path to the program>
175;       parameters: <some_param>
176;       working_dir: $InstallDir$
177;       icon_file: <path to icon file>
178;       icon_index: 2
179; end_link
180
181[Sub_get_licensekey]
182if opsiLicenseManagementEnabled
183        comment "License management is enabled and will be used"
184
185        comment "Trying to get a license key"
186        Set $LicenseKey$ = demandLicenseKey ($LicensePool$)
187        ; If there is an assignment of exactly one licensepool to the product the following call is possible:
188        ; Set $LicenseKey$ = demandLicenseKey ("", $ProductId$)
189        ;
190        ; If there is an assignment of a license pool to a windows software id, it is possible to use:
191        ; DefVar $WindowsSoftwareId$
192        ; $WindowsSoftwareId$ = "..."
193        ; Set $LicenseKey$ = demandLicenseKey ("", "", $WindowsSoftwareId$)
194       
195        DefVar $ServiceErrorClass$
196        set $ServiceErrorClass$ = getLastServiceErrorClass
197        comment "Error class: " + $ServiceErrorClass$
198       
199        if $ServiceErrorClass$ = "None"
200                comment "Everything fine, we got the license key '" + $LicenseKey$ + "'"
201        else
202                if $ServiceErrorClass$ = "LicenseConfigurationError"
203                        LogError "Fatal: license configuration must be corrected"
204                        LogError getLastServiceErrorMessage
205                        isFatalError
206                else
207                        if $ServiceErrorClass$ = "LicenseMissingError"
208                                LogError "Fatal: required license is not supplied"
209                                isFatalError
210                        endif
211                endif
212        endif
213else
214        LogError "Fatal: license required, but license management not enabled"
215        isFatalError
216endif
217
218
219[Sub_check_exitcode]
220comment "Test for installation success via exit code"
221set $ExitCode$ = getLastExitCode
222; informations to exit codes see
223; http://msdn.microsoft.com/en-us/library/aa372835(VS.85).aspx
224; http://msdn.microsoft.com/en-us/library/aa368542.aspx
225if ($ExitCode$ = "0")
226        comment "Looks good: setup program gives exitcode zero"
227else
228        comment "Setup program gives a exitcode unequal zero: " + $ExitCode$
229        if ($ExitCode$ = "1605")
230                comment "ERROR_UNKNOWN_PRODUCT  1605    This action is only valid for products that are currently installed."
231                comment "Uninstall of a not installed product failed - no problem"
232        else
233                if ($ExitCode$ = "1641")
234                        comment "looks good: setup program gives exitcode 1641"
235                        comment "ERROR_SUCCESS_REBOOT_INITIATED 1641    The installer has initiated a restart. This message is indicative of a success."
236                else
237                        if ($ExitCode$ = "3010")
238                                comment "looks good: setup program gives exitcode 3010"
239                                comment "ERROR_SUCCESS_REBOOT_REQUIRED  3010    A restart is required to complete the install. This message is indicative of a success."
240                        else
241                                logError "Fatal: Setup program gives an unknown exitcode unequal zero: " + $ExitCode$
242                                isFatalError
243                        endif
244                endif
245        endif
246endif
247
Note: See TracBrowser for help on using the repository browser.