Code

source: kliu.fontreg/CLIENT_DATA/setup3264.ins @ e5eec2

Revision e5eec2, 5.1 KB checked in by geos_one, 8 years ago (diff)

Inital Commit

  • 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/credits/
5
6[Actions]
7requiredWinstVersion >= "4.10.8.6"
8
9DefVar $LogDir$
10DefVar $ProductId$ 
11DefVar $MinimumSpace$
12DefVar $InstallDir32$
13DefVar $InstallDir64$
14DefVar $ExitCode$
15DefVar $INST_SystemType$
16DefVar $INST_architecture$
17
18Set $INST_SystemType$ = GetSystemType
19set $INST_architecture$ = GetProductProperty("install_architecture","system specific")
20
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 $ProductId$       = "kliu.fontreg"
41Set $MinimumSpace$    = "1 MB"
42; the path were we find the product after the installation
43Set $InstallDir32$      = "%Systemroot%"
44Set $InstallDir64$      = "%Systemroot%"
45; ----------------------------------------------------------------
46
47if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$))
48        LogError "Not enough space on %SystemDrive%, " + $MinimumSpace$ + " on drive %SystemDrive% needed for " + $ProductId$
49        isFatalError
50        ; Stop process and set installation status to failed
51else
52        comment "Show product picture"
53        ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$
54       
55        if FileExists("%ScriptPath%\delsub3264.ins")
56                comment "Start uninstall sub section"
57                Sub "%ScriptPath%\delsub3264.ins"
58        endif
59       
60        comment "installing"
61
62        if (($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specific")) or ($INST_architecture$ = "both") or ($INST_architecture$ = "32 only")
63                Message "Installing " + $ProductId$ + " 32 Bit..."
64                comment "Copy files"
65                Files_install_32 /32Bit
66                comment "Patch Registry"
67                Registry_install /32Bit
68                comment "Create shortcuts"
69                LinkFolder_install
70        endif
71
72        if ($INST_SystemType$ = "64 Bit System") and (($INST_architecture$ = "system specific") or ($INST_architecture$ = "both") or ($INST_architecture$ = "64 only"))
73                Message "Installing " + $ProductId$ + " 64 Bit..."
74                comment "Copy files"
75                Files_install_64 /64Bit
76                comment "Patch Registry"
77                Registry_install /64Bit
78                comment "Create shortcuts"
79                LinkFolder_install
80        endif
81       
82endif
83
84[Files_install_32]
85copy "$FontReg32Exe$" "$InstallDir32$"
86
87
88[Files_install_64]
89copy "$FontReg64Exe$" "$InstallDir64$"
90
91[Registry_install]
92; Example of setting some values of an registry key:
93;
94; openkey [HKEY_LOCAL_MACHINE\Software\$ProductId$]
95; set "name1" = "some string value"
96; set "name2" = REG_DWORD:0001
97; set "name3" = REG_BINARY:00 af 99 cd
98
99[LinkFolder_install]
100; Example of deleting a folder from AllUsers startmenu:
101;
102; set_basefolder common_programs
103; delete_subfolder $ProductId$
104;
105; Example of creating an shortcut to the installed exe in AllUsers startmenu:
106;
107; set_basefolder common_programs
108; set_subfolder $ProductId$
109;
110; set_link
111;       name: $ProductId$
112;       target: <path to the program>
113;       parameters:
114;       working_dir: $InstallDir$
115;       icon_file:
116;       icon_index:
117; end_link
118;
119; Example of creating an shortcut to the installed exe on AllUsers desktop:
120;
121; set_basefolder common_desktopdirectory
122; set_subfolder ""
123;
124; set_link
125;       name: $ProductId$
126;       target: <path to the program>
127;       parameters: <some_param>
128;       working_dir: $InstallDir$
129;       icon_file: <path to icon file>
130;       icon_index: 2
131; end_link
132
133[Sub_check_exitcode]
134comment "Test for installation success via exit code"
135set $ExitCode$ = getLastExitCode
136; informations to exit codes see
137; http://msdn.microsoft.com/en-us/library/aa372835(VS.85).aspx
138; http://msdn.microsoft.com/en-us/library/aa368542.aspx
139if ($ExitCode$ = "0")
140        comment "Looks good: setup program gives exitcode zero"
141else
142        comment "Setup program gives a exitcode unequal zero: " + $ExitCode$
143        if ($ExitCode$ = "1605")
144                comment "ERROR_UNKNOWN_PRODUCT  1605    This action is only valid for products that are currently installed."
145                comment "Uninstall of a not installed product failed - no problem"
146        else
147                if ($ExitCode$ = "1641")
148                        comment "looks good: setup program gives exitcode 1641"
149                        comment "ERROR_SUCCESS_REBOOT_INITIATED 1641    The installer has initiated a restart. This message is indicative of a success."
150                else
151                        if ($ExitCode$ = "3010")
152                                comment "looks good: setup program gives exitcode 3010"
153                                comment "ERROR_SUCCESS_REBOOT_REQUIRED  3010    A restart is required to complete the install. This message is indicative of a success."
154                        else
155                                logError "Fatal: Setup program gives an unknown exitcode unequal zero: " + $ExitCode$
156                                isFatalError
157                        endif
158                endif
159        endif
160endif
161
Note: See TracBrowser for help on using the repository browser.