Code

source: vlc.mediaplayer/CLIENT_DATA/setup32.ins @ 863ab3

Revision 863ab3, 4.6 KB checked in by geos_one, 8 years ago (diff)

rename

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