Code

source: dvdvideosoft.freestudio/CLIENT_DATA/setup32.ins @ 2f9657

Revision 2f9657, 5.1 KB checked in by geos_one, 6 years ago (diff)

remove desktop icon

  • 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$    = "100 MB"
41; the path were we find the product after the installation
42Set $InstallDir$      = "%ProgramFiles32Dir%\DVDVideoSoft"
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
78comment "Close the After Install browser window"
79sleepSeconds 3
80killtask "iexplore.exe"
81killtask "iron.exe"
82killtask "firefox.exe"
83killtask "chrome.exe"
84killtask "opera.exe"
85
86
87[Winbatch_install]
88"$InstallExe$" /sp- /silent /norestart /nocancel /SUPPRESSMSGBOXES /NOCANDY
89
90[Files_install]
91; copy the ini file to the InstallDir
92copy "$IniCfgFile$" "$InstallDir$"
93
94; Example of recursively copying some files into the installation directory:
95;
96; copy -s "%ScriptPath%\files\*.*" "$InstallDir$"
97
98[Registry_install]
99; Example of setting some values of an registry key:
100;
101; openkey [HKEY_LOCAL_MACHINE\Software\$ProductId$]
102; set "name1" = "some string value"
103; set "name2" = REG_DWORD:0001
104; set "name3" = REG_BINARY:00 af 99 cd
105
106[LinkFolder_install]
107set_basefolder common_desktopdirectory
108set_subfolder ""
109delete_element "DVDVideoSoft Free Studio"
110
111
112; Example of deleting a folder from AllUsers startmenu:
113;
114; set_basefolder common_programs
115; delete_subfolder $ProductId$
116;
117; Example of creating an shortcut to the installed exe in AllUsers startmenu:
118;
119; set_basefolder common_programs
120; set_subfolder $ProductId$
121;
122; set_link
123;       name: $ProductId$
124;       target: <path to the program>
125;       parameters:
126;       working_dir: $InstallDir$
127;       icon_file:
128;       icon_index:
129; end_link
130;
131; Example of creating an shortcut to the installed exe on AllUsers desktop:
132;
133; set_basefolder common_desktopdirectory
134; set_subfolder ""
135;
136; set_link
137;       name: $ProductId$
138;       target: <path to the program>
139;       parameters: <some_param>
140;       working_dir: $InstallDir$
141;       icon_file: <path to icon file>
142;       icon_index: 2
143; end_link
144
145[Sub_check_exitcode]
146comment "Test for installation success via exit code"
147set $ExitCode$ = getLastExitCode
148; informations to exit codes see
149; http://msdn.microsoft.com/en-us/library/aa372835(VS.85).aspx
150; http://msdn.microsoft.com/en-us/library/aa368542.aspx
151if ($ExitCode$ = "0")
152        comment "Looks good: setup program gives exitcode zero"
153else
154        comment "Setup program gives a exitcode unequal zero: " + $ExitCode$
155        if ($ExitCode$ = "1605")
156                comment "ERROR_UNKNOWN_PRODUCT  1605    This action is only valid for products that are currently installed."
157                comment "Uninstall of a not installed product failed - no problem"
158        else
159                if ($ExitCode$ = "1641")
160                        comment "looks good: setup program gives exitcode 1641"
161                        comment "ERROR_SUCCESS_REBOOT_INITIATED 1641    The installer has initiated a restart. This message is indicative of a success."
162                else
163                        if ($ExitCode$ = "3010")
164                                comment "looks good: setup program gives exitcode 3010"
165                                comment "ERROR_SUCCESS_REBOOT_REQUIRED  3010    A restart is required to complete the install. This message is indicative of a success."
166                        else
167                                logError "Fatal: Setup program gives an unknown exitcode unequal zero: " + $ExitCode$
168                                isFatalError
169                        endif
170                endif
171        endif
172endif
173
Note: See TracBrowser for help on using the repository browser.