Code

source: mozilla.firefox/CLIENT_DATA/setup32.ins @ 07c365

Revision 07c365, 4.9 KB checked in by silc, 8 years ago (diff)

Auto updates and maintenance service disabled

  • 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 $UninstallProgram$
10DefVar $UninstallProgramOld$
11DefVar $IniFile$
12DefVar $IniCfgFile$
13DefVar $LogDir$
14DefVar $ProductId$ 
15DefVar $MinimumSpace$
16DefVar $InstallDir$
17DefVar $ExitCode$
18DefVar $OLD_VERSION$
19DefVar $OLD_CREATOR_TAG$
20DefVar $OLD_RELEASE$
21
22Set $LogDir$ = "%SystemDrive%\tmp"
23
24; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh
25; and adds the following variables:
26;   from builder-product.cfg :  all variables definded by attribute WINST[index]
27;   from builder-product.cfg :  VENDOR PN VERSION RELEASE PRIORITY ADVICE TYPE   
28;   from opsi-builder.cfg    :  CREATOR_TAG CREATOR_NAME CREATOR_EMAIL           
29;   auto generated winst-variables
30;         $IconFile$: path to product picture
31;
32@@BUILDER_VARIABLES@@
33
34; ----------------------------------------------------------------
35; - Please edit the following values                             -
36; ----------------------------------------------------------------
37;$ProductId$ should be the name of the product in opsi
38; therefore please: only lower letters, no umlauts,
39; no white space use '-' as a seperator
40Set $MinimumSpace$    = "200 MB"
41; the path were we find the product after the installation
42Set $InstallDir$      = "%ProgramFiles32Dir%\Mozilla Firefox"
43; ----------------------------------------------------------------
44
45Set $IniCfgFile$ = "%ScriptPath%\opsi-" + $ProductId$ + ".ini"
46
47if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$))
48        LogError "Not enough space on %SystemDrive%, " + $MinimumSpace$ + " on drive %SystemDrive% needed for " + $ProductId$
49        isFatalError "No Space"
50        ; Stop process and set installation status to failed
51else
52        comment "Show product picture"
53        ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $NAME$
54       
55        if FileExists("%ScriptPath%\delsub32.ins")
56                comment "Start uninstall sub section"
57                Sub "%ScriptPath%\delsub32.ins"
58        endif
59       
60        Message "Installing " + $ProductId$ + " "+ $VERSION$ + "-" + $CREATOR_TAG$ + $RELEASE$ + " ..."
61       
62        comment "Start setup program"
63        ChangeDirectory "%SCRIPTPATH%"
64        Winbatch_install
65        Sub_check_exitcode
66       
67        comment "Copy files"
68        Files_install /32Bit
69       
70        comment "Patch Registry"
71        Registry_install /32Bit
72       
73        comment "Create shortcuts"
74        LinkFolder_install
75       
76endif
77
78[Winbatch_install]
79REG ADD HKLM\SOFTWARE\Mozilla\MaintenanceService /v Attempted /t REG_DWORD /d 1 /f
80"$InstallExe$" -ms
81"%ProgramFiles32Dir%\Mozilla Maintenance Service\uninstall.exe" /S
82
83[Files_install]
84; copy the ini file to the InstallDir
85copy "$IniCfgFile$" "$InstallDir$"
86copy "%ScriptPath%\*.cfg" "$InstallDir$"
87copy "%ScriptPath%\local-settings.js" "$InstallDir$\defaults\pref"
88
89[Registry_install]
90; Example of setting some values of an registry key:
91;
92; openkey [HKEY_LOCAL_MACHINE\Software\$ProductId$]
93; set "name1" = "some string value"
94; set "name2" = REG_DWORD:0001
95; set "name3" = REG_BINARY:00 af 99 cd
96
97[LinkFolder_install]
98; Example of deleting a folder from AllUsers startmenu:
99;
100; set_basefolder common_programs
101; delete_subfolder $ProductId$
102;
103; Example of creating an shortcut to the installed exe in AllUsers startmenu:
104;
105; set_basefolder common_programs
106; set_subfolder $ProductId$
107;
108; set_link
109;       name: $ProductId$
110;       target: <path to the program>
111;       parameters:
112;       working_dir: $InstallDir$
113;       icon_file:
114;       icon_index:
115; end_link
116;
117; Example of creating an shortcut to the installed exe on AllUsers desktop:
118;
119; set_basefolder common_desktopdirectory
120; set_subfolder ""
121;
122; set_link
123;       name: $ProductId$
124;       target: <path to the program>
125;       parameters: <some_param>
126;       working_dir: $InstallDir$
127;       icon_file: <path to icon file>
128;       icon_index: 2
129; end_link
130
131[Sub_check_exitcode]
132comment "Test for installation success via exit code"
133set $ExitCode$ = getLastExitCode
134; informations to exit codes see
135; http://msdn.microsoft.com/en-us/library/aa372835(VS.85).aspx
136; http://msdn.microsoft.com/en-us/library/aa368542.aspx
137if ($ExitCode$ = "0")
138        comment "Looks good: setup program gives exitcode zero"
139else
140        comment "Setup program gives a exitcode unequal zero: " + $ExitCode$
141        if ($ExitCode$ = "1605")
142                comment "ERROR_UNKNOWN_PRODUCT  1605    This action is only valid for products that are currently installed."
143                comment "Uninstall of a not installed product failed - no problem"
144        else
145                if ($ExitCode$ = "1641")
146                        comment "looks good: setup program gives exitcode 1641"
147                        comment "ERROR_SUCCESS_REBOOT_INITIATED 1641    The installer has initiated a restart. This message is indicative of a success."
148                else
149                        if ($ExitCode$ = "3010")
150                                comment "looks good: setup program gives exitcode 3010"
151                                comment "ERROR_SUCCESS_REBOOT_REQUIRED  3010    A restart is required to complete the install. This message is indicative of a success."
152                        else
153                                logError "Fatal: Setup program gives an unknown exitcode unequal zero: " + $ExitCode$
154                                isFatalError
155                        endif
156                endif
157        endif
158endif
159
Note: See TracBrowser for help on using the repository browser.