Code

source: kliu.fontreg/CLIENT_DATA/setup3264.ins @ 0c2864

Revision 0c2864, 5.7 KB checked in by geos_one, 7 years ago (diff)

update to new opsi builder template

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