Code

source: microsoft.windowssidebar/CLIENT_DATA/setup32.ins @ 3a52ac

Revision 3a52ac, 5.2 KB checked in by geos_one, 7 years ago (diff)

require vcopy

  • 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$    = "150 MB"
41; the path were we find the product after the installation
42Set $InstallDir$      = "%ProgramFiles32Dir%\Windows Sidebar"
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%\X86"
64
65        comment "Copy Sidebar & RegSvr32 files"
66        Dosbatch_sidebar_regsvr /32Bit
67
68        Winbatch_install
69        Sub_check_exitcode
70       
71        comment "Copy files"
72        Files_install /32Bit
73       
74        comment "Register Vista Fonts"
75        Winbatch_fonts
76        Sub_check_exitcode
77
78        comment "Patch Registry"
79        Registry_install /32Bit
80       
81        comment "Create shortcuts"
82        LinkFolder_install
83
84        comment "Reboot"
85        ExitWindows /Reboot
86endif
87
88[Dosbatch_sidebar_regsvr]
89vcopy -v %ScriptPath%\X86 $LogDir$\sidebar-32
90vcopy -v %System%\regsvr32.exe" $LogDir$\sidebar-32\
91
92[Winbatch_install]
93rundll32 setupapi,InstallHinfSection DefaultInstall 132 $LogDir$\sidebar-32\sidebar.inf
94$LogDir$\sidebar-32\svcpack\gadgets.exe
95
96[Files_install]
97; copy the ini file to the InstallDir
98copy "$IniCfgFile$" "$InstallDir$"
99copy "$LogDir$\sidebar-32\*.ttf" "%Systemroot%\Fonts"
100
101[Winbatch_fonts]
102FontReg
103
104
105[Registry_install]
106; Example of setting some values of an registry key:
107;
108; openkey [HKEY_LOCAL_MACHINE\Software\$ProductId$]
109; set "name1" = "some string value"
110; set "name2" = REG_DWORD:0001
111; set "name3" = REG_BINARY:00 af 99 cd
112
113[LinkFolder_install]
114; Example of deleting a folder from AllUsers startmenu:
115;
116; set_basefolder common_programs
117; delete_subfolder $ProductId$
118;
119; Example of creating an shortcut to the installed exe in AllUsers startmenu:
120;
121; set_basefolder common_programs
122; set_subfolder $ProductId$
123;
124; set_link
125;       name: $ProductId$
126;       target: <path to the program>
127;       parameters:
128;       working_dir: $InstallDir$
129;       icon_file:
130;       icon_index:
131; end_link
132;
133; Example of creating an shortcut to the installed exe on AllUsers desktop:
134;
135; set_basefolder common_desktopdirectory
136; set_subfolder ""
137;
138; set_link
139;       name: $ProductId$
140;       target: <path to the program>
141;       parameters: <some_param>
142;       working_dir: $InstallDir$
143;       icon_file: <path to icon file>
144;       icon_index: 2
145; end_link
146
147[Sub_check_exitcode]
148comment "Test for installation success via exit code"
149set $ExitCode$ = getLastExitCode
150; informations to exit codes see
151; http://msdn.microsoft.com/en-us/library/aa372835(VS.85).aspx
152; http://msdn.microsoft.com/en-us/library/aa368542.aspx
153if ($ExitCode$ = "0")
154        comment "Looks good: setup program gives exitcode zero"
155else
156        comment "Setup program gives a exitcode unequal zero: " + $ExitCode$
157        if ($ExitCode$ = "1605")
158                comment "ERROR_UNKNOWN_PRODUCT  1605    This action is only valid for products that are currently installed."
159                comment "Uninstall of a not installed product failed - no problem"
160        else
161                if ($ExitCode$ = "1641")
162                        comment "looks good: setup program gives exitcode 1641"
163                        comment "ERROR_SUCCESS_REBOOT_INITIATED 1641    The installer has initiated a restart. This message is indicative of a success."
164                else
165                        if ($ExitCode$ = "3010")
166                                comment "looks good: setup program gives exitcode 3010"
167                                comment "ERROR_SUCCESS_REBOOT_REQUIRED  3010    A restart is required to complete the install. This message is indicative of a success."
168                        else
169                                logError "Fatal: Setup program gives an unknown exitcode unequal zero: " + $ExitCode$
170                                isFatalError
171                        endif
172                endif
173        endif
174endif
175
Note: See TracBrowser for help on using the repository browser.